/* =====================================================
   AMATISTA · CATÁLOGO LUXURY v2 — Vitrinas de arco
   CSS dedicado exclusivamente al catálogo de productos
   ===================================================== */

:root {
    --catalog-primary: #8C5FBF;
    --catalog-primary-deep: #6E4496;
    --catalog-secondary: #5A3580;
    --catalog-accent: #B57EDC;
    --catalog-gold: #C9A86A;
    --catalog-gold-deep: #A8853F;
    --catalog-ink: #14101B;
    --catalog-light: #FDFCFB;
    --catalog-cream: #F8F5F0;
    --catalog-lavender: #F5F1FA;
    --catalog-gray: #6B6375;
    --catalog-hairline: rgba(22, 18, 28, 0.09);
}

/* ===================================
   CATALOG HERO · portada con marca
   de agua editorial
   =================================== */
.catalog-hero {
    background:
        radial-gradient(900px 420px at 50% -150px, rgba(140, 95, 191, 0.45), transparent 70%),
        radial-gradient(600px 300px at 95% 110%, rgba(201, 168, 106, 0.14), transparent 60%),
        linear-gradient(160deg, #14101B 0%, #221B2E 100%);
    color: #fff;
    padding: 158px 0 92px;
    margin-top: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Marca de agua serif fantasma */
.catalog-hero::before {
    content: 'Amatista';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(6rem, 18vw, 13rem);
    color: rgba(255, 255, 255, 0.035);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.catalog-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 80%);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--catalog-gold), transparent);
}

.catalog-hero .container {
    position: relative;
    z-index: 1;
}

.catalog-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    margin-bottom: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.08;
    position: relative;
    padding-bottom: 1.6rem;
}

.catalog-hero h1::before {
    content: '— Colección floral —';
    display: block;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.44em;
    text-transform: uppercase;
    color: var(--catalog-gold);
    margin-bottom: 1.6rem;
}

.catalog-hero h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 1px;
    background: var(--catalog-gold);
    box-shadow: 0 0 16px rgba(201, 168, 106, 0.55);
}

.catalog-hero p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 620px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.9;
}

/* ===================================
   FILTERS · mostrador de joyería
   =================================== */
.catalog-filters {
    background: rgba(253, 252, 251, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.35rem 0;
    border-bottom: 1px solid var(--catalog-hairline);
    position: sticky;
    top: 80px;
    z-index: 100;
}

/* Buscador por nombre o código */
.catalog-search {
    display: flex;
    justify-content: center;
    margin-bottom: 1.05rem;
}

#product-search {
    width: min(480px, 100%);
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    border: 1px solid rgba(22, 18, 28, 0.14);
    background: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--catalog-ink);
    outline: none;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

#product-search::placeholder {
    color: #9b93a6;
    letter-spacing: 0.02em;
}

#product-search:focus {
    border-color: var(--catalog-primary);
    box-shadow: 0 0 0 4px rgba(140, 95, 191, 0.12), 0 0 0 1px rgba(201, 168, 106, 0.3);
}

.filters-container {
    display: flex;
    gap: 0.55rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--catalog-gold-deep);
    margin-right: 0.9rem;
}

.filter-btn {
    padding: 0.55rem 1.25rem;
    border: 1px solid rgba(22, 18, 28, 0.14);
    background: transparent;
    color: var(--catalog-ink);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.6, 0.3, 1);
    font-size: 0.81rem;
    letter-spacing: 0.03em;
    line-height: 1;
}

.filter-btn:hover {
    border-color: var(--catalog-primary);
    color: var(--catalog-primary-deep);
    background: var(--catalog-lavender);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--catalog-ink);
    color: #fff;
    border-color: var(--catalog-ink);
    box-shadow: 0 0 0 1px rgba(201, 168, 106, 0.5), 0 8px 22px rgba(22, 18, 28, 0.22);
}

/* ===================================
   PRODUCTS GRID
   =================================== */
.catalog-section {
    padding: 84px 0 110px;
    background:
        radial-gradient(800px 400px at 0% 10%, rgba(140, 95, 191, 0.05), transparent 60%),
        radial-gradient(700px 360px at 100% 80%, rgba(201, 168, 106, 0.07), transparent 60%),
        var(--catalog-cream);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem 2.4rem;
}

/* ===================================
   PRODUCT CARD · vitrina de arco
   =================================== */
.product-card {
    background: #fff;
    border-radius: 999px 999px 22px 22px;
    overflow: hidden;
    border: 1px solid rgba(22, 18, 28, 0.07);
    box-shadow:
        0 1px 2px rgba(22, 18, 28, 0.04),
        0 14px 34px rgba(22, 18, 28, 0.06);
    transition: transform 0.4s cubic-bezier(0.25, 0.6, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.6, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 12px 12px 0;
}

.product-card:hover {
    transform: translateY(-9px);
    box-shadow:
        0 4px 10px rgba(22, 18, 28, 0.05),
        0 34px 70px rgba(110, 68, 150, 0.18);
}

/* La flor se exhibe bajo un arco con cerco dorado */
.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.12;
    overflow: hidden;
    cursor: pointer;
    background: var(--catalog-lavender);
    border-radius: 999px 999px 14px 14px;
    box-shadow: 0 0 0 1px rgba(201, 168, 106, 0.45);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.1s cubic-bezier(0.22, 0.6, 0.3, 1);
}

.product-card:hover .product-image {
    transform: scale(1.06);
}

.product-badge {
    position: absolute;
    top: auto;
    bottom: 1rem;
    right: 1rem;
    background: var(--catalog-ink);
    color: #fff;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.88);
    width: 58px;
    height: 58px;
    background: rgba(20, 16, 27, 0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.product-image-container:hover .zoom-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.zoom-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.product-info {
    padding: 1.6rem 1.2rem 1.7rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: center;
}

/* Código de referencia */
.product-ref {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--catalog-gold-deep);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Florón separador bajo el nombre */
.product-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.38rem;
    color: var(--catalog-ink);
    margin-bottom: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    position: relative;
    padding-bottom: 0.95rem;
}

.product-name::after {
    content: '·❦·';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--catalog-gold);
    font-size: 0.8rem;
    letter-spacing: 0.4em;
}

.product-description {
    color: var(--catalog-gray);
    line-height: 1.75;
    margin-bottom: 1.4rem;
    font-size: 0.89rem;
    font-weight: 300;
    flex-grow: 1;
}

.product-description ul {
    list-style: none;
    padding: 0;
}

.product-description li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
    text-align: left;
}

.product-description li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--catalog-gold);
    font-weight: bold;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--catalog-hairline);
    text-align: left;
}

.product-price {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.72rem;
    color: var(--catalog-primary-deep);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.price-label {
    font-size: 0.6rem;
    color: #9b93a6;
    display: block;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-weight: 500;
}

.product-offer-badge {
    position: absolute;
    top: -0.7rem;
    right: 1rem;
    background: linear-gradient(135deg, #C9A86A 0%, #A8853F 100%);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(201, 168, 106, 0.45);
    z-index: 2;
}

.price-label.price-label-old {
    text-decoration: line-through;
    text-decoration-color: var(--catalog-primary);
    text-decoration-thickness: 1.5px;
    color: #9b93a6;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.btn-order {
    padding: 0.8rem 1.45rem;
    background: #1EBE5D;
    color: white;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.79rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.6, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(30, 190, 93, 0.28);
    white-space: nowrap;
    line-height: 1;
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30, 190, 93, 0.38);
    background: #169549;
}

.btn-order svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* ===================================
   LIGHTBOX / MODAL
   =================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 10, 19, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.35s cubic-bezier(0.25, 0.6, 0.3, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(201, 168, 106, 0.4), 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: -54px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: var(--catalog-primary);
    border-color: var(--catalog-primary);
    transform: rotate(90deg);
}

.lightbox-info {
    background: #fff;
    padding: 1.4rem 1.8rem;
    border-radius: 14px;
    margin-top: 1rem;
    text-align: center;
}

.lightbox-info h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--catalog-ink);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.lightbox-info p {
    color: var(--catalog-primary-deep);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ===================================
   EMPTY STATE
   =================================== */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    display: none;
}

.empty-state.active {
    display: block;
}

.empty-state h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--catalog-ink);
    margin-bottom: 0.8rem;
}

.empty-state p {
    color: var(--catalog-gray);
    font-size: 1rem;
    font-weight: 300;
}

/* ===================================
   RESULTS COUNTER
   =================================== */
.results-counter {
    text-align: center;
    padding: 1.7rem 0 0.3rem;
    color: var(--catalog-gray);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 500;
}

.results-counter strong {
    color: var(--catalog-primary-deep);
    font-weight: 700;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2.4rem 1.8rem;
    }
}

@media (max-width: 768px) {
    .catalog-hero {
        padding: 124px 0 64px;
        margin-top: 70px;
    }

    .catalog-filters {
        position: static;
        top: auto;
        padding: 1.15rem 0;
    }

    .filter-btn {
        padding: 0.5rem 1.05rem;
        font-size: 0.78rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        max-width: 420px;
        margin: 0 auto;
    }

    .product-name {
        font-size: 1.26rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .btn-order {
        padding: 0.75rem 1.25rem;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-close {
        top: -46px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .catalog-section {
        padding: 56px 0 84px;
    }
}

@media (max-width: 480px) {
    .filters-container {
        gap: 0.5rem;
    }

    .filter-label {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 0.4rem;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .btn-order {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   LOADING / MOTION
   =================================== */
.product-card.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   SCROLL TO TOP BUTTON
   =================================== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 54px;
    height: 54px;
    background: var(--catalog-ink);
    color: #fff;
    border: 1px solid rgba(201, 168, 106, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(22, 18, 28, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.6, 0.3, 1);
    z-index: 1000;
}

.scroll-top.visible {
    display: flex;
}

.scroll-top:hover {
    background: var(--catalog-primary-deep);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(110, 68, 150, 0.4);
}

.scroll-top svg {
    width: 22px;
    height: 22px;
}

/* ===================================
   TAGS · código y categoría bajo el precio
   =================================== */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.1rem;
}

.product-tag {
    font-size: 0.6rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    background: var(--catalog-lavender);
    color: var(--catalog-primary-deep);
    border: 1px solid rgba(140, 95, 191, 0.18);
    line-height: 1;
}

.product-tag-code {
    background: var(--catalog-ink);
    color: #fff;
    border-color: var(--catalog-ink);
    box-shadow: 0 0 0 1px rgba(201, 168, 106, 0.45);
}

.product-tag-cat {
    background: var(--catalog-lavender);
    color: var(--catalog-secondary);
}
