/**
 * Technofric home page styles (hero + brands by marque).
 * Brand tokens: see brand-colors.css
 */

/* ── Hero: category grid ── */
.hero-section {
    width: 100%;
    height: calc(100vh - 178px);
    overflow: hidden;
    background: #eef2f5;
    padding: .75rem 1.5rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.hero-head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--color-third);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
    justify-content: center;
}

.hero-label::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--color-third);
    border-radius: 1px;
}

.hero-title {
    font-size: 25px;
    font-weight: 700;
    color: #0a1929;
    letter-spacing: -.02em;
    text-align: center;
}

.hero-title span {
    color: var(--color-primary);
}

.hero-sub {
    font-size: 20px;
    color: #7a90a0;
    font-weight: 300;
    margin-top: 2px;
    text-align: center;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
    margin-left: 35px;
    margin-right: 35px;
}

.hero-section .cat-card {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    background: #b8c8d4;
    min-height: 0;
    border: 1.5px solid rgba(255, 255, 255, .9);
    transition: transform .28s, box-shadow .28s;
}

.hero-section .cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 100, 158, .2);
}

.hero-section .cat-card img,
.hero-section .cat-card .cat-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s ease, filter .4s;
    filter: brightness(.78) saturate(.9);
}

.hero-section .cat-card:hover img,
.hero-section .cat-card:hover .cat-bg {
    transform: scale(1.06);
    filter: brightness(.6) saturate(1.05);
}

.cat-grad {
    position: absolute;
    inset: 0;
}

.cat-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-third);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
    z-index: 3;
}

.hero-section .cat-card:hover .cat-bar {
    transform: scaleX(1);
}

.cat-badge {
    position: absolute;
    top: 11px;
    left: 11px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    transition: transform .25s;
}

.hero-section .cat-card:hover .cat-badge {
    transform: scale(1.1);
}

.badge-blue { background: var(--color-primary); }
.badge-green { background: var(--color-third); }
.badge-gray { background: gray; }
.badge-red { background: var(--color-secondary); }
.badge-cyan { background: cyan; }
.badge-orange { background: orange; }

.cat-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .65rem .8rem .7rem;
    z-index: 2;
}

.cat-name {
    font-size: .88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    margin-bottom: 3px;
}

.cat-desc {
    font-size: .68rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .75);
    line-height: 1.3;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s, opacity .3s;
    opacity: 0;
    margin-bottom: 0;
}

.hero-section .cat-card:hover .cat-desc {
    max-height: 40px;
    opacity: 1;
}

.hero-section .cat-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .7rem;
    font-weight: 600;
    color: var(--color-third);
    margin-top: 4px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s, transform .25s;
    position: static;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.hero-section .cat-link::after {
    content: ' →';
}

.hero-section .cat-card:hover .cat-link {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 901px) {
    .cat-name,
    .cat-desc,
    .hero-section .cat-link {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
}

@media (max-width: 900px) {
    .hero-section {
        height: calc(100vh - 72px);
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 992px) {
    .hero-section {
        height: calc(100vh - 72px) !important;
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
    }
}

/* ── Brands: Découvrez nos produits par marque ── */
.brands-section .meat-category-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    padding: 10px;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all .25s ease;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: normal;
    color: inherit;
}

.brands-section .meat-category-tab img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform .25s ease;
}

.brands-section .meat-category-tab:hover {
    border-color: #00649e;
    color: #333;
    background-color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.brands-section .meat-category-tab:hover img {
    transform: scale(1.07);
}

.brands-section .meat-category-tab.active {
    border-color: #00649e;
    background-color: #e8f4ff;
    color: #333;
    box-shadow: 0 4px 10px rgba(0, 100, 158, 0.15);
}

.brands-section .meat-category-tab.active img {
    transform: scale(1.04);
}

.brands-section .list-group {
    gap: 1.2rem !important;
}

/* ── Header nav + mega menu (Technofric) ── */
header nav .menu-link {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    padding: 6px 10px;
}

header nav .menu-link:hover {
    color: #ed0023;
}

.menu-dropdown-wrapper {
    position: relative;
}

.tabs-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    margin-top: -6px;
    padding-top: 10px;
}

.menu-dropdown::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.menu-dropdown-wrapper:hover .tabs-dropdown {
    display: block;
}

.tabs-container {
    display: flex;
    gap: 30px;
    padding: 35px;
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    position: relative;
    width: min(920px, calc(100vw - 2rem));
    max-width: 100%;
}

.tabs-left {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.tab-button i {
    font-size: 20px;
}

.tab-button.is-active {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--color-secondary);
}

.tabs-right {
    flex: 1;
    border-left: 4px solid var(--color-secondary);
    padding-left: 40px;
    position: relative;
    min-height: 280px;
}

.tabs-right .mega-nav-panel {
    display: none;
    animation: megaPanelIn 0.22s ease-out;
    position: relative;
    min-height: 12rem;
}

.tabs-right .mega-nav-panel.is-active {
    display: block;
}

@keyframes megaPanelIn {
    from { opacity: 0.85; transform: translateX(4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.tab-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tab-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tab-title a:hover {
    color: var(--color-primary);
}

.tab-description {
    font-size: 15px;
    max-width: 650px;
    margin-bottom: 30px;
}

.mega-nav-panel .tab-description {
    color: #4a5a6a;
    line-height: 1.55;
}

.tab-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tab-items a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    text-decoration: none;
    color: #333;
}

.tab-items a:hover {
    color: #0071bb;
}

.tab-image {
    position: absolute;
    right: -5px;
    top: 74%;
    transform: translateY(-50%);
}

.tab-image img {
    width: 180px;
    height: auto;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8e8e8;
}

a.tab-button.mega-nav-cat {
    text-decoration: none;
    color: #1a2b3c;
    text-align: left;
}

a.tab-button.mega-nav-cat:hover,
a.tab-button.mega-nav-cat:focus-visible {
    color: var(--color-primary);
    outline: none;
}

a.tab-button.mega-nav-cat:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-third);
    border-radius: 12px;
}

@media (max-width: 1100px) {
    .tabs-container {
        flex-direction: column;
        width: min(640px, calc(100vw - 1.5rem));
        padding: 24px;
        gap: 20px;
    }

    .tabs-left {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    a.tab-button.mega-nav-cat {
        flex: 1 1 auto;
        min-width: 140px;
        padding: 10px 14px;
        font-size: 15px;
    }

    .tabs-right {
        border-left: none;
        border-top: 3px solid var(--color-secondary);
        padding-left: 0;
        padding-top: 16px;
    }

    .mega-nav-panel .tab-image {
        position: static;
        transform: none;
        margin-top: 1rem;
        text-align: center;
    }

    .mega-nav-panel .tab-image img {
        width: min(280px, 100%);
    }
}
