/* ── UI/UX PRO MAX: Premium Editorial Strategy for Marchi & Marchio ── */

/* ==========================================================================
   1. SHARED ELEMENTS (Marchi & Marchio)
   ========================================================================== */

.premium-bg {
    background: var(--ivory);
    position: relative;
    overflow: hidden;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   2. MARCHI.PHP (Brand Directory & Categories)
   ========================================================================== */

/* ── Hero Refined ── */
.page-hero {
    position: relative;
    padding: clamp(160px, 22vh, 240px) 0 clamp(80px, 10vh, 120px) 0;
    text-align: center;
    z-index: 2;
}

.page-hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--gold);
    margin-bottom: 25px;
    font-weight: 600;
    position: relative;
}

.page-hero-eyebrow::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 1px;
    background: var(--gold);
}

.page-hero-title {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 1.05;
    color: var(--dark);
    margin-bottom: 30px;
    letter-spacing: -0.03em;
}

.page-hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-actions {
    margin-top: 50px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* ── Categories (Le Nostre Collezioni) - Premium Glass Cards ── */
.categories-section {
    position: relative;
    z-index: 2;
    padding: clamp(60px, 8vh, 100px) 0;
    max-width: 1250px;
    margin: 0 auto;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0 20px;
}

.cat-card-luxe {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 3/4;
    text-decoration: none;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

.cat-card-luxe-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease, filter 0.8s ease;
    filter: saturate(0.85);
}

.bg-vista {
    background-image: url('../../images/montature.jpg');
}

.bg-sole {
    background-image: url('../../images/lenti-sole.webp');
}

.bg-lenti {
    background-image: url('../../images/lenti-graduate.jpg');
}

.cat-card-luxe:hover .cat-card-luxe-bg {
    transform: scale(1.05);
    filter: saturate(1.1);
}

.cat-card-luxe-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
    transition: opacity 0.5s ease;
}

.cat-card-luxe-content {
    position: relative;
    z-index: 2;
    padding: 40px 30px;
    color: #fff;
    transform: translateY(30px);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cat-card-luxe:hover .cat-card-luxe-content {
    transform: translateY(0);
}

.cat-luxe-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 20px;
    opacity: 0.9;
}

.cat-luxe-title {
    font-size: clamp(2rem, 2.5vw, 2.5rem);
    margin-bottom: 15px;
    color: #fff;
    letter-spacing: -0.02em;
}

.cat-luxe-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.1s;
}

.cat-card-luxe:hover .cat-luxe-desc {
    opacity: 1;
    transform: translateY(0);
}

.cat-luxe-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 600;
}

.cat-luxe-cta i {
    transition: transform 0.3s ease;
}

.cat-card-luxe:hover .cat-luxe-cta i {
    transform: translateX(5px);
}

/* ── Brand Directory (I Nostri Partner) ── */
.brand-directory-section {
    background: var(--white);
    padding: clamp(100px, 15vh, 160px) 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.brand-luxe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: var(--ivory);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.brand-luxe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.06);
    background: #fff;
    border-color: rgba(184, 146, 62, 0.2);
}

.brand-luxe-logo {
    max-height: 45px;
    max-width: 80%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.brand-luxe-card:hover .brand-luxe-logo {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-12px) scale(1.05);
}

.brand-luxe-name {
    display: none; /* Hide brand name — logo is the primary identifier */
}

.brand-luxe-card:hover .brand-luxe-name {
    display: none;
}

.empty-directory {
    text-align: center;
    padding: 60px;
    background: var(--ivory);
    border-radius: 16px;
    border: 1px dashed rgba(184, 146, 62, 0.3);
}

/* ==========================================================================
   3. MARCHIO.PHP (Single Brand Page)
   ========================================================================== */

.brand-page-ec {
    padding-top: 72px; /* Navbar padding */
}

/* ── Brand Hero ── */
.brand-page-hero {
    background: var(--ivory-dark);
    padding: 60px 0 50px;
    position: relative;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.brand-page-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.brand-page-hero-grid-deco {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(184, 146, 62, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 146, 62, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.brand-page-breadcrumb {
    margin-bottom: 32px;
}

.brand-bc-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    text-decoration: none;
    transition: gap 0.3s;
}

.brand-bc-link:hover {
    gap: 12px;
    color: var(--gold-dark);
}

.brand-page-hero-content {
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}

.brand-page-logo-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    min-height: 120px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px var(--shadow);
}

.brand-page-logo {
    max-height: 70px;
    max-width: 200px;
    object-fit: contain;
}

.brand-page-name {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.brand-page-desc {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.brand-page-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand-stat {
    text-align: center;
}

.brand-stat-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.brand-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.brand-stat-sep {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* ── Filter Bar & Tabs ── */
.brand-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
    gap: 20px;
}

.brand-filter-tabs {
    display: flex;
    gap: 8px;
    position: relative;
    padding: 4px;
    background: var(--ivory-dark);
    border-radius: 100px;
}

.brand-tab {
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.brand-tab.active {
    color: var(--white);
}

.brand-tab-indicator {
    position: absolute;
    height: calc(100% - 8px);
    top: 4px;
    left: 4px;
    background: var(--gold);
    border-radius: 100px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(184, 146, 62, 0.3);
}

.brand-tab-count {
    font-size: 0.7rem;
    opacity: 0.6;
}

.brand-tab.active .brand-tab-count {
    opacity: 0.9;
}

.brand-filter-results {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ── Product Grid ── */
.brand-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.brand-product-card {
    background: var(--white);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.brand-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    border-color: var(--gold-bg);
}

.brand-card-hidden {
    display: none;
}

.brand-prod-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    background: #fbfbfb;
    overflow: hidden;
}

.brand-prod-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 30px;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.brand-product-card:hover .brand-prod-img {
    transform: scale(1.08);
}

.brand-prod-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.brand-prod-badge-vista {
    background: rgba(184, 146, 62, 0.1);
    color: var(--gold-dark);
}

.brand-prod-badge-sole {
    background: rgba(45, 45, 45, 0.05);
    color: var(--dark);
}


.brand-prod-details {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.brand-prod-meta {
    margin-bottom: 12px;
}

.brand-prod-type {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold);
}

.brand-prod-name {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.brand-prod-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.brand-prod-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    transition: gap 0.3s;
}

.brand-prod-link:hover {
    gap: 12px;
}

/* ── Empty State ── */
.brand-no-results {
    text-align: center;
    padding: 100px 0;
}

.brand-no-results-icon {
    font-size: 3rem;
    color: var(--gold-bg);
    margin-bottom: 20px;
}

/* ── Prenota CTA ── */
.brand-page-prenota {
    background: var(--ivory);
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.brand-prenota-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.brand-prenota-text {
    flex: 1;
    min-width: 300px;
}

.brand-prenota-actions {
    display: flex;
    gap: 15px;
}

/* ==========================================================================
   4. RESPONSIVE QUERIES
   ========================================================================== */

@media (max-width: 992px) {
    .cat-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .cat-card-luxe {
        aspect-ratio: 4/3;
    }

    .cat-card-luxe-content {
        transform: translateY(0);
    }

    .cat-luxe-desc {
        opacity: 1;
        transform: translateY(0);
    }

    .brand-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .brand-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-filter-tabs {
        overflow-x: auto;
        padding-bottom: 10px;
        scrollbar-width: none;
    }

    .brand-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .brand-prenota-inner {
        flex-direction: column;
        text-align: center;
    }

    .brand-prenota-actions {
        flex-direction: column;
        width: 100%;
    }

    .brand-prenota-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero-actions {
        flex-direction: column;
        gap: 15px;
        padding: 0 10vw;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .cat-luxe-icon {
        display: none;
    }

    .brand-directory-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .brand-luxe-card {
        padding: 40px 20px;
    }

    .brand-luxe-logo {
        max-height: 50px;
    }

    .brand-page-hero-content {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-page-logo-wrap {
        min-width: auto;
    }

    .brand-page-name {
        text-align: center;
    }

    .brand-page-stats {
        justify-content: center;
    }

    .brand-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .brand-prod-img {
        padding: 15px !important;
    }

    .brand-prod-details {
        padding: 15px !important;
    }

    .brand-prod-name {
        font-size: 1.15rem !important;
        margin-bottom: 8px !important;
    }

    .brand-prod-desc {
        display: none !important; /* Hide description on 2-col mobile for vertical space */
    }

    .brand-prod-badge {
        top: 10px !important;
        left: 10px !important;
        font-size: 0.55rem !important;
        padding: 4px 8px !important;
    }

    .brand-prod-link {
        font-size: 0.75rem !important;
        margin-top: auto;
    }
}
