/* Modern CSS for Custom Checkout Widget */
/* Primary Brand Color: #FC8934 */

:root {
  --primary-color: #fc8934;
  --primary-hover: #e67a2e;
  --primary-light: #fdf4ed;
  --secondary-color: #2c3e50;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --border-color: #e1e8ed;
  --background-light: #f8f9fa;
  --white: #ffffff;
  --shadow: 0px 9px 33px 0px rgba(2, 8, 53, 0.05);
  /* --shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

.custom-checkout-widget {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background-light);
  min-height: 100vh;
}

.checkout-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

/* Product Selection Section */
.product-selection {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-selection:hover {
  box-shadow: var(--shadow-hover);
}

.showcase-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.deselect-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.deselect-all-btn,
.select-all-btn {
  padding: 8px 16px;
  border: 2px solid var(--primary-color);
  background: var(--white);
  color: var(--primary-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  font-size: 14px;
}

.deselect-all-btn:hover,
.select-all-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
}

.product-option {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 15px;
  transition: var(--transition);
  cursor: pointer;
}

.product-option:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.product-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.showcase-product-input {
  margin-right: 15px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

.product-info {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 15px;
}

.product-info img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
}

.product-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 16px;
}

.product-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 18px;
}

/* Checkout Wrapper */
/* .checkout-wrapper {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  align-items: start;
} */

/* Billing Section */
.billing-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.billing-section h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(252, 137, 52, 0.1);
}

/* .form-group input:required:invalid {
  border-color: var(--danger-color);
} */

/* Shipping Section */
.shipping-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.shipping-section h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.shipping-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shipping-method {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  transition: var(--transition);
  cursor: pointer;
}

.shipping-method:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.shipping-method label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  width: 100%;
}

.shipping-method input[type='radio'] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  outline: none;
}

.shipping-text {
  flex: 1;
  font-weight: 500;
  color: var(--text-dark);
}

.shipping-cost {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 16px;
}

/* Payment Section */
.payment-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}
.order-totals h4,
.payment-section h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.payment-method {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  transition: var(--transition);
  cursor: pointer;
}

.payment-method:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.payment-method label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
}

.payment-method input[type='radio'] {
  margin-right: 12px;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  outline: none;
}

.payment-title {
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
}

.payment-description {
  margin-top: 8px;
  margin-left: 30px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.4;
}

.payment-privacy {
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.4;
  padding: 15px;
  background: var(--background-light);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-color);
}

/* Order Summary */
.order-summary {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow);
  /* position: sticky;
  top: 20px; */
  height: fit-content;
  margin-bottom: 20px;
}

.order-summary h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.cart-products-list,
.default-products-list,
.showcase-products-list {
  margin-bottom: 20px;
}

.cart-products-title,
.default-products-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 15px;
  padding: 10px;
  background: var(--primary-light);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-color);
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  transition: var(--transition);
  background: var(--primary-light);
}

.order-item:hover {
  border-color: var(--primary-color);
}

.item-info {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
}

.item-info img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.item-details {
  flex: 1;
}

.item-name {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 11px;
  margin-bottom: 5px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-quantity {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.quantity {
  color: var(--text-light);
  font-size: 14px;
}

.product-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.default-badge {
  background: var(--success-color);
  color: var(--white);
}

.item-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 16px;
}

/* Order Totals */
.order-totals {
  border-top: 2px solid var(--border-color);
  padding-top: 20px;
  margin-bottom: 25px;
}

.subtotal,
.shipping-total,
.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 16px;
}

.subtotal,
.shipping-total {
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
}

.total {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  border-top: 2px solid var(--primary-color);
  padding-top: 15px;
  margin-top: 10px;
}

.total span:last-child {
  color: var(--primary-color);
}

/* Complete Order Button */
.complete-order-btn {
  width: 100% !important;
  padding: 18px 24px !important;
  background: var(--primary-color) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: var(--transition) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  flex-wrap: wrap;
  box-shadow: var(--shadow) !important;
}

.complete-order-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.complete-order-btn:active {
  transform: translateY(0);
}

#button-total {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .custom-checkout-widget {
    padding: 15px;
  }

  /* .checkout-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  } */

  .order-summary {
    position: static;
    order: -1;
  }

  .checkout-title {
    font-size: 24px;
    padding: 15px;
  }

  .billing-section,
  .order-summary {
    padding: 20px;
  }

  .product-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .product-info img {
    width: 50px;
    height: 50px;
  }

  .deselect-controls {
    flex-direction: column;
  }

  .deselect-all-btn,
  .select-all-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .product-option label {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .showcase-product-input {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .shipping-method label,
  .payment-method label {
    gap: 10px;
  }

  .shipping-cost {
    align-self: flex-end;
  }

  .order-item {
    gap: 10px;
  }

  .item-price {
    align-self: flex-end;
  }
}

/* Animation for smooth interactions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-item {
  animation: fadeIn 0.3s ease;
}

/* Focus styles for accessibility */
input:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading state for button */
.complete-order-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.complete-order-btn.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.product-option.selected {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
  background: #fff5f5 !important;
}

.deselect-controls {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

.deselect-all-btn,
.select-all-btn {
  padding: 8px 16px;
  border: 2px solid #e74c3c;
  background: white;
  color: #e74c3c;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.deselect-all-btn:hover,
.select-all-btn:hover {
  background: #e74c3c;
  color: white;
}

.shipping-methods,
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shipping-method,
.payment-method {
  background: #f8f9fa;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.3s ease;
}

.shipping-method:has(input:checked),
.payment-method:has(input:checked) {
  border-color: #e74c3c;
  background: #fff5f5;
}

.shipping-method label,
.payment-method label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.shipping-method input,
.payment-method input {
  margin-right: 10px;
  accent-color: #e74c3c;
}

.shipping-cost {
  font-weight: 700;
  color: #e74c3c;
}

.payment-description {
  background: #fff9c4;
  padding: 8px;
  border-radius: 4px;
  color: #856404;
  margin: 8px 0 0 0;
  font-size: 12px;
  border-left: 3px solid #ffc107;
}

.payment-privacy {
  color: #6c757d;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 15px;
  display: block;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.order-totals.updated {
  animation: pulse 0.3s ease;
}

.product-type-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.default-badge {
  background: #27ae60;
  color: white;
}

.showcase-badge {
  background: #3498db;
  color: white;
}

.complete-order-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Cart Products Styling */
.cart-products-list {
  margin-bottom: 20px;
}

.cart-products-title {
  font-size: 16px;
  color: #2c3e50;
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #c3e6cb;
  font-weight: 600;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.cart-item-quantity {
  width: 60px !important;
  padding: 2px 2px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 12px;
  text-align: center;
}

.remove-cart-item {
  padding: 0 !important;
  background: #e74c3c !important;
  color: white;
  border: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 500px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
}
button.remove-cart-item svg {
  width: 10px;
  height: 10px;
  fill: #fff;
}
.remove-cart-item:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

/* Success Popup Styles */
.checkout-success-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 99999;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.checkout-success-popup {
  background: #ffffff;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popupSlideIn 0.3s ease;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

@keyframes popupSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
    scale: 0.95;
  }
  to {
    transform: translateY(0);
    opacity: 1;
    scale: 1;
  }
}

.popup-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px 25px;
  border-radius: 15px 15px 0 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.popup-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.popup-content {
  padding: 25px;
}

.order-summary-popup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 25px;
}
@media (max-width: 575px) {
  .order-summary-popup {
    grid-template-columns: 1fr;
  }
}
.required-star {
  color: red;
  margin-left: 3px;
}

.order-info,
.customer-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #27ae60;
}

.order-info h3,
.customer-info h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.order-info p,
.customer-info p {
  margin: 8px 0;
  color: #34495e;
  font-size: 14px;
  line-height: 1.5;
}

.order-items-popup {
  margin-bottom: 25px;
}

.order-items-popup h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 10px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.popup-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.item-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 15px;
  flex-shrink: 0;
  border: 2px solid #ffffff;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
  font-size: 15px;
}

.item-quantity {
  color: #6c757d;
  font-size: 13px;
}

.item-price {
  font-weight: 700;
  color: #e74c3c;
  font-size: 16px;
  flex-shrink: 0;
}

.order-totals-popup {
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 15px;
  color: #2c3e50;
}

.total-line.total {
  border-top: 2px solid #27ae60;
  padding-top: 15px;
  margin-top: 15px;
  font-weight: 700;
  font-size: 18px;
  color: #27ae60;
}

.popup-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.popup-btn {
  flex: 1;
  padding: 15px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-btn.primary {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.popup-btn.primary:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.popup-btn.secondary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.popup-btn.secondary:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.popup-message {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #28a745;
  text-align: center;
}

.popup-message p {
  margin: 0;
  color: #155724;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

/* Prevent body scroll when popup is open */
body.popup-open {
  overflow: hidden;
}
