/* Craftella Direct Checkout & Razorpay Integration Styles */

/* Checkout Drawer Form Transition */
.cart-checkout-section {
  display: none;
  padding: 16px 20px 24px;
  background: #fdfbf7;
  border-top: 1px solid #e8dec9;
  animation: fadeInCheckout 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cart-checkout-section.active {
  display: block;
}

@keyframes fadeInCheckout {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2d7c0;
}

.checkout-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #203d79;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkout-back-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.checkout-back-btn:hover {
  color: #203d79;
  background: rgba(32, 61, 121, 0.06);
}

/* Form Fields */
.checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group-full {
  grid-column: span 2;
}

.checkout-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #444444;
  margin-bottom: 4px;
}

.checkout-label span.req {
  color: #c93b2b;
}

.checkout-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d4cbb8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.checkout-input:focus {
  outline: none;
  border-color: #203d79;
  box-shadow: 0 0 0 3px rgba(32, 61, 121, 0.12);
}

.checkout-input::placeholder {
  color: #999;
}

/* Pay with Razorpay Button */
.btn-razorpay-pay {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #203d79 0%, #162b55 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(32, 61, 121, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-razorpay-pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(32, 61, 121, 0.35);
}

.btn-razorpay-pay:active {
  transform: translateY(0);
}

.btn-razorpay-pay:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.razorpay-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: #777;
}

.razorpay-badges span {
  display: inline-flex;
  align-items: center;
  background: #f0e9dc;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Button in Cart Footer */
.btn-checkout-trigger {
  width: 100%;
  padding: 14px 20px;
  background: #203d79;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(32, 61, 121, 0.2);
}

.btn-checkout-trigger:hover {
  background: #172d5a;
  transform: translateY(-1px);
}

/* Order Confirmation Success Modal */
#order-success-modal {
  position: fixed;
  inset: 0;
  z-index: 10000000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#order-success-modal.open {
  display: flex !important;
}

.order-success-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.order-success-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.order-success-badge svg {
  width: 36px;
  height: 36px;
}

.order-success-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}

.order-success-card p.success-intro {
  font-size: 14px;
  color: #555555;
  margin: 0 0 20px;
}

.order-meta-box {
  background: #fdfaf6;
  border: 1px solid #e8dec9;
  border-radius: 14px;
  padding: 14px 18px;
  text-align: left;
  margin-bottom: 20px;
  font-size: 13px;
}

.order-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.order-meta-row:last-child {
  margin-bottom: 0;
}

.order-meta-row span.label {
  color: #777;
}

.order-meta-row span.value {
  font-weight: 600;
  color: #203d79;
}

.order-items-summary {
  text-align: left;
  margin-bottom: 20px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 14px;
}

.order-items-summary-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 8px;
  display: block;
}

.order-item-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed #f0f0f0;
}

.order-item-line:last-child {
  border-bottom: none;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp-confirm {
  width: 100%;
  padding: 12px 18px;
  background: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-whatsapp-confirm:hover {
  opacity: 0.92;
}

.btn-close-success {
  background: transparent;
  border: 1px solid #d4cbb8;
  color: #333333;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-success:hover {
  background: #f7f3eb;
}


/* Phone Verification with Firebase OTP */
.phone-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.phone-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 12px;
}

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

.phone-prefix {
  position: absolute;
  left: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #555;
  pointer-events: none;
  z-index: 2;
}

.phone-input-wrap input.checkout-input {
  padding-left: 44px;
  padding-right: 85px;
}

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

.email-input-wrap input.checkout-input {
  padding-right: 85px;
}

.btn-checkout-otp {
  position: absolute;
  right: 6px;
  background: #203d79;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.btn-checkout-otp:hover {
  background: #172d59;
}

.btn-checkout-otp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.checkout-otp-box {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fdfaf6;
  border: 1px dashed #e4d7bf;
  border-radius: 12px;
  animation: fadeInCheckout 0.25s ease both;
}

.otp-prompt {
  margin: 0 0 8px;
  font-size: 12px;
  color: #555;
}

.otp-prompt strong {
  color: #203d79;
}

.otp-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.otp-code-field {
  width: 130px !important;
  letter-spacing: 3px;
  font-size: 15px !important;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px !important;
}

.btn-checkout-otp-submit {
  background: #203d79;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-checkout-otp-submit:hover {
  background: #172d59;
}

.btn-checkout-otp-resend {
  background: transparent;
  color: #203d79;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.checkout-otp-msg {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.checkout-otp-msg.error {
  color: #b91c1c;
}

.checkout-otp-msg.success {
  color: #15803d;
}

/* Ensure Google reCAPTCHA challenge modal & overlays sit on top of checkout drawer & modals */
iframe[src*="recaptcha/api2/bframe"],
iframe[src*="recaptcha/enterprise/bframe"],
div:has(> iframe[src*="recaptcha/api2/bframe"]),
div:has(> iframe[src*="recaptcha/enterprise/bframe"]),
div:has(> div > iframe[src*="recaptcha/api2/bframe"]),
div:has(> div > iframe[src*="recaptcha/enterprise/bframe"]),
body > div[style*="2000000000"] {
  z-index: 2147483647 !important;
}

/* ============================================================
   DELHIVERY AUTOMATIC SHIPPING CHARGES & CARRIER STYLES
   ============================================================ */

.pincode-helper-text {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.3;
  min-height: 15px;
  color: #64748b;
  transition: all 0.2s ease;
}

.pincode-helper-text.success {
  color: #15803d;
  font-weight: 600;
}

.pincode-helper-text.loading {
  color: #203d79;
  font-style: italic;
}

.pincode-helper-text.error {
  color: #b91c1c;
  font-weight: 600;
}

/* Shipping Card Container */
.checkout-shipping-card {
  margin-top: 14px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid #e5ded0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(32, 61, 121, 0.04);
}

.shipping-carrier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0eae1;
  margin-bottom: 12px;
}

.delhivery-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.delhivery-logo-tag {
  background: #dc2626;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.delhivery-eta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 8px;
  border-radius: 12px;
}

/* Service Mode Radio Cards */
.delhivery-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.delhivery-service-opt {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid #e2d7c0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  background: #faf8f5;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.delhivery-service-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.delhivery-service-opt.selected {
  border-color: #203d79;
  background: #f0f4fc;
  box-shadow: 0 0 0 1px #203d79;
}

.service-opt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.service-opt-title {
  font-size: 12px;
  font-weight: 700;
  color: #203d79;
}

.service-opt-price {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
}

.service-opt-eta {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
}

/* Price Breakdown in Shipping Card */
.checkout-price-breakdown {
  padding-top: 10px;
  border-top: 1px dashed #e2d7c0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #555555;
}

.breakdown-row.total-row {
  font-size: 14.5px;
  font-weight: 800;
  color: #203d79;
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid #f0eae1;
}

@media (max-width: 480px) {
  .delhivery-services-grid {
    grid-template-columns: 1fr;
  }
}


