/*--------------------------------------------------------------
# Checkout Page Styles
--------------------------------------------------------------*/
.checkout-cart {
  background: var(--surface-color);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid
    color-mix(in srgb, var(--default-color), transparent 90%);
}

.cart-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--heading-color);
}

.btn-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-link:hover {
  color: color-mix(in srgb, var(--accent-color), black 20%);
}

.cart-item {
  display: flex;
  gap: 20px;
  padding: 25px 0;
  border-bottom: 1px solid
    color-mix(in srgb, var(--default-color), transparent 90%);
  transition: all 0.3s ease;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item:hover {
  background: color-mix(in srgb, var(--accent-color), transparent 95%);
  padding-left: 15px;
  padding-right: 15px;
  border-radius: 10px;
}

.cart-item-image {
  flex: 0 0 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.cart-item-info {
  flex: 1;
  min-width: 200px;
}

.cart-item-category {
  display: inline-block;
  background: color-mix(in srgb, var(--accent-color), transparent 85%);
  color: var(--accent-color);
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.cart-item-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 8px 0;
  color: var(--heading-color);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Imagen vacía: ocupa todo el contenedor del thumb */
.cart-item-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 55%, #cbd5e1 100%);
  border-radius: 10px;
  color: #94a3b8;
  border: 1px dashed color-mix(in srgb, var(--default-color), transparent 82%);
}

.cart-item-placeholder i {
  font-size: 2.35rem;
  opacity: 0.75;
}

.cart-item-placeholder__text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Cupón: escritorio (input + botón unidos) */
.coupon-code-input {
  min-height: 48px;
  font-size: 1rem;
}

.coupon-apply-btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
}

@media (min-width: 769px) {
  .checkout-coupon-input-group .coupon-code-input {
    border-right: none !important;
    border-radius: 10px 0 0 10px !important;
  }

  .checkout-coupon-input-group .coupon-apply-btn {
    border-radius: 0 10px 10px 0 !important;
  }
}

/* Cupón debajo del total (referencia: caja con borde + campo + botón redondo) */
.summary-coupon-below-total {
  margin-top: 1.15rem;
  padding: 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 78%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-color), #f8fafc 40%);
}

.summary-coupon-below-total__question {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.summary-coupon-below-total__hint {
  font-size: 0.75rem;
  line-height: 1.35;
}

.summary-coupon-inline {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 75%);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-coupon-inline:focus-within {
  border-color: color-mix(in srgb, var(--accent-color), transparent 35%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 88%);
}

.summary-coupon-inline__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  box-shadow: none !important;
}

.summary-coupon-inline__input:focus {
  outline: none;
  box-shadow: none !important;
}

.summary-coupon-inline__btn {
  flex: 0 0 auto;
  width: 48px;
  min-width: 48px;
  border: none;
  background: linear-gradient(145deg, #4f46e5, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.summary-coupon-inline__btn:hover {
  filter: brightness(1.08);
}

.summary-coupon-inline__btn:active {
  transform: scale(0.96);
}

.cart-item-seller {
  font-size: 0.9rem;
  color: var(--default-color);
  opacity: 0.8;
  margin: 5px 0;
}

.cart-item-discount {
  display: inline-block;
  background: #28a745;
  color: white;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 5px;
}

.cart-item-quantity {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cart-item-quantity label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--heading-color);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 2px solid color-mix(in srgb, var(--default-color), transparent 85%);
  border-radius: 8px;
  padding: 3px;
  background: white;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--surface-color);
  color: var(--accent-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: var(--accent-color);
  color: white;
}

.qty-input {
  width: 50px;
  height: 30px;
  border: none;
  text-align: center;
  font-weight: 600;
  color: var(--heading-color);
  background: transparent;
}

.qty-input:focus {
  outline: none;
}

.cart-item-price {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  min-width: 100px;
}

.price-label {
  font-size: 0.8rem;
  color: var(--default-color);
  opacity: 0.7;
  margin-bottom: 5px;
}

.price-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--heading-color);
}

.price-old {
  font-size: 1rem;
  color: var(--default-color);
  opacity: 0.6;
  text-decoration: line-through;
  margin-right: 8px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
}

.btn-remove {
  width: 40px;
  height: 40px;
  border: none;
  background: color-mix(in srgb, #dc3545, transparent 90%);
  color: #dc3545;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: #dc3545;
  color: white;
}

.checkout-form,
.checkout-payment {
  background: var(--surface-color);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--heading-color);
  display: flex;
  align-items: center;
}

.form-section-title i {
  color: var(--accent-color);
  font-size: 1.25rem;
}

/* — Bloque Información de Contacto y Envío — */
.checkout-form {
  background: var(--surface-color);
  padding: 28px 32px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 92%);
}

.checkout-form .form-section-title {
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 88%);
}

.checkout-form .modern-form .form-label {
  font-weight: 600;
  color: var(--heading-color);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.checkout-form .modern-form .form-label span[style*="color: #ef4444"] {
  color: #ef4444 !important;
}

.checkout-form .modern-form .form-control,
.checkout-form .modern-form .form-select {
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 80%);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checkout-form .modern-form .form-control:focus,
.checkout-form .modern-form .form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 85%);
  outline: none;
}

.checkout-form .modern-form .form-control::placeholder {
  color: color-mix(in srgb, var(--default-color), transparent 50%);
}

.checkout-form .modern-form textarea.form-control {
  min-height: 90px;
  resize: vertical;
  border-radius: 10px;
}

.checkout-form .modern-form .text-danger.small {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.payment-option {
  position: relative;
}

.payment-radio {
  position: absolute;
  opacity: 0;
}

.payment-label {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 2px solid color-mix(in srgb, var(--default-color), transparent 85%);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-radio:checked + .payment-label {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color), transparent 95%);
}

.payment-icon {
  flex: 0 0 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-color);
}

.payment-info {
  flex: 1;
}

.payment-info h5 {
  margin: 0 0 5px;
  font-size: 1.1rem;
  font-weight: 600;
}

.payment-info p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.payment-badges {
  display: flex;
  gap: 8px;
}

.payment-badges span {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-visa {
  background: #1a1f71;
  color: white;
}

.badge-mastercard {
  background: #eb001b;
  color: white;
}

.order-summary {
  background: var(--surface-color);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.sticky-summary {
  position: sticky;
  top: 100px;
}

.summary-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--heading-color);
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  color: var(--default-color);
}

.summary-value {
  font-weight: 600;
  color: var(--heading-color);
}

.summary-value.discount {
  color: #28a745;
}

.summary-divider {
  height: 2px;
  background: color-mix(in srgb, var(--default-color), transparent 90%);
  margin: 20px 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--accent-color), transparent 95%);
  border-radius: 10px;
  margin-bottom: 15px;
}

.summary-total span:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading-color);
}

.total-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-color);
}

.promo-input-group {
  display: flex;
  gap: 10px;
}

.promo-input-group .form-control {
  flex: 1;
}

.btn-apply {
  padding: 0 20px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-apply:hover {
  background: color-mix(in srgb, var(--accent-color), black 15%);
}

.btn-checkout-primary {
  padding: 15px 30px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-checkout-primary:hover {
  background: color-mix(in srgb, var(--accent-color), black 15%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px
    color-mix(in srgb, var(--accent-color), transparent 60%);
}

.btn-checkout-webpay {
  padding: 16px 28px;
  background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 100%);
  color: #78350f;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  letter-spacing: 0.02em;
}

.btn-checkout-webpay:hover {
  background: linear-gradient(180deg, #FDE68A 0%, #D97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
  color: #451a03;
}

.btn-checkout-webpay:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3) inset;
}

.btn-checkout-webpay__text {
  white-space: nowrap;
}

.btn-checkout-webpay__img {
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.security-badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: white;
  border-radius: 10px;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--default-color);
}

.security-item i {
  color: var(--accent-color);
  font-size: 1.2rem;
}

.delivery-info {
  padding: 20px;
  background: white;
  border-radius: 10px;
}

.delivery-info h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--heading-color);
}

.delivery-date {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.delivery-note {
  font-size: 0.85rem;
  color: var(--default-color);
  opacity: 0.8;
  margin: 0;
}

.contact-support {
  padding: 20px;
  background: white;
  border-radius: 10px;
}

.contact-support h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--heading-color);
}

.support-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.support-link:hover {
  color: color-mix(in srgb, var(--accent-color), black 20%);
  padding-left: 5px;
}

.trust-section {
  padding: 60px 0;
}

.trust-badge {
  padding: 30px 20px;
  transition: all 0.3s ease;
}

.trust-badge:hover {
  transform: translateY(-5px);
}

.trust-badge i {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.trust-badge h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--heading-color);
}

.trust-badge p {
  font-size: 0.9rem;
  color: var(--default-color);
  opacity: 0.8;
  margin: 0;
}

@media (max-width: 992px) {
  .sticky-summary {
    position: static;
  }

  .cart-item {
    flex-direction: column;
    position: relative;
  }

  .cart-item-image {
    flex: none;
    width: 100%;
    max-width: 100%;
    height: 200px;
  }

  .cart-item-details {
    flex-direction: column;
  }

  .cart-item-price,
  .cart-item-quantity {
    align-items: flex-start;
  }

  .cart-item-title {
    padding-right: 3rem;
  }

  .cart-item-actions {
    position: absolute;
    top: 0.6rem;
    right: 0.65rem;
    z-index: 2;
  }

  .btn-remove {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #fff;
    border: 1px solid color-mix(in srgb, #dc3545, transparent 75%);
  }
}

@media (max-width: 768px) {
  #checkout.section {
    scroll-margin-top: 5.5rem;
  }

  #checkout .container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
  }

  #checkout .section-title {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  #checkout .section-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
    line-height: 1.25;
  }

  #checkout .section-title p {
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .cart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cart-header h3 {
    font-size: 1.25rem;
  }

  .checkout-cart,
  .checkout-form,
  .order-summary {
    padding: 1.25rem 1rem;
    border-radius: 12px;
  }

  .store-card .store-header {
    height: 40px !important;
    padding: 0 1rem !important;
  }

  .store-card .store-header h5 {
    font-size: 0.8rem !important;
  }

  .store-items {
    padding: 1rem !important;
  }

  .cart-item {
    flex-direction: column;
    padding: 1rem 0;
    gap: 1rem;
  }

  .cart-item-image {
    flex: none;
    width: 100%;
    max-width: 100%;
    height: 200px;
    border-radius: 12px;
  }

  .cart-item-details {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .cart-item-info {
    min-width: 0;
  }

  .cart-item-title {
    font-size: 0.95rem;
    margin: 6px 0;
  }

  .cart-item-quantity,
  .cart-item-price,
  .cart-item-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .cart-item-quantity label {
    margin-bottom: 0;
    margin-right: 0.5rem;
  }

  .quantity-selector {
    padding: 4px;
  }

  .qty-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .qty-input {
    width: 44px;
    height: 40px;
    font-size: 1rem;
  }

  .cart-item-price {
    align-items: flex-end;
    min-width: 0;
    margin-left: auto;
  }

  .price-value {
    font-size: 1.15rem;
  }

  .btn-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .coupon-section {
    padding: 1rem 1.1rem;
    border-radius: 14px;
  }

  .coupon-section .form-label {
    font-size: 0.9rem;
    line-height: 1.35;
    margin-bottom: 0.65rem;
  }

  /* Evita el input “en columna de 1px” del input-group en móvil */
  .checkout-coupon-input-group {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 0.75rem;
  }

  .checkout-coupon-input-group .coupon-code-input {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
  }

  .checkout-coupon-input-group .coupon-apply-btn {
    width: 100% !important;
    flex: none !important;
    border-radius: 12px !important;
    min-height: 48px;
    font-size: 1rem;
  }

  .checkout-form .form-section-title {
    font-size: 1.1rem;
  }

  .checkout-form .modern-form .form-control,
  .checkout-form .modern-form .form-select {
    padding: 0.75rem 1rem;
    font-size: 16px; /* evita zoom en iOS */
  }

  .order-summary .summary-title {
    font-size: 1.2rem;
  }

  .summary-total {
    padding: 1rem 0;
  }

  .total-value {
    font-size: 1.4rem;
  }

  .btn-checkout-webpay {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .btn-checkout-webpay__img {
    height: 32px;
    max-width: 160px;
  }

  .security-badges {
    padding: 1rem;
    gap: 8px;
  }

  .security-item {
    font-size: 0.85rem;
  }

  .delivery-info,
  .contact-support {
    padding: 0;
  }

  .delivery-info h5,
  .contact-support h5 {
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  #checkout .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #checkout .section-title h2 {
    font-size: 1.35rem;
  }

  .checkout-cart,
  .checkout-form,
  .order-summary {
    padding: 1rem 0.75rem;
  }

  .cart-item-image {
    height: 160px;
  }

  .cart-item-details {
    flex-wrap: wrap;
  }

  .cart-item-quantity,
  .cart-item-price {
    flex: 1 1 auto;
  }

  .cart-item-actions {
    flex: 0 0 auto;
  }

  .total-value {
    font-size: 1.3rem;
  }

  .btn-checkout-webpay__text {
    font-size: 0.95rem;
  }

  .btn-checkout-webpay__img {
    height: 28px;
    max-width: 140px;
  }
}
