
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Theme color palette - Clean Retail White with Navy #053A6B Accents */
  --bg-primary: #ffffff;
  --bg-secondary: #fbfcff;
  --bg-tertiary: #eceef2;

  --text-primary: #03325e;
  --text-tittle: #03325e;
  --text-secondary: #5b6675;
  --text-muted: #828d9c;

  --color-primary: #0a2540;       /* Navy oscuro: bot�n buscar, CTAs s�lidos */
  --color-primary-hover: #123a63;
  --color-primary-glow: rgba(5, 58, 107, 0.12);

  --color-accent: #053A6B;        /* Navy: links, precios destacados, foco */
  --color-accent-hover: #073f73;
  --color-accent-glow: rgba(5, 58, 107, 0.12);

  --color-success: #1a8754;       /* Verde apagado, no fosforescente */
  --color-success-glow: rgba(26, 135, 84, 0.12);
  --color-warning: #c47f0a;
  --color-danger: #d32f2f;
  --color-danger-glow: rgba(211, 47, 47, 0.1);

  --border-color: #dfe3ea;
  --border-focus: rgba(5, 58, 107, 0.4);

  --shadow-sm: 0 1px 3px rgba(8, 28, 51, 0.07);
  --shadow-md: 0 6px 18px rgba(8, 28, 51, 0.09);
  --shadow-lg: 0 16px 40px rgba(8, 28, 51, 0.14);

  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;

  --max-width: 1400px;  /* era 1200px */
  --header-height: 70px;
}

.pdp-breadcrumbs {
  font-size: 14px;
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.pdp-breadcrumbs__current {
  color: var(--text-primary);
}

.pdp-gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  min-height: 500px;
}

.pdp-gallery-empty--hidden {
  display: none;
}

.product-info__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--color-warning);
}

.product-info__rating-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.product-info__stock-row {
  margin-bottom: 30px;
  font-size: 14px;
  color: var(--text-secondary);
}

.product-info__stock-line {
  margin-bottom: 8px;
}

.product-info__stock-badge {
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.product-info__stock-badge--in-stock {
  color: var(--color-success);
  background-color: var(--color-success-glow);
}

.product-info__stock-badge--out-of-stock {
  color: var(--color-danger);
  background-color: var(--color-danger-glow);
}

.product-info__sku-value {
  color: var(--text-primary);
}

.add-to-cart__row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  height: 48px;
  background-color: var(--bg-secondary);
}

.qty-selector__btn {
  width: 40px;
  height: 100%;
  font-size: 16px;
  font-weight: bold;
}

.qty-selector__input {
  width: 40px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.add-to-cart__submit {
  flex-grow: 1;
  height: 48px;
  padding: 0 24px;
}

.pdp-section {
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
}

.pdp-section__title {
  font-size: 24px;
  margin-bottom: 20px;
}

.pdp-section__body {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
}

.pdp-related-section {
  margin-top: 80px;
  border-top: 1px solid var(--border-color);
  padding-top: 60px;
}

.pdp-related-section__title {
  font-size: 26px;
  margin-bottom: 40px;
}

.product-info__brand {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.product-info__name {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.product-info__price-box {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 18px 24px;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-accent);
}

.product-info__price {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-accent);
}

.product-info__price--sale {
  color: var(--color-danger);
}

.product-info__price-old {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-info__discount-badge {
  background-color: var(--color-danger);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.product-info__discount-badge--hidden {
  display: none;
}

.variant-picker {
  margin-bottom: 30px;
}

.variant-picker__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.variant-option {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.variant-option:hover {
  border-color: var(--text-secondary);
}

.variant-option--active {
  border-color: var(--color-accent);
  background-color: var(--color-accent-glow);
  color: var(--color-accent);
  font-weight: 600;
}

.variant-option--out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Cart & Checkout Views */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
}

.cart-table th {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 500;
}

.cart-table td {
  padding: 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-item__img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary);
}

.cart-summary {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 30px;
}

/* Separator used between cart and featured products */
.section-separator{
  border:0;
  height:1px;
  background:var(--divider, #e6e6e6);
  margin:32px 0;
  width:100%;
}
@media (max-width:768px){
  .section-separator{ margin:20px 0; }
}

/* Mobile behavior for cart footer (was inline in template) */
@media (max-width:768px){
  .CART_footer{
    will-change:bottom;
  }
}

.checkout-page {
  padding-top: 0;
  padding-bottom: 60px;
}

.checkout-head {
  max-width: 1000px;
  margin: 0 auto 24px;
}

.checkout-head .hero__title {
  font-size: 28px;
  margin-bottom: 6px;
}

.checkout-head p {
  color: var(--text-secondary);
}

.checkout-head__toggle {
  display: none; /* solo aparece en mobile, ver media query más abajo */
}

/* Mobile: título y descripción más chicos, descripción colapsada por defecto */
@media (max-width: 768px) {
  .checkout-head .hero__title {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .checkout-head__desc {
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    cursor: pointer;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .checkout-head__desc.is-expanded {
    -webkit-line-clamp: unset;
    display: block;
  }

  .checkout-head__toggle {
    display: block;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 12px;
    text-decoration: underline;
    margin-top: 2px;
  }
}



.checkout-summary-col {
  position: relative;
}

.checkout-summary-sticky {
  position: sticky;
  top: 10px;
  padding: 24px;
}

.checkout-sections {
  display: grid;
  gap: 10px;
}

.checkout-summary-sticky__title {
  font-size: 16px;
  margin-bottom: 18px;
}

 

.comuna-field .form-control {
  font-size: 17px;
  font-weight: 500;
  padding: 13px 16px;
  border-width: 2px;
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
}

.comuna-field .form-control::placeholder {
  font-weight: 400;
  opacity: 0.65;
}

.comuna-field .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-glow);
  background: var(--bg-primary);
}

.comuna-field .form-control.is-valid {
  background: var(--bg-primary);
  border-color: var(--color-success);
}

.comuna-field .form-control.is-invalid {
  background: var(--bg-primary);
}

.comuna-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.comuna-suggestions[hidden] {
  display: none;
}

.comuna-suggestions li {
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.comuna-suggestions li span.comuna-suggestion__region {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.comuna-suggestions li:hover,
.comuna-suggestions li[aria-selected="true"] {
  background: var(--color-accent-glow);
}

.comuna-suggestions li.comuna-suggestion__empty {
  color: var(--text-secondary);
  cursor: default;
}

.comuna-suggestions li.comuna-suggestion__empty:hover {
  background: transparent;
}

.field-error {
  color: var(--color-danger);
  font-size: 12.5px;
  margin-top: 6px;
  min-height: 0;
  display: none;
}

.field-error.visible {
  display: block;
}

.form-control.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-control.is-valid {
  border-color: var(--color-success);
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-option {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.payment-option:hover {
  border-color: var(--text-secondary);
}

.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.payment-option__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 16px;
  flex-shrink: 0;
}

.payment-option__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.payment-option__desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.payment-option__radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.payment-option:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
}

.payment-option:has(input:checked) .payment-option__radio-indicator {
  border-color: var(--color-accent);
  border-width: 6px;
}

.payment-option:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.checkout-secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-line span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 18px;
}

#display-shipping {
  color: var(--text-secondary);
  font-weight: 600;
}

#display-discount {
  color: var(--color-success);
}

#discount-line {
  display: none;
}

.btn-spinner {
  display: none;
  margin-left: 6px;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 768px) {
  .checkout-grid--custom,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-summary-sticky {
    position: static;
  }

  .form-row--2 {
    grid-template-columns: 1fr;
  }

  .checkout-stepper__label {
    display: none;
  }
}

/* ==========================================================================
   PDP Gallery Carousel � clases nuevas con prefijo "pdp-" para no chocar
   con las reglas .gallery__* existentes (que sigue usando otras vistas).
   ========================================================================== */

.pdp-gallery-wrapper {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

/* Thumbnails al costado (desktop) */
.pdp-gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 80px;
  flex-shrink: 0;
  max-height: 600px;
  overflow-y: auto;
}

.pdp-gallery-thumb-btn {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  width: 80px;
  height: 80px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pdp-gallery-thumb-btn--active,
.pdp-gallery-thumb-btn:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.pdp-gallery-thumb-btn img {
  max-height: 100%;
  object-fit: contain;
}

/* Carrusel principal */
.pdp-gallery-main {
  position: relative;
  flex: 1;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
  min-height: 480px;
}

.pdp-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pdp-gallery-track::-webkit-scrollbar {
  display: none;
}

.pdp-gallery-slide {
  position: relative;
  min-width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.pdp-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Flechas prev/next */
.pdp-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.pdp-gallery-arrow:hover {
  background: rgba(255, 255, 255, 1);
}

.pdp-gallery-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.pdp-gallery-arrow--prev {
  left: 16px;
}

.pdp-gallery-arrow--next {
  right: 16px;
}

/* Contador "1 / N" */
.pdp-gallery-counter {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.pdp-gallery-counter::before {
  content: attr(data-text);
  background: #fff;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Dots indicadores (desktop + mobile) */
.pdp-gallery-dots {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
}

.pdp-gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  background-color: #fff;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.pdp-gallery-dot--active {
  background-color: var(--color-accent);
}

/* Responsive adjust */
@media (max-width: 992px) {
  .hero__container, .product-detail__grid, .checkout-grid, .catalog-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .header__nav {
    display: none;
  }
}

.media-card-img-wrap {
  background-color: #ffffff;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Responsive adjust */
@media (max-width: 992px) {
  .hero__container, .product-detail__grid, .checkout-grid, .catalog-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .header__nav {
    display: none;
  }
}

@media (max-width:768px){
    .nav-brand{
        position: relative;
        top: 0px;
        left: 0px;
        z-index: 20; /* por encima del contenido del header, no del documento entero */
        display: flex;
        align-items: left;
        flex-direction: column-reverse;
    }
    .pdp-gallery-wrapper{
        display:block;
    }

    /* ocultar miniaturas */
    .pdp-gallery-thumbs{
        display:none;
    }

    .pdp-gallery-main{
        width:100%;
        min-height:unset;
        height:340px;
        aspect-ratio:auto;
        border-radius:12px;
    }

    .pdp-gallery-track{
        height:100%;
    }

    .pdp-gallery-slide{
        padding:10px;
        align-items:center;
        justify-content:center;
    }

    .pdp-gallery-slide img{
        max-width:100%;
        max-height:320px;
        width:auto;
        height:auto;
        object-fit:contain;
    }

    .pdp-gallery-arrow{
        display:none;
    }

    .pdp-gallery-counter{
        display:none;
    }

}


.pdp-attributes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.pdp-attribute-group__label {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.pdp-attribute-group__selected {
  color: var(--text-secondary);
  font-weight: 400;
}

.pdp-attribute-group__values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pdp-attr-value {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pdp-attr-value:hover {
  border-color: var(--text-secondary);
}

.pdp-attr-value--active {
  border-color: var(--color-accent);
  background-color: var(--color-accent-glow);
  color: var(--color-accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--color-accent);
}

.pdp-attr-value__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary);
}

.pdp-attr-value__swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid var(--border-color);
}

/* Variant picker: transporta data-attrs (precio, stock, sku) para el JS.
   No tiene representación visual — la selección de compra ocurre solo
   a través de .pdp-attr-value de arriba. */
.variant-picker--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Aviso de combinación de atributos sin variante/stock asociado */
.pdp-unavailable-notice {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-danger-glow);
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 500;
}

.pdp-unavailable-notice--hidden {
  display: none;
}

#add-to-cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ==========================================================================
   CART_ � Layout responsivo de la vista de carrito (view.html)
   Prefijo CART_ para no chocar con .cart-table / .cart-summary existentes.
   ========================================================================== */

.CART_layout{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);
  gap:50px;
  align-items:start;
}

.CART_table-scroll{
  width:100%;
}

.CART_summaryDesktop{
  display:block;
}

.CART_footer{
  display:none;
}

@media (max-width:768px){

  .CART_layout{
    grid-template-columns:1fr;
    gap:24px;
  }

  .CART_summaryDesktop{
    display:none;
  }

  .CART_footer{
    display:block;
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    border-top:1px solid var(--border-color);
    padding:12px 16px;
    box-shadow:0 -6px 20px rgba(0,0,0,.08);
    z-index:1000;
    /* Evita que en mobile (Chrome/Safari) el footer quede "escondido" tras
       la barra de direcciones hasta el primer scroll: fuerza su propia
       capa de composición desde el primer paint. */
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden;
    background-color: var(--bg-gray);
  }

  .CART_footerInner{
    justify-content: center;
    margin:auto;
    display:flex;
    align-items:center;
    gap:50px;
    background-color: var(--bg-gray);
  }

  .CART_footerTotal{
    flex:0;
    display:flex;
    flex-direction:column;
  }

  .CART_footerTotal span{
    font-size:13px;
    color:var(--text-secondary);
  }

  .CART_footerTotal strong{
    font-size:22px;
    color:var(--text-primary);
  }

  .CART_buyButton{
    background: var( --color-danger);
    min-width:40px;
  }

  .CART_footerToggle{
    position:absolute;
    top:-18px;
    left:50%;
    transform:translateX(-50%);
    width:40px;
    height:22px;
    border:1px solid var(--border-color);
    border-bottom:none;
    border-radius:999px 999px 0 0;
    background:#fff;
    box-shadow:0 -2px 6px rgba(0,0,0,.06);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
  }

  .CART_footerToggle__icon{
    width:16px;
    height:9px;
    display:block;
  }

  .CART_footerExpanded{
    max-width:var(--max-width);
    margin:0 auto;
    display:flex;
    flex-direction:column;
  }

  .CART_footerCollapsed[hidden],
  .CART_footerExpanded[hidden]{
    display:none;
  }

  .CART_footerExpanded .cart-summary__buy-btn{
    background: var( --color-danger);
    margin-top:12px;
  }

  .CART_container{
    padding-bottom:110px;
  }


  .CART_table-scroll{
    overflow-x:visible;
  }

  .cart-table{
    display:block;
    width:100%;
    min-width:0;
  }

  .cart-table thead{
    display:none;
  }

  .cart-table tbody{
    display:block;
    width:100%;
  }

  .cart-table tr{
    position:relative;
    display:flex;
    flex-wrap:wrap;
    background:#fff;
    border:1px solid var(--border-color);
    border-radius:var(--border-radius-md);
    padding:14px;
    margin-bottom:14px;
    box-shadow:var(--shadow-sm);
  }

  .cart-table td{
    border-bottom:none;
    padding:0;
  }

  /* Producto: fila completa arriba, con una línea divisoria */
  .cart-table td:nth-child(1){
    order:1;
    width:100%;
    padding-bottom:12px;
    margin-bottom:12px;
    border-bottom:1px solid var(--border-color);
  }

  .cart-table td:nth-child(1) .cart-item{
    padding-right:36px; /* deja espacio al botón eliminar */
  }

  /* Botón Eliminar → ícono redondo arriba a la derecha de la tarjeta */
  .cart-table td:nth-child(1) .cart-item > div > a{
    position:absolute;
    top:12px;
    right:12px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    background:transparent;
    border-radius:6px;
    padding:4px 6px;
    font-size:12px;
    color:var(--color-danger);
    text-decoration:none;
  }

  .cart-table td:nth-child(1) .cart-item > div > a i{
    font-size:16px;
    line-height:1;
    display:block;
  }

  .cart-table td:nth-child(1) .cart-item > div > a .cart-remove__text{
    display:block;
    font-size:12px;
    line-height:1;
  }

/* default: hide mobile duplicate */
.cart-remove--mobile{display:none}

  /* Cantidad: fila completa, debajo del producto */
  .cart-table td:nth-child(3){
    order:2;
    width:100%;
    text-align:left !important;
    margin-bottom:14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
  }

  /* Precio y Total: lado a lado, abajo de la tarjeta, con etiqueta */
  .cart-table td:nth-child(2),
  .cart-table td:nth-child(4){
    order:3;
    width:50%;
  }

  .cart-table td:nth-child(4){
    order:4;
    text-align:right !important;
  }

  .cart-table td:nth-child(2)::before,
  .cart-table td:nth-child(3)::before,
  .cart-table td:nth-child(4)::before{
    content:"Precio";
    display:block;
    font-size:11px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.03em;
    color:var(--text-muted);
    margin-bottom:6px;
  }

  .cart-table td:nth-child(3)::before{
    content:"Cantidad";
  }

  .cart-table td:nth-child(4)::before{
    content:"Total";
    text-align:right;
  }
}

@media (max-width:480px){

  .CART_footer{
    padding:10px 12px;
  }

  .CART_footerInner{
    gap:20px;
  }

  .CART_footerTotal strong{
    font-size:20px;
  }

  .CART_buyButton{
    min-width:40;
    padding:12px 18px;
  }

  .cart-item{
    gap:12px;
  }

  .cart-item__img{
    width:60px;
    height:60px;
  }
}

/* Footer móvil específico para la página de detalle (Agregar al carrito) */
.pdp-mobile-footer {
  display: none;
}

@media (max-width: 992px) {
  .pdp-mobile-footer {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -6px 12px rgba(0,0,0,0.06);
    z-index: 1200;
    padding: 8px 12px;
  }

  .pdp-mobile-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
  }

  .pdp-mobile-price {
    font-weight: 700;
    color: var(--color-accent);
  }

  .pdp-mobile-add-btn {
    padding: 10px 14px;
    font-size: 15px;
  }

  /* Asegurar espacio inferior en detalle para que no tape contenido */
  .product-detail {
    padding-bottom: 120px;
  }
}

/* Ensure original delete link is hidden and mobile duplicate shown up to 992px */
@media (max-width: 992px) {
  .cart-table td:nth-child(1) .cart-item > div > a { display: none !important; }
  .cart-remove--mobile { display: inline-flex !important; flex-direction: column; align-items: center; gap: 4px; color: var(--color-danger); text-decoration: none; padding: 4px 6px; }
}


.CART_container {
  padding-top: 10px;
  padding-bottom: 0;
}

.checkout-alert--error {
  margin-top: 12px;
  margin-bottom: 12px;
  color: #b91c1c;
  background: #fff0f0;
  border-color: #f5c2c7;
}

.checkout-alert__body {
  margin-left: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.cart-item__placeholder {
  width: 80px;
  height: 80px;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item__price-warning {
  font-size: 13px;
  color: var(--color-warning);
}

.cart-remove-form {
  display: inline;
  margin-top: 8px;
}

.cart-qty__form {
  display: inline;
}

.cart-remove-form--mobile {
  display: none;
  margin-left: 12px;
  margin-top: 0;
}

.cart-remove {
  font-size: 12px;
  color: var(--color-danger);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.cart-price__current {
  font-weight: 600;
}

.cart-price__old {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.cart-qty__btn {
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: inherit;
}

.cart-qty__btn--minus {
  border-right: 1px solid var(--border-color);
}

.cart-qty__btn--plus {
  border-left: 1px solid var(--border-color);
}

.cart-qty__value {
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
}

.cart-item-total {
  text-align: right;
  font-weight: 700;
  color: var(--color-accent);
}

.cart-table--center {
  text-align: center;
}

.cart-table--right {
  text-align: right;
}

.cart-summary__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.cart-summary__title {
  font-size: 18px;
  margin-bottom: 0;
}

.cart-summary__subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.cart-summary__label {
  color: var(--text-secondary);
  font-weight: 500;
}

.cart-summary__label--strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
}

.cart-summary__divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.cart-summary__row--total {
  margin-top: 4px;
  margin-bottom: 24px;
}

.cart-summary__row-value {
  color: var(--text-primary);
  font-weight: 600;
}

.cart-summary__row-value--strong {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 18px;
}

.cart-summary__buy-btn {
  width: 100%;
  margin-top: 4px;
}

.cart-empty {
  text-align: center;
  padding: 80px 40px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  max-width: 600px;
  margin: 40px auto;
}

.cart-empty__icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.cart-empty__title {
  font-size: 20px;
  margin-bottom: 8px;
}

/* Mantener el botón "Eliminar" visible en mobile igual que antes (al lado de qty) */
@media (max-width: 640px) {
  .cart-remove-form--mobile {
    display: inline-flex !important;
  }
}

/* ==========================================================================
   PDP_MOBILE
   Todas las reglas quedan encapsuladas bajo .PDP_container
   ========================================================================== */

@media (max-width:768px){

  /* espacio para el footer fijo */
  .PDP_container{
    padding-bottom:110px;
  }

  /* ocultar botón original */
  .PDP_container .add-to-cart__row{
    display:none;
  }

  /* galería */

  .PDP_container .pdp-gallery-wrapper{
    display:block;
  }

  .PDP_container .pdp-gallery-thumbs{
    display:none;
  }

  .PDP_container .pdp-gallery-main{
    width:100%;
    height:340px;
    min-height:unset;
    aspect-ratio:auto;
    border-radius:var(--border-radius-md);
  }

  .PDP_container .pdp-gallery-track{
    height:100%;
    scroll-behavior:smooth;
    touch-action:pan-x;
  }

  .PDP_container .pdp-gallery-slide{
    padding:10px;
  }

  .PDP_container .pdp-gallery-slide img{
    width:auto;
    height:auto;
    max-width:100%;
    max-height:320px;
    object-fit:contain;
  }

  .PDP_container .pdp-gallery-arrow,
  .PDP_container .pdp-gallery-counter{
    display:none;
  }

  /* título */

  .PDP_container .product-info__name{
    font-size:28px;
    line-height:1.25;
  }

  /* caja precio */

  .PDP_container .product-info__price-box{
    margin-bottom:20px;
    padding:14px;
  }

  .PDP_container .product-info__price{
    font-size:30px;
  }

  /* atributos */

  .PDP_container .pdp-attr-value{
    width:calc(50% - 6px);
  }

  .PDP_container .pdp-attr-value__thumb{
    width:42px;
    height:42px;
  }

  /* footer móvil */

  .PDP_footer{
         display: flex;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--bg-gray);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
        margin: 0;
        list-style: none;  

  }



  .PDP_footerInner{

    max-width:var(--max-width);

    margin:auto;

    display:flex;

    align-items:center;

    gap:14px;

  }

  .PDP_footerPrice{

    flex:1;

    font-size:22px;

    font-weight:700;

    color:var(--color-accent);

  }

  .PDP_buyButton{

    min-width:170px;

    height:52px;

    font-size:16px;

  }

}

@media (min-width:769px){
  /* en desktop el carrito ya está visible en la columna de info, ocultamos el footer fijo */
  .PDP_footer{
    display:none;
  }
}

@media (max-width:768px){
  /* hide original delete inside product area on mobile, show duplicate next to qty */
  .cart-table td:nth-child(1) .cart-item > div > a{ display:none; }
  .cart-remove--mobile{ display:inline-flex !important; flex-direction:column; align-items:center; gap:4px; color:var(--color-danger); text-decoration:none; padding:4px 6px; }
  .cart-remove--mobile i{ font-size:16px; display:block; }
  .cart-remove--mobile .cart-remove__text{ font-size:12px; display:block; }
}
/* Espaciado entre las secciones de recomendados del carrito (view.html),
   reemplaza los <br><br><br> que había antes entre "Productos destacados"
   y "Categorías destacadas". */
.section--categories {
  margin-top: 48px;
}
