/* ==========================================================================
   Eshcol Organic Farm - Custom Product Ordering System Stylesheet
   ========================================================================== */

/* Modal Backdrop */
.eshcol-order-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(12, 31, 20, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-order-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Dialog Window */
.eshcol-order-modal-window {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(10, 36, 21, 0.35),
              0 0 0 1px rgba(27, 67, 50, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-order-modal-backdrop.is-active .eshcol-order-modal-window {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.eshcol-order-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5ede7;
}

.eshcol-order-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eshcol-order-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ebf6ee;
  border: 1px solid #cce5d4;
  padding: 4px;
  object-fit: contain;
}

.eshcol-order-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #123824;
  margin: 0;
  line-height: 1.2;
}

.eshcol-order-subtitle {
  font-size: 0.78rem;
  color: #4b6655;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.eshcol-order-subtitle .trust-dot-small {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #25d366;
}

.eshcol-order-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #d5e3da;
  background: #f4f8f5;
  color: #274c37;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eshcol-order-close-btn:hover {
  background: #e3efe7;
  color: #0f301e;
  transform: rotate(90deg);
}

/* Modal Scrollable Body */
.eshcol-order-body {
  padding: 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Sections */
.eshcol-order-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eshcol-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eshcol-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #153e28;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eshcol-section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1b4332;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Produce Item Card */
.eshcol-produce-card {
  background: #f8faf8;
  border: 1px solid #dae7de;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease;
}

.eshcol-produce-card:focus-within {
  border-color: #52b788;
}

.eshcol-produce-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.eshcol-produce-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid #d2e4d7;
  background: #eef5f0;
  flex-shrink: 0;
}

.eshcol-produce-details {
  flex-grow: 1;
}

.eshcol-produce-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: #143b27;
  line-height: 1.25;
  margin: 0 0 4px;
}

.eshcol-produce-tamil {
  display: inline-block;
  background: #eaf5ed;
  color: #1b5e39;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #c7e5d0;
  margin-right: 6px;
}

.eshcol-produce-rate {
  font-size: 0.86rem;
  font-weight: 600;
  color: #3b5f49;
}

.eshcol-produce-remove-btn {
  background: transparent;
  border: none;
  color: #8c9d92;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.eshcol-produce-remove-btn:hover {
  color: #b91c1c;
  background: #fee2e2;
}

/* Weight Selection Pills */
.eshcol-weight-selector-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2b543b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.eshcol-weight-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 480px) {
  .eshcol-weight-pills-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.eshcol-weight-pill {
  appearance: none;
  background: #ffffff;
  border: 1.5px solid #d1e2d6;
  border-radius: 10px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #234b35;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eshcol-weight-pill:hover {
  border-color: #52b788;
  background: #f0f8f3;
  color: #113824;
}

.eshcol-weight-pill.is-selected {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  border-color: #1b4332;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.25);
}

/* Custom Weight Stepper */
.eshcol-custom-weight-box {
  display: none;
  background: #ffffff;
  border: 1px dashed #74c69d;
  border-radius: 12px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.eshcol-custom-weight-box.is-visible {
  display: flex;
}

.eshcol-stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #d0e4d6;
  background: #f4f9f6;
  color: #16402a;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eshcol-stepper-btn:hover {
  background: #2d6a4f;
  border-color: #2d6a4f;
  color: #ffffff;
}

.eshcol-custom-weight-display {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.eshcol-custom-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #133c27;
}

.eshcol-custom-hint {
  font-size: 0.72rem;
  color: #557763;
}

/* Produce Bottom Subtotal Row */
.eshcol-produce-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #e7efe9;
  font-size: 0.88rem;
}

.eshcol-subtotal-label {
  color: #4b6655;
  font-weight: 600;
}

.eshcol-subtotal-price {
  font-size: 1.12rem;
  font-weight: 800;
  color: #123824;
}

/* Add Another Produce Button */
.eshcol-add-more-wrap {
  display: flex;
  justify-content: flex-start;
}

.eshcol-add-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #edf6ef;
  border: 1px dashed #52b788;
  color: #1c5035;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eshcol-add-more-btn:hover {
  background: #d8f3dc;
  border-color: #2d6a4f;
  color: #113622;
}

/* Customer Details Form */
.eshcol-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .eshcol-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .eshcol-form-full {
    grid-column: span 2;
  }
}

.eshcol-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eshcol-input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #204632;
}

.eshcol-input-label .required-star {
  color: #c92a2a;
  margin-left: 2px;
}

.eshcol-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.eshcol-input {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  color: #143623;
  background: #ffffff;
  border: 1.5px solid #d4e3d8;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eshcol-input:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.eshcol-input.is-invalid {
  border-color: #e03131;
  background: #fff8f8;
}

.eshcol-phone-wrap {
  display: flex;
}

.eshcol-phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: #edf5f0;
  border: 1.5px solid #d4e3d8;
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #234d36;
}

.eshcol-phone-input {
  border-radius: 0 10px 10px 0 !important;
}

.eshcol-field-error {
  font-size: 0.75rem;
  color: #c92a2a;
  display: none;
  margin-top: 2px;
}

.eshcol-field-error.is-visible {
  display: block;
}

/* Order Summary Box */
.eshcol-order-summary-box {
  background: #f4f8f5;
  border: 1.5px solid #d2e4d7;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eshcol-summary-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eshcol-summary-item-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.92rem;
  color: #284c37;
}

.eshcol-summary-item-name {
  font-weight: 600;
}

.eshcol-summary-item-qty {
  font-size: 0.8rem;
  color: #557763;
  margin-left: 6px;
}

.eshcol-summary-item-val {
  font-weight: 700;
  color: #143a26;
}

.eshcol-summary-divider {
  height: 1px;
  background: #d8e6dc;
  margin: 4px 0;
}

.eshcol-summary-delivery-note {
  font-size: 0.78rem;
  color: #4b6b57;
  display: flex;
  align-items: center;
  gap: 6px;
}

.eshcol-summary-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 4px;
}

.eshcol-summary-total-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: #123824;
}

.eshcol-summary-total-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #143d28;
}

/* Order Footer Actions */
.eshcol-order-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid #e5ede7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eshcol-btn-place-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #25d366 0%, #1ea952 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-btn-place-order:hover:not(:disabled) {
  background: linear-gradient(135deg, #2be46f 0%, #20b859 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
}

.eshcol-btn-place-order:active:not(:disabled) {
  transform: translateY(0);
}

.eshcol-btn-place-order:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

.eshcol-order-security-note {
  font-size: 0.74rem;
  color: #557260;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Loading Spinner */
.eshcol-btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: eshcol-spin 0.7s linear infinite;
}

.eshcol-btn-place-order.is-loading .eshcol-btn-spinner {
  display: inline-block;
}

.eshcol-btn-place-order.is-loading .eshcol-btn-text {
  opacity: 0.85;
}

@keyframes eshcol-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Order Confirmation View
   ========================================================================== */

.eshcol-confirmation-container {
  display: none;
  padding: 32px 24px 28px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow-y: auto;
}

.eshcol-confirmation-container.is-visible {
  display: flex;
}

.eshcol-confirm-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #d8f3dc;
  border: 3px solid #52b788;
  color: #1b4332;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: eshcol-bounce 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes eshcol-bounce {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.eshcol-confirm-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #113b24;
  margin: 0;
  line-height: 1.25;
}

.eshcol-confirm-subtitle {
  font-size: 0.98rem;
  color: #436250;
  max-width: 440px;
  margin: 0;
  line-height: 1.5;
}

.eshcol-confirm-id-card {
  width: 100%;
  background: #edf5f0;
  border: 1.5px solid #cce3d3;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eshcol-confirm-id-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4b6c58;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

.eshcol-confirm-id-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #14442a;
  font-family: monospace;
  letter-spacing: 0.05em;
}

.eshcol-copy-btn {
  background: #ffffff;
  border: 1px solid #c2dbca;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4d33;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eshcol-copy-btn:hover {
  background: #e2f2e7;
  border-color: #52b788;
}

/* Confirmation Summary Details */
.eshcol-confirm-receipt {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e1ebe3;
  border-radius: 14px;
  padding: 16px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eshcol-confirm-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #537560;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #edf4ef;
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.eshcol-confirm-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #385945;
}

.eshcol-confirm-meta-row strong {
  color: #163e28;
}

.eshcol-confirm-wa-status-box {
  width: 100%;
  background: #f0f9f3;
  border: 1px solid #b7dfc4;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #1a4d31;
  text-align: left;
  line-height: 1.45;
}

.eshcol-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.eshcol-btn-continue-order {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  background: #1b4332;
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eshcol-btn-continue-order:hover {
  background: #2d6a4f;
  transform: translateY(-1px);
}

.eshcol-btn-whatsapp-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #25d366 0%, #1ea952 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.25s ease;
}

.eshcol-btn-whatsapp-fallback:hover {
  background: linear-gradient(135deg, #2be46f 0%, #20b859 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
  color: #ffffff !important;
}

.eshcol-btn-whatsapp-fallback .whatsapp-btn-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ==========================================================================
   Floating Mini Cart Badge
   ========================================================================== */

.eshcol-floating-cart-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(27, 67, 50, 0.35);
  font-size: 0.94rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.eshcol-floating-cart-pill.is-active {
  display: flex;
}

.eshcol-floating-cart-pill:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 32px rgba(27, 67, 50, 0.45);
}

.eshcol-cart-pill-count {
  background: #25d366;
  color: #0d281a;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 2px 7px;
}

/* Mobile full-width bottom sheet */
@media (max-width: 680px) {
  .eshcol-order-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  
  .eshcol-order-modal-window {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }

  .eshcol-order-modal-backdrop.is-active .eshcol-order-modal-window {
    transform: translateY(0);
  }

  .eshcol-order-header {
    padding: 14px 18px;
  }

  .eshcol-order-body {
    padding: 18px 16px;
    gap: 18px;
  }

  .eshcol-order-footer {
    padding: 12px 16px;
  }

  .eshcol-floating-cart-pill {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 0.88rem;
  }
}
