/* ====== BUTTONS ====== */

.button-group {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.action-button {
  background-color: #0073aa;
  color: white;
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
}

.action-button:hover {
  background-color: #005a87;
}

/* ====== SHIPPING FORM STYLING ====== */

.form_wrapper {
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.form_wrapper h3 {
  font-size: 1.5em;
  margin-bottom: 20px;
}

.form_wrapper label {
  display: block;
  margin-bottom: 5px;
}

.form_wrapper input[type="text"],
.form_wrapper input[type="email"],
.form_wrapper input[type="number"] {
  width: 100%;
  padding: 10px;
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 15px;
  box-sizing: border-box;
  font-size: 1.6rem;
}

.form_wrapper .submit-button:hover {
  background-color: var(--button-submit-bg-color-hover);
}

/* === DATE ===== */
.form_wrapper input[type="date"] {
  width: 100%;
  padding: 10px;
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 15px;
  box-sizing: border-box;
  font-size: 1.6rem;
  font-family: inherit; /* Inherit font from the form */
}

.form_wrapper input:focus {
  outline: none;
  border-color: #007bff; /* Example focus color */
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); /* Example focus shadow */
}

/* ====== FORM SELECTOR ====== */

.form_wrapper select {
  font-size: 1rem;
  border-radius: var(--border-radius-small);
  padding: 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="currentColor" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
  line-height: 1.5;
  box-sizing: border-box;
  width: 100%;
  margin: 1rem 0;
}

.form_wrapper select:hover {
  border-color: #aaa;
}

.form_wrapper select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form_wrapper select:disabled {
  background-color: #f0f0f0;
  border-color: #ddd;
  color: #888;
  cursor: not-allowed;
}

.form_wrapper select.error {
  border-color: red;
}

button.submit_dawa_button {
  padding: var(--padding-button);
  margin: 1rem 0;
  background-color: var(--button-submit-bg-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  font-size: var(--h3-size);
  width: 100%;
}

/* === BATCH === */
.form_wrapper div.batch {
  padding: var(--padding-small);
  background-color: rgb(251, 225, 156);
  border-radius: 4px;
}

/* === SHIP PRODUCT === */
.ship-product {
  padding: var(--padding-big);
  background-color: rgb(251, 225, 156);
  border-radius: 4px;
  margin-bottom: 2em;
}

/* === SHIPPING OPTIONS DISPLAY === */
.ship-product.shipping-options-display {
  background-color: #ccc !important;
  margin-top: 2em !important;
}

/* === WAREHOUSE LOGISTICS === */
.warehouse-logistics {
  padding: var(--padding-big);
  background-color: rgb(203, 236, 247);
  border-radius: 4px;
  margin-bottom: 2em;
}

.warehouse-logistics form {
  margin-top: 1em;
}

h4.form-title {
  margin: 2px 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.ship-product .form_wrapper {
  margin-top: 17px;
}

/* ====== SHIPPING OPTIONS FORM ====== */

.shipping-options-form {
  max-width: 800px;
  margin: 20px auto;
  padding: 30px;
  background-color: transparent;
}

.shipping-options-form h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.form-section {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.form-label .required {
  color: #d63638;
  margin-left: 2px;
}

/* Shipping Company Grid */
.shipping-company-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 10px;
}

@media (max-width: 992px) {
  .shipping-company-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .shipping-company-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.shipping-company-option {
  position: relative;
}

.shipping-company-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.company-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fff;
  height: 120px;
  box-sizing: border-box;
}

.company-label:hover {
  border-color: #0073aa;
  background-color: #f7f9fc;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 115, 170, 0.15);
}

.shipping-company-option input[type="radio"]:checked + .company-label {
  border-color: #05881b;
  border-width: 3px;
  background-color: #e8f5e9;
  box-shadow: 0 0 0 4px rgba(5, 136, 27, 0.15);
}

/* Keep hover effect even when selected, but don't lift */
.shipping-company-option input[type="radio"]:checked + .company-label:hover {
  transform: none;
  box-shadow: 0 0 0 4px rgba(5, 136, 27, 0.25);
}

/* Logo-only buttons (FedEx, UPS, USPS) */
.company-label-logo {
  padding: 25px 15px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.company-label-logo img {
  max-width: 100px;
  max-height: 70px;
  object-fit: contain;
}

/* Other button with icon and text */
.company-label-other {
  flex-direction: column;
}

.company-label-other .other-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.company-label-other .other-icon svg {
  width: 45px;
  height: 45px;
  fill: #666;
  transition: fill 0.3s ease;
}

.company-label-other:hover .other-icon svg {
  fill: #0073aa;
}

.shipping-company-option
  input[type="radio"]:checked
  + .company-label-other
  .other-icon
  svg {
  fill: #05881b;
}

.company-label-other span {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  text-align: center;
  display: block;
  margin-top: 0;
  transition: color 0.3s ease;
}

.shipping-company-option input[type="radio"]:checked + .company-label-other span {
  color: #05881b;
}

/* Checkbox Section */
.checkbox-section {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.checkbox-group {
  margin-bottom: 12px;
}

.checkbox-group:last-child {
  margin-bottom: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin: 0 10px 0 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

.checkbox-label span {
  font-size: 14px;
  color: #333;
  line-height: 18px;
}

/* Textarea */
.form_wrapper textarea {
  width: 100%;
  padding: 12px;
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 5px;
  box-sizing: border-box;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form_wrapper textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* File Upload Section */
.file-upload-section {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.file-upload-group {
  margin-bottom: 20px;
}

.file-upload-group:last-child {
  margin-bottom: 0;
}

.form_wrapper input[type="file"] {
  width: 100%;
  padding: 10px;
  background-color: #fff;
  border: 2px dashed #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form_wrapper input[type="file"]:hover {
  border-color: #0073aa;
}

.file-help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Form Buttons */
.form-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: space-between;
  font-family: Lovelo, sans-serif;
  letter-spacing: 2px;
}

.back-button {
  padding: var(--padding-button, 12px 24px);
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: var(--border-radius-small, 4px);
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  font-size: var(--h3-size, 16px);
  flex: 1;
  transition: background-color 0.3s ease;
  width: 100%;
  font-family: Lovelo, sans-serif;
  letter-spacing: 2px;
}

.back-button:hover {
  background-color: #5a6268;
}

.form-buttons .submit_dawa_button {
  flex: 1;
  width: 100%;
  margin: 0;
  font-family: Lovelo, sans-serif;
  letter-spacing: 2px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .form-buttons {
    flex-direction: column;
  }

  .back-button,
  .form-buttons .submit_dawa_button {
    width: 100%;
  }

  .shipping-options-form {
    padding: 15px;
  }

  .company-label {
    padding: 15px 8px;
    height: 100px;
  }

  .company-label-logo {
    padding: 20px 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .company-label-logo img {
    max-width: 80px;
    max-height: 50px;
  }

  .company-label-other .other-icon {
    width: 50px;
    height: 50px;
  }

  .company-label-other .other-icon svg {
    width: 45px;
    height: 45px;
  }

  .company-label-other span {
    font-size: 13px;
  }
}

/* Hidden sections */
#carrier_account_section,
#additional_services_section {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

/* ====== VALIDATION ERROR STYLES ====== */

/* Error state for select dropdowns */
.form_wrapper select.error {
  border-color: #d63638 !important;
  background-color: #ffe6e8 !important;
  box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.15) !important;
}

/* Error state for text inputs */
.form_wrapper input[type="text"].error,
.form_wrapper input[type="number"].error,
.form_wrapper input[type="email"].error {
  border-color: #d63638 !important;
  background-color: #ffe6e8 !important;
  box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.15) !important;
}

/* Error state for textarea */
.form_wrapper textarea.error {
  border-color: #d63638 !important;
  background-color: #ffe6e8 !important;
  box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.15) !important;
}

/* Error state for shipping company radio grid */
.shipping-company-grid.error {
  padding: 10px;
  border: 2px solid #d63638;
  border-radius: 8px;
  background-color: rgba(214, 54, 56, 0.05);
}

/* Error message for form sections */
.form-section .error-message {
  display: block;
  color: #d63638;
  font-size: 13px;
  margin-top: 5px;
  font-weight: 500;
}

/* Error highlight for radio button labels when none selected */
.shipping-company-grid.error .company-label {
  border-color: #d63638;
}

/* Make the label text red when shipping company section has error */
#shipping-company-section.error .form-label {
  color: #d63638;
}
