/* Partial COD Cart Button Styles */
.partial-cod-cart-button {
  margin: 16px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.partial-cod-banner {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: white;
}

.partial-cod-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.partial-cod-icon {
  font-size: 24px;
}

.partial-cod-text h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
}

.partial-cod-text p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.partial-cod-button {
  width: 100%;
  padding: 12px 24px;
  background: white;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.partial-cod-button:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

.partial-cod-subtitle {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* Modal Styles */
.partial-cod-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.6) !important;
  z-index: 2147483647 !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease-out;
  margin: 0 !important;
  padding: 0 !important;
  inset: 0 !important;
}

/* Only show when explicitly opened */
.partial-cod-modal.show {
  display: flex !important;
}

/* Override any theme styles that might interfere */
.partial-cod-modal * {
  box-sizing: border-box !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Prevent body scroll when modal is open and handle sticky elements */
body.partial-cod-modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* Fix sticky header overlap when modal is open */
body.partial-cod-modal-open .shopify-section-header,
body.partial-cod-modal-open header,
body.partial-cod-modal-open .header,
body.partial-cod-modal-open .site-header,
body.partial-cod-modal-open [data-section-type="header"],
body.partial-cod-modal-open .sticky-header,
body.partial-cod-modal-open [class*="sticky"],
body.partial-cod-modal-open .header-section:has(>#header-component[sticky=always]),
body.partial-cod-modal-open .header-section:has(>#header-component[sticky=scroll-up][data-sticky-state=active]) {
  z-index: 1 !important;
}

.partial-cod-modal-content {
  background: white !important;
  border-radius: 12px;
  width: 95%;
  max-width: 900px;
  max-height: 95vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative !important;
  animation: slideIn 0.3s ease-out;
  margin: 0 !important;
}

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

.partial-cod-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.partial-cod-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.partial-cod-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.partial-cod-close:hover {
  background: #f3f4f6;
}

/* Steps Navigation */
.partial-cod-steps {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.partial-cod-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s ease;
}

.partial-cod-step.active {
  background: #fef2f2;
  color: #dc2626;
}

.partial-cod-step.completed {
  background: #f0fdf4;
  color: #16a34a;
}

.step-icon {
  font-size: 16px;
}

/* Modal Body */
.partial-cod-modal-body {
  padding: 32px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-icon {
  width: 64px;
  height: 64px;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.form-header h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.form-header p {
  margin: 0;
  color: #6b7280;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.phone-group {
  display: flex;
  align-items: center;
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 12px;
  font-size: 14px;
}

.phone-group input {
  border-radius: 0 6px 6px 0 !important;
}

input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.delivery-check {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #16a34a;
}

.check-icon {
  width: 16px;
  height: 16px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Payment Options */
.payment-options {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.payment-option {
  flex: 1;
}

.payment-label {
  display: block;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-label:hover {
  border-color: #d1d5db;
}

input[type="radio"]:checked + .payment-content,
.payment-label:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
}

.payment-content {
  flex: 1;
}

.payment-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.payment-desc {
  font-size: 14px;
  color: #6b7280;
}

/* Payment Breakdown */
.payment-breakdown {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.payment-breakdown h4 {
  margin: 0 0 12px 0;
  font-weight: 600;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.breakdown-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-weight: 600;
}

/* Tax Disclaimer Card */
.tax-disclaimer-card {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.tax-disclaimer-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tax-disclaimer-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tax-disclaimer-text {
  font-size: 14px;
  line-height: 1.4;
  color: #92400e;
}

.tax-disclaimer-text strong {
  color: #78350f;
  font-weight: 600;
}

/* Order Summary */
.order-summary {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
}

.order-summary h4 {
  margin: 0 0 12px 0;
  font-weight: 600;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 16px;
}

.free {
  color: #16a34a;
}

/* Modal Footer */
.partial-cod-modal-footer {
  padding: 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.btn-primary {
  background: #dc2626;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #b91c1c;
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: #6b7280;
  padding: 12px 24px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
}

/* Cart Product Display in Button (now removed) */
.cart-products-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Modal Cart Products Section */
.modal-cart-products {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.cart-products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.cart-products-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.cart-item-count {
  font-size: 14px;
  color: #64748b;
  background: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 500;
}

.cart-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.modal-item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-item-placeholder {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.modal-item-details {
  flex: 1;
  min-width: 0;
}

.modal-item-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.modal-item-variant {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.modal-item-quantity {
  font-size: 12px;
  color: #64748b;
}

.modal-item-price {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
  flex-shrink: 0;
}

.cart-products-total {
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.modal-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #1e293b;
  font-size: 16px;
}

.cart-product-images {
  display: flex;
  gap: 8px;
}

.cart-product-item {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-product-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-product-placeholder {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.cart-more-items {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.cart-summary-text {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.cart-total-price {
  font-size: 24px;
  font-weight: bold;
  color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .partial-cod-modal-content {
    width: 98%;
    height: 98vh;
    margin: 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
  }
  
  .partial-cod-modal-header {
    padding: 16px;
    flex-shrink: 0;
  }
  
  .partial-cod-modal-header h2 {
    font-size: 20px;
  }
  
  .partial-cod-modal-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  
  .partial-cod-modal-footer {
    padding: 16px;
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
  }
  
  /* Modal Cart Products Mobile */
  .modal-cart-products {
    padding: 16px;
    margin-bottom: 20px;
  }
  
  .cart-products-header h4 {
    font-size: 16px;
  }
  
  .cart-item-count {
    font-size: 12px;
    padding: 3px 8px;
  }
  
  .modal-cart-item {
    padding: 10px;
    gap: 10px;
  }
  
  .modal-item-image {
    width: 50px;
    height: 50px;
  }
  
  .modal-item-title {
    font-size: 13px;
    line-height: 1.2;
  }
  
  .modal-item-variant,
  .modal-item-quantity {
    font-size: 11px;
  }
  
  .modal-item-price {
    font-size: 13px;
  }
  
  .modal-subtotal {
    font-size: 15px;
  }
  
  /* Steps Mobile */
  .partial-cod-steps {
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    justify-content: space-around;
  }
  
  .partial-cod-step {
    font-size: 11px;
    padding: 6px 10px;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
  }
  
  .step-icon {
    font-size: 14px;
  }
  
  /* Form Elements Mobile */
  .form-header {
    margin-bottom: 24px;
  }
  
  .form-header h3 {
    font-size: 20px;
  }
  
  .form-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .form-group {
    margin-bottom: 14px;
  }
  
  input, select {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .phone-prefix {
    padding: 14px;
  }
  
  /* Payment Options Mobile */
  .payment-options {
    flex-direction: column;
    gap: 12px;
  }
  
  .payment-label {
    padding: 14px;
  }
  
  .payment-title {
    font-size: 15px;
  }
  
  .payment-desc {
    font-size: 13px;
  }
  
  /* Breakdown and Summary Mobile */
  .payment-breakdown,
  .order-summary,
  .tax-disclaimer-card {
    padding: 14px;
  }
  
  .tax-disclaimer-content {
    gap: 10px;
  }
  
  .tax-disclaimer-icon {
    font-size: 16px;
  }
  
  .tax-disclaimer-text {
    font-size: 13px;
  }
  
  .breakdown-item,
  .summary-item {
    font-size: 13px;
  }
  
  .breakdown-total,
  .summary-total {
    font-size: 15px;
  }
  
  /* Buttons Mobile */
  .btn-primary,
  .btn-secondary {
    padding: 14px 20px;
    font-size: 15px;
  }
  
  .partial-cod-modal-footer {
    gap: 8px;
  }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
  .partial-cod-modal-content {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  
  .modal-cart-products {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  .tax-disclaimer-card {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  .tax-disclaimer-content {
    gap: 8px;
  }
  
  .tax-disclaimer-icon {
    font-size: 14px;
  }
  
  .tax-disclaimer-text {
    font-size: 12px;
  }
  
  .modal-cart-item {
    padding: 8px;
    gap: 8px;
  }
  
  .modal-item-image {
    width: 45px;
    height: 45px;
  }
  
  .partial-cod-steps {
    padding: 8px;
    gap: 6px;
  }
  
  .partial-cod-step {
    font-size: 10px;
    padding: 5px 8px;
    min-width: 70px;
  }
  
  .step-icon {
    font-size: 12px;
  }
  
  .partial-cod-modal-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  
  .form-header {
    margin-bottom: 20px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
}