/* =============================================================================
 * TOPIC – Stiluri specifice single-topic.php
 * Componentele reutilizabile (topic-cat-item, topic-product-card etc.)
 * se află în style.css (CSS global al child theme-ului).
 * ============================================================================= */

/* -------------------------------------------------------------------------
 * Container LP – centrat, 1196px max-width, 10px padding lateral
 * ------------------------------------------------------------------------- */
.topic-container {
    max-width: var(--topic-max-width);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--topic-px);
    padding-right: var(--topic-px);
}

.topic-py {
    padding-top: var(--topic-py);
    padding-bottom: var(--topic-py);
}

.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: var(--topic-max-width);
}

/* =========================================================================
 * 1. HERO SECTION
 * ========================================================================= */
.topic-hero {
    position: relative;
    background-color: #1a1818;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 80px 0 60px;
    overflow: hidden;
}

.topic-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.topic-hero .topic-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.topic-hero-title {
    color: #fff;
    font-family: "Montserrat", serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.topic-hero-content {
    color: #fff;
    font-size: 16px;
    line-height: 1.7;
    max-width: 800px;
    text-align: center;
}

.topic-hero-content p {
    margin: 0 0 8px;
}

.topic-hero-content a {
    color: #ec145b;
    text-decoration: underline;
}

.topic-hero-content > *:last-child {
    margin-bottom: 0;
}

/* =========================================================================
 * 2. CATEGORIES SECTION (gri)
 * ========================================================================= */
.topic-categories-section {
    background: #f3f6fb;
    width: 100%;
}

.topic-cat-collapsible {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.topic-cat-block {
    /* bloc individual cu grid */
}

.topic-cat-block-title {
    font-family: "Montserrat", serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1818;
    margin: 0 0 20px;
}

/* --- Mobile toggle button --- */
.topic-cat-mobile-header {
    display: none; /* ascuns pe desktop și tabletă */
}

.topic-cat-toggle-btn {
    display: block;
    background: #fff;
    height: 40px;
    padding: 10px 20px;
    margin-right: auto;
    font-size: 14px;
    font-family: "Montserrat", serif;
    font-weight: 600;
    text-transform: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.topic-cat-toggle-btn:focus {
    outline: 2px solid #ec145b;
}

/* --- Child Grid --- */
.topic-child-grid {
    display: grid;
    gap: var(--topic-grid-gap);

    /* Desktop: 4 pe rând */
    grid-template-columns: repeat(4, 1fr);
}

.topic-child-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.topic-child-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.topic-child-image.empty {
    background: #ddd;
}

.topic-child-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Tabletă: 3 pe rând */
@media (max-width: 1024px) and (min-width: 768px) {
    .topic-child-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 pe rând, ascuns sub dropdown */
@media (max-width: 767px) {
    .topic-child-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Category Grid --- */
.topic-cat-grid {
    display: grid;
    gap: var(--topic-grid-gap);

    /* Desktop: 5 pe rând */
    grid-template-columns: repeat(5, 1fr);
}

/* Tabletă: 3 pe rând */
@media (max-width: 1024px) and (min-width: 768px) {
    .topic-cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 pe rând, ascuns sub dropdown */
@media (max-width: 767px) {
    .topic-cat-mobile-header {
        display: block;
    }

    /* Gap între buton și conținut via flex pe container */
    .topic-categories-section .topic-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .topic-cat-collapsible {
        display: none;
    }

    .topic-cat-collapsible.topic-cat-collapsible--open {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .topic-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================================
 * 3. WRAPPER CONTENT + PRODUCTS (albă)
 *    Padding sus/jos o singură dată, gap uniform între secțiuni interne
 * ========================================================================= */
.topic-content-wrapper {
    background: #fff;
    padding: 50px 0;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* Secțiunile interne nu mai adaugă padding propriu */
.topic-page-content-section {
    background: transparent;
    padding: 0;
    width: 100%;
}

/* Container products: flex column cu gap uniform între carduri orizontale și grila plain */
.topic-products-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Conținut pagină (the_content) --- */
.topic-page-content {
    width: 100%;
}

.topic-page-content > *:last-child {
    margin-bottom: 0;
}

/* --- Grid pentru cardurile PLAIN (standard) --- */
.topic-products-plain-grid {
    display: grid;
    gap: var(--topic-grid-gap);

    /* Desktop: 4 coloane */
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) and (min-width: 768px) {
    .topic-products-plain-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .topic-products-plain-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topic-content-wrapper {
        padding: 30px 0;
        gap: 30px;
    }
}
