/* Componentes de la tienda (F1): portada, catálogo, ficha. Migrados del diseño V2.2 del mockup (prototipo/css/v22.css). */

.icono { width: 24px; height: 24px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.small { padding: 8px 14px; font-size: var(--fs-sm); }
del { color: var(--muted); }

/* Cabecera: buscador y navegación */
.search { display: flex; flex: 1; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--white); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { border: 0; background: transparent; }
.search input:focus-visible { outline: none; }
.search button { border: 0; background: var(--brand); color: #fff; width: 54px; display: grid; place-items: center; cursor: pointer; }
.header-link { gap: 8px; }
.shop-nav { border-bottom: 1px solid var(--line); }
.shop-nav > div { max-width: 1280px; margin: auto; display: flex; gap: 28px; padding: 4px 24px; font-weight: 600; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.shop-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.shop-nav a:first-child { color: var(--brand); }
.shop-nav .icono { width: 18px; height: 18px; }

/* Encabezados de sección */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 12px 0 24px; }
.section-title h2 { margin-bottom: 4px; }
.section-title > a { color: var(--brand); font-weight: 700; font-size: var(--fs-sm); }
.container > section { margin-bottom: 48px; }

/* Carrusel */
.carousel { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-md); margin-bottom: 20px; }
.slide[hidden] { display: none; }
.slide img { width: 100%; aspect-ratio: 2.6; object-fit: cover; background: var(--surface); }
.carousel-caption { position: absolute; left: 0; bottom: 0; width: 58%; padding: 35px 40px; color: #fff; background: linear-gradient(90deg, rgba(0, 0, 0, .78), transparent); }
.carousel-caption h2 { font-size: clamp(26px, 3vw, 36px); max-width: 360px; margin: 0 0 16px; }
.carousel-caption .btn { background: var(--accent); border-color: var(--accent); color: #282323; }
.carousel-controls { position: absolute; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.carousel-controls[hidden] { display: none; }
.round, .dot { border: 0; background: transparent; color: var(--ink); width: 44px; height: 44px; min-width: 44px; cursor: pointer; border-radius: 50%; font: inherit; }
.round:hover { background: var(--surface); }
.dot { position: relative; }
.dot:after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #b9c0ca; transition: width .2s, margin .2s; }
.dot[aria-current="true"]:after { width: 22px; margin-left: -11px; border-radius: 6px; background: var(--brand); }

/* Beneficios */
.benefits > div { display: grid; grid-template-columns: 48px auto; column-gap: 14px; align-items: center; }
.benefits .icono { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.benefits small { display: block; }

/* Categorías */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
a.category { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 22px; display: flex; align-items: center; gap: 20px; transition: box-shadow .2s, border-color .2s; }
a.category:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
a.category img, .category-inicial { width: 120px; height: 120px; object-fit: contain; flex-shrink: 0; mix-blend-mode: multiply; }
.category-inicial { display: grid; place-items: center; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand); font: 700 48px var(--font-titulos); mix-blend-mode: normal; }
.category-text { display: flex; flex-direction: column; }
.category-text b { font-family: var(--font-titulos); font-size: var(--fs-lg); }
.category-text span { font-size: var(--fs-sm); color: var(--brand); font-weight: 600; margin-top: 6px; }
.categoria-tarjeta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.categoria-tarjeta h2 { margin: 0; }
.categoria-tarjeta p { margin: 0 0 6px; }
.categoria-tarjeta a:not(.btn) { color: var(--ink-2); font-size: 15px; }
.categoria-tarjeta .btn { margin-top: 10px; }

/* Productos */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 14px 16px; background: var(--white); display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.product:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.product-image { position: relative; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; margin-bottom: 12px; }
.product-image img, .sin-imagen { width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-image img { mix-blend-mode: multiply; }
.sin-imagen { display: grid; place-items: center; background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-sm); font-size: var(--fs-sm); text-align: center; }
.discount { position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff; border-radius: 4px; padding: 4px 8px; font-size: var(--fs-xs); font-weight: 700; }
.product-brand { font-size: 13px; }
.product h3 { font-size: var(--fs-base); line-height: 1.35; min-height: 2.7em; margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price { font: 800 var(--fs-xl) var(--font-titulos); font-variant-numeric: tabular-nums; }
.price.large { font-size: clamp(30px, 3vw, 40px); margin: 16px 0 6px; }
.product-saving { display: inline-block; align-self: flex-start; margin-top: 6px; background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.product-volume { margin: 8px 0 14px; color: var(--ink-2); }
.product .btn { margin-top: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--ink-2); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.green:before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Catálogo */
.page-head p { margin: 0; }
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.filter-panel { padding: 0; }
.filter-panel > summary { padding: 16px 20px; color: var(--brand); font-weight: 700; cursor: pointer; }
.filters { padding: 20px; display: flex; flex-direction: column; }
.filtro-titulo { font-size: var(--fs-md); }
select { width: 100%; min-height: 45px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; }
.filters .btn { margin: 4px 0 12px; }
.catalog-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.catalog-bar > p { margin: 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 5px 12px; font-size: var(--fs-sm); font-weight: 600; }
.chips li span { font-weight: 400; color: var(--ink-2); }
.chips li:last-child { background: none; padding: 5px 4px; }
.pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 25px; font-size: var(--fs-sm); }

/* Ficha */
.breadcrumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.gallery .main-photo { width: 100%; background: var(--surface-2); border-radius: var(--r-md); }
.gallery img.main-photo { aspect-ratio: 1; object-fit: contain; }
.thumbs { list-style: none; display: flex; gap: 12px; margin: 20px 0 0; padding: 0; }
.thumbs a { display: block; width: 85px; height: 85px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px; background: var(--white); }
.thumbs a.selected { border: 2px solid var(--brand); }
.thumbs img { height: 100%; width: 100%; object-fit: contain; }
.saving { color: var(--ok); font-size: var(--fs-sm); font-weight: 600; }
.price-rule { background: var(--accent-soft); border: 1px solid #f3e3a6; border-radius: var(--r-sm); padding: 16px; margin: 20px 0; }
.detail-info h1 { margin-bottom: 4px; }

/* Páginas informativas */
.info-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 30px; align-items: start; }
.info-menu h2 { font-size: var(--fs-md); }
.info-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px; font-size: 15px; }
.info-menu a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.prose { max-width: 900px; }
.prose p, .prose li { line-height: 1.8; }
.prose ul { padding-left: 22px; }

.callout { background: linear-gradient(120deg, var(--accent-soft), #fff); border: 1px solid #f3e3a6; border-radius: var(--r-md); padding: 35px; text-align: center; }
.empty-icon .icono { width: 72px; height: 72px; padding: 18px; border-radius: 50%; background: var(--surface); color: #8d96a3; }

@media (max-width: 1050px) {
    .catalog-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 760px) {
    .shop-nav > div { padding: 2px 18px; gap: 22px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
    .search { order: 4; flex-basis: 100%; }
    .header-nav { display: none; }
    .section-title { align-items: flex-start; }
    .carousel { display: flex; flex-direction: column; background: var(--ink); }
    .slide img { aspect-ratio: 1.5; }
    .carousel-caption { position: static; width: 100%; background: var(--ink); padding: 18px 18px 8px; }
    .carousel-caption h2 { font-size: 24px; max-width: none; }
    .carousel-controls { position: static; align-self: center; margin: 4px 0 14px; }
    .category-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    a.category { flex-direction: column; text-align: center; padding: 14px; gap: 8px; }
    a.category img, .category-inicial { width: 100%; max-width: 130px; height: auto; aspect-ratio: 1; }
    .category-text { align-items: center; }
    .category-text b { font-size: var(--fs-base); }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .product { padding: 10px 10px 12px; }
    .product h3 { font-size: 15px; }
    .price { font-size: 20px; }
    .catalog-layout, .info-layout, .detail-layout { grid-template-columns: 1fr; gap: 16px; }
    .info-menu { display: none; }
    .gallery .main-photo { max-height: 340px; }
    .thumbs a { width: 64px; height: 64px; }
}

/* Cuenta del cliente (F2.3) */
.aux { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.aux a { color: var(--brand); }
.perfil-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; align-items: start; }
.perfil-grid h2 { margin-top: 0; }
.ubicacion { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin: 0 0 18px; }
.ubicacion legend { font-weight: 700; padding: 0 6px; font-size: var(--fs-sm); }
select { width: 100%; min-height: 45px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px; background: var(--white); font: inherit; }
.notice.ok { border-color: var(--ok, #3a8a55); background: var(--ok-bg, #eaf6ee); }

/* Carrito, pedido y seguimiento (F2.4–F2.6) */
.cart-link { position: relative; }
.cart-count { position: absolute; top: -6px; left: 18px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--brand); color: #fff; font: 700 12px/20px var(--font-titulos); text-align: center; }
.add-cart { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.add-cart label { margin: 0; }
.add-cart input[type=number] { width: 90px; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-layout .panel + .panel { margin-top: 24px; }
.cart-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line:last-child { border-bottom: 0; }
.cart-line img, .cart-line .sin-foto { width: 84px; height: 84px; object-fit: contain; background: var(--surface-2); border-radius: var(--r-sm); }
.cart-info p { margin: 4px 0; }
.cart-info small { display: block; }
.cart-total { font: 700 var(--fs-lg, 18px) var(--font-titulos); white-space: nowrap; }
.cart-line.con-problema, .line-compact.con-problema { background: var(--warn-bg); border-radius: var(--r-sm); padding-left: 10px; padding-right: 10px; }
.aviso-linea { color: var(--warn); font-weight: 600; }
.qty-form { display: flex; align-items: end; gap: 10px; }
.qty-form label { margin: 0; flex-direction: row; align-items: center; gap: 8px; }
.qty-form input { width: 80px; }
.cart-summary h2, .cart-summary h3 { margin-top: 0; }
.totales { margin: 0 0 16px; }
.totales > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.totales dt, .totales dd { margin: 0; }
.totales .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: var(--fs-lg, 18px); }
.btn.block { display: flex; width: 100%; margin: 12px 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.line-compact { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lista-avisos { margin: 0; padding-left: 20px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
    .cart-line img, .cart-line .sin-foto { width: 64px; height: 64px; }
    .cart-total { grid-column: 2; }
}

/* Pagos y puntos (F4) */
.pagar-tarjeta { margin-bottom: 24px; border-color: var(--brand); }
.pagar-tarjeta h2 { margin-top: 0; }
.puntos-saldo { font: 700 32px var(--font-titulos); margin: 6px 0; }
.puntos-saldo small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.pasarela-simulada { max-width: 560px; margin: 40px auto; }
.acciones-simuladas { display: flex; flex-wrap: wrap; gap: 12px; }
