/* ===================================================================
   CATÁLOGO — Florería Afrodita
   Cada arreglo sobre su propio cielo de estudio, el precio a la vista
   y el pedido a un toque.
   =================================================================== */

/* --- Encabezado: campo de la hora con el objeto cortado por el borde --- */
.catalog-hero {
    position: relative;
    background: var(--field);
    color: var(--on-field);
    padding: calc(var(--nav-h) + clamp(48px, 7vw, 112px)) 0 clamp(56px, 7vw, 112px);
    overflow: hidden;
    transition: background-color 1.6s ease;
}
.catalog-hero {
    background-image: url('/assets/10.webp');
    background-repeat: no-repeat;
    background-size: min(44vw, 640px) auto;
    background-position: calc(100% + 3vw) calc(100% + 9vw);
    min-height: min(82svh, 760px);
    display: flex;
    align-items: center;
}
.catalog-hero .container { position: relative; z-index: 1; }
.catalog-hero h1 {
    font-size: var(--t-xl);
    line-height: 0.94;
    letter-spacing: -0.035em;
    font-weight: 750;
    font-stretch: 86%;
    max-width: 11ch;
    margin-bottom: 1.5rem;
    color: var(--on-field);
}
.catalog-hero p {
    font-size: var(--t-lead);
    max-width: 44ch;
    color: var(--on-field);
}

/* --- Búsqueda y filtros --- */
.catalog-filters {
    background: var(--foam);
    padding: clamp(32px, 4vw, 56px) 0 16px;
}
.catalog-filters .container { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.search-container { position: relative; flex: 1 1 320px; max-width: 460px; }
.search-input {
    width: 100%;
    min-height: 52px;
    padding: 0 48px 0 46px;
    font: inherit;
    font-size: 17px;
    color: var(--ink);
    background: var(--sky-2);
    border: 2px solid transparent;
    border-radius: 0;
    outline: none;
    transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus { border-color: var(--ink); background: #fff; }
.search-input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-clear {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: 0; background: none; color: var(--ink);
    font-size: 26px; line-height: 1; cursor: pointer; display: none;
}
.search-clear.visible { display: block; }
.search-clear:hover { color: var(--field); }

.filters-container { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 520px; }
.filter-label { font-size: var(--t-xs); color: var(--muted); margin-right: 4px; }
.filter-btn {
    min-height: 44px;
    padding: 0 1rem;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    background: var(--sky-2);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast);
}
.filter-btn:hover { background: var(--sky); }
.filter-btn.active { background: var(--ink); color: #fff; }
.filter-btn:active { transform: scale(0.97); }

.results-counter { padding: 8px 0 0; font-size: var(--t-xs); color: var(--muted); }
.results-counter strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- Rejilla de arreglos --- */
.catalog-section { padding: clamp(24px, 3vw, 40px) 0 var(--gap-section); }
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(40px, 4vw, 64px) clamp(16px, 2vw, 32px);
}
.product-card {
    background: none;
    border-radius: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: none; }
.product-image-container {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--sky);
    cursor: zoom-in;
}
.product-card[data-categories~="funebres"] .product-image-container { background: var(--rose); }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.product-card:hover .product-image { transform: scale(1.04); }
.zoom-icon {
    position: absolute; right: 12px; bottom: 12px;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--foam); color: var(--ink); border-radius: 0;
    opacity: 0; transform: translateY(6px);
    transition: opacity var(--t-fast) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.product-image-container:hover .zoom-icon { opacity: 1; transform: none; }
.zoom-icon svg { width: 20px; height: 20px; }

.product-info { padding: 18px 0 0; display: flex; flex-direction: column; flex: 1; }
.product-name {
    font-size: var(--t-m);
    line-height: 1.12;
    letter-spacing: -0.015em;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.product-description { font-size: 16px; line-height: 1.5; color: var(--ink); margin-bottom: 1rem; }
.product-footer {
    margin-top: auto;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}
.price-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.product-price {
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.btn-order {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 48px; padding: 0 1rem;
    background: var(--sun); color: var(--on-sun);
    font-weight: 650; font-size: 16px; white-space: nowrap;
    border-radius: 0;
    transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast);
}
.btn-order:hover { background: var(--sun-hover); transform: none; }
.btn-order:active { transform: scale(0.97); }
.btn-order svg { width: 18px; height: 18px; }

/* --- Lightbox (flota de verdad: lleva sombra) --- */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    padding: var(--m);
    background: rgba(12, 34, 56, 0.86);
}
.lightbox.active { display: flex; animation: lb-in 260ms var(--ease-out); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-content {
    position: relative; width: min(92vw, 720px); max-height: 92svh;
    background: var(--foam); display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); /* taste-skill-ignore: flota de verdad */
}
.lightbox-image { width: 100%; max-height: 72svh; object-fit: contain; background: var(--sky); }
.lightbox-close {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 48px; height: 48px; border: 0; border-radius: 0;
    background: var(--foam); color: var(--ink); font-size: 30px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: var(--sun); }
.lightbox-info { padding: 16px 20px 20px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.lightbox-info h3 { font-size: var(--t-m); color: var(--ink); }
.lightbox-info p { font-size: 24px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- Estados --- */
.empty-state { display: none; padding: 64px 0; }
.empty-state.active { display: block; }
.empty-state h3 { font-size: var(--t-l); margin-bottom: 0.75rem; color: var(--ink); }
.empty-state p { color: var(--ink); }

.scroll-top {
    position: fixed; right: calc(var(--m) + 4px); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 998;
    width: 52px; height: 52px; border: 0; border-radius: 0;
    background: var(--ink); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.scroll-top:hover { background: var(--field); }
.scroll-top svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
    .catalog-hero { background-size: 54vw auto; background-position: calc(100% + 10vw) calc(100% + 12vw); }
}
@media (max-width: 600px) {
    .catalog-hero { padding-bottom: 74vw; min-height: 0; background-size: 76vw auto; background-position: calc(100% + 8vw) calc(100% + 10vw); }
    .catalog-hero h1 { font-size: clamp(40px, 11.5vw, 54px); }
    .filters-container { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--m)); padding: 0 var(--m); }
    .filters-container::-webkit-scrollbar { display: none; }
    .filter-btn { flex: none; }
    .filter-label { flex: none; }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; }
    .product-name { font-size: 18px; }
    .product-description { display: none; }
    .product-footer { flex-direction: column; align-items: stretch; }
    .product-price { font-size: 22px; }
    .btn-order { justify-content: center; width: 100%; font-size: 15px; padding: 0 0.5rem; white-space: normal; text-align: center; }
    .btn-order svg { display: none; }
}
@media (max-width: 360px) {
    .products-grid { grid-template-columns: 1fr; }
    .product-description { display: block; }
}

/* Entrada de cada arreglo al renderizar */
.product-card { animation: pc-in 600ms var(--ease-out) both; }
.product-card:nth-child(2) { animation-delay: 60ms; } .product-card:nth-child(3) { animation-delay: 120ms; }
.product-card:nth-child(4) { animation-delay: 180ms; } .product-card:nth-child(5) { animation-delay: 240ms; }
.product-card:nth-child(6) { animation-delay: 300ms; }
@keyframes pc-in { from { opacity: 0; transform: translate3d(0, 20px, 0); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .product-card { animation: none; } }
