/* ============================================================
   Home section styles — served as external cacheable CSS
   ============================================================ */

/* ----------------------------------------------------------
   content-visibility: auto on below-fold sections
   Tells the browser to skip layout/paint until near viewport.
   contain-intrinsic-size reserves approximate space so the
   scrollbar doesn't jump when sections are revealed.
   ---------------------------------------------------------- */
#home-section-latest-products,
[id^="home-section-products-"],
#home-section-four-steps,
#home-section-showroom-highlight,
#home-section-showroom-info,
#home-section-reviews,
#home-section-faq,
#home-section-popular-tags {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
}

/* ----------------------------------------------------------
   Popular Categories
   ---------------------------------------------------------- */
#home-section-popular-categories {
    background: #ffffff;
    padding: 3.75rem 0 3rem;
}

#home-section-popular-categories .popular-categories-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

#home-section-popular-categories h2 {
    margin: 0;
    color: #37201b;
    font-family: Georgia, serif;
    font-size: 2.35rem;
    font-weight: 500;
    line-height: 1.02;
}

#home-section-popular-categories .popular-categories-heading a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c3328;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

#home-section-popular-categories .popular-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

#home-section-popular-categories .popular-category {
    display: flex;
    position: relative;
    min-height: 7.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
    padding: 1.2rem 1.25rem;
    border: 1px solid #eaded3;
    border-radius: 0.45rem;
    background: #fbf7f2;
    color: #3d231e;
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

#home-section-popular-categories .popular-category:hover {
    border-color: #c66f56;
    transform: translateY(-2px);
}

#home-section-popular-categories .popular-category::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(90deg, rgba(31, 16, 12, 0.72), rgba(31, 16, 12, 0.25)), var(--category-image, none);
    background-position: center;
    background-size: cover;
    transition: transform 220ms ease;
}

#home-section-popular-categories .popular-category:hover::before {
    transform: scale(1.04);
}

#home-section-popular-categories .popular-category span:first-child {
    position: relative;
    z-index: 1;
    max-width: 12rem;
    color: #fffaf5;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.28);
}

#home-section-popular-categories .popular-category span:last-child {
    display: inline-flex;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 250, 245, 0.92);
    color: #5b2a1e;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 1024px) {
    #home-section-popular-categories .popular-categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #home-section-popular-categories {
        padding: 2.5rem 0 2rem;
    }

    #home-section-popular-categories .container {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    #home-section-popular-categories .popular-categories-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.85rem;
        margin-bottom: 1.25rem;
    }

    #home-section-popular-categories h2 {
        font-size: 1.85rem;
    }

    #home-section-popular-categories .popular-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.7rem;
    }

    #home-section-popular-categories .popular-category {
        min-height: 7.25rem;
        padding: 1rem;
    }

    #home-section-popular-categories .popular-category span:first-child {
        font-size: 0.95rem;
    }
}

/* ----------------------------------------------------------
   Four Steps
   ---------------------------------------------------------- */
#home-section-four-steps > .container {
    padding-right: 2.5rem !important;
    padding-left: 2.5rem !important;
}

@media (max-width: 1279px) {
    section[aria-label="Patru pasi"] > div > div:first-child {
        margin-bottom: 2.25rem !important;
    }

    .home-four-steps-slider {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
    }

    .home-four-steps-slider::-webkit-scrollbar {
        display: none;
    }

    .home-four-steps-card {
        flex: 0 0 min(21rem, 78vw) !important;
        min-width: min(21rem, 78vw) !important;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 2.5rem 2.25rem 2.25rem !important;
    }

    .home-four-steps-controls {
        display: flex !important;
        justify-content: flex-end;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .home-four-steps-controls button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid #e3cdb8;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.22);
        color: #4a2a24;
        font-family: Georgia, serif;
        font-size: 1.8rem;
        line-height: 1;
    }

    .home-four-steps-card:last-child {
        border-right: 0 !important;
    }
}

@media (max-width: 767px) {
    section[aria-label="Patru pasi"] {
        padding: 3rem 0 2.5rem !important;
    }

    #home-section-four-steps > .container {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    section[aria-label="Patru pasi"] > div > div:first-child {
        gap: 1rem !important;
        margin-bottom: 1.75rem !important;
    }

    .home-four-steps-slider {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        overscroll-behavior-x: contain !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        border-radius: 1.75rem !important;
    }

    .home-four-steps-card {
        flex: 0 0 86vw !important;
        min-width: 86vw !important;
        max-width: 86vw !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
        min-height: auto !important;
        padding: 2rem 1.5rem 1.75rem !important;
    }
}

@media (min-width: 1280px) {
    .home-four-steps-controls {
        display: none !important;
    }
}

/* ----------------------------------------------------------
   Reviews
   ---------------------------------------------------------- */
#home-section-reviews {
    background: #fffaf5;
    padding: 4.5rem 0 4rem;
    border-top: 1px solid #eadfd5;
}

#home-section-reviews .reviews-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

#home-section-reviews h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 2.35rem;
    font-weight: 500;
    line-height: 1.1;
    color: #37201b;
}

#home-section-reviews .reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

#home-section-reviews .review-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.75rem;
    border: 1px solid #eaded3;
    border-radius: 1rem;
    background: #fff;
}

#home-section-reviews .review-stars {
    color: #c7674d;
    font-size: 0.95rem;
    letter-spacing: 0.12rem;
}

#home-section-reviews .review-text {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.65;
    color: #5e4038;
    flex: 1;
}

#home-section-reviews .review-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.9rem;
    border-top: 1px solid #f0e6de;
}

#home-section-reviews .review-name {
    margin: 0 0 0.15rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #3d231e;
}

#home-section-reviews .review-location {
    margin: 0;
    font-size: 0.82rem;
    color: #6b5248;
}

#home-section-reviews .review-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 0 auto;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #f0f9f4;
    color: #3a7a57;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    #home-section-reviews .reviews-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #home-section-reviews {
        padding: 3rem 0 2.5rem;
    }

    #home-section-reviews .reviews-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.85rem;
        margin-bottom: 1.5rem;
    }

    #home-section-reviews h2 {
        font-size: 1.9rem;
    }

    #home-section-reviews .reviews-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.85rem;
    }

    #home-section-reviews .reviews-grid::-webkit-scrollbar {
        display: none;
    }

    #home-section-reviews .review-card {
        flex: 0 0 82vw;
        min-width: 82vw;
        scroll-snap-align: start;
    }
}

/* ----------------------------------------------------------
   FAQ
   ---------------------------------------------------------- */
#home-section-faq {
    background: #fff;
    padding: 4.5rem 0 4rem;
    border-top: 1px solid #eadfd5;
}

#home-section-faq .faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 5rem;
    align-items: start;
}

#home-section-faq .faq-heading {
    position: sticky;
    top: 6rem;
}

#home-section-faq h2 {
    margin: 0 0 1.5rem;
    font-family: Georgia, serif;
    font-size: 2.8rem;
    font-weight: 500;
    line-height: 1.05;
    color: #37201b;
}

#home-section-faq .faq-heading p {
    margin: 0;
    font-size: 0.97rem;
    line-height: 1.6;
    color: #6b5248;
}

#home-section-faq details {
    border-bottom: 1px solid #eaded3;
}

#home-section-faq details:first-of-type {
    border-top: 1px solid #eaded3;
}

#home-section-faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem 0;
    cursor: pointer;
    list-style: none;
    font-size: 1.03rem;
    font-weight: 600;
    line-height: 1.4;
    color: #3d231e;
    user-select: none;
}

#home-section-faq summary::-webkit-details-marker {
    display: none;
}

#home-section-faq summary .faq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid #dcc8b5;
    border-radius: 999px;
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    color: #8b3f2f;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

#home-section-faq summary .faq-icon::before {
    content: '+';
}

#home-section-faq details[open] summary .faq-icon::before {
    content: '−';
}

#home-section-faq details[open] summary .faq-icon {
    background: #5b2a1e;
    border-color: #5b2a1e;
    color: #fff;
}

#home-section-faq .faq-answer {
    padding: 0 3rem 1.5rem 0;
    font-size: 0.97rem;
    line-height: 1.72;
    color: #6b5248;
}

@media (max-width: 1279px) {
    #home-section-faq .faq-layout {
        gap: 3.5rem;
        grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
    }

    #home-section-faq h2 {
        font-size: 2.4rem;
    }
}

@media (max-width: 1024px) {
    #home-section-faq .faq-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    #home-section-faq .faq-heading {
        position: static;
    }

    #home-section-faq h2 {
        margin-bottom: 0.75rem;
        font-size: 2.2rem;
    }
}

@media (max-width: 767px) {
    #home-section-faq {
        padding: 3rem 0 2.5rem;
    }

    #home-section-faq h2 {
        font-size: 1.9rem;
    }

    #home-section-faq summary {
        font-size: 0.95rem;
        padding: 1.2rem 0;
    }

    #home-section-faq .faq-answer {
        padding-right: 0;
    }
}

/* ----------------------------------------------------------
   Showroom Info
   ---------------------------------------------------------- */
#home-section-showroom-info > .container {
    padding-right: 2.5rem !important;
    padding-left: 2.5rem !important;
}

@media (max-width: 1279px) {
    section[aria-label="Showroom info"] > div > div {
        gap: 2.75rem !important;
    }

    section[aria-label="Showroom info"] h2 {
        font-size: 3.3rem !important;
    }
}

@media (max-width: 1024px) {
    section[aria-label="Showroom info"] > div > div {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    section[aria-label="Showroom info"] img {
        min-height: 34rem !important;
    }

    section[aria-label="Showroom info"] > div > div > div:last-child {
        padding: 0 !important;
    }
}

@media (max-width: 767px) {
    section[aria-label="Showroom info"] {
        padding: 3rem 0 !important;
    }

    section[aria-label="Showroom info"] > div {
        padding: 0 1rem !important;
    }

    #home-section-showroom-info .showroom-info-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 2rem !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    section[aria-label="Showroom info"] img {
        min-height: 26rem !important;
        border-radius: 1.75rem !important;
    }

    section[aria-label="Showroom info"] > div > div > div:first-child > div {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        padding: 1rem 1.1rem !important;
    }

    section[aria-label="Showroom info"] h2 {
        font-size: 2.4rem !important;
    }

    section[aria-label="Showroom info"] > div > div > div:last-child > div:nth-of-type(2) {
        margin-bottom: 2rem !important;
    }

    section[aria-label="Showroom info"] > div > div > div:last-child > div:last-child a {
        width: 100% !important;
    }
}

/* ----------------------------------------------------------
   Showroom Highlight
   ---------------------------------------------------------- */
#home-section-showroom-highlight > .container {
    padding-right: 2.5rem !important;
    padding-left: 2.5rem !important;
}

@media (max-width: 1439px) {
    #home-section-showroom-highlight > div {
        padding: 0 2rem !important;
    }

    #home-section-showroom-highlight > div > div {
        gap: 3.5rem !important;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
    }
}

@media (max-width: 1279px) {
    #home-section-showroom-highlight {
        padding: 4rem 0 !important;
    }

    #home-section-showroom-highlight > div {
        padding: 0 1.75rem !important;
    }

    #home-section-showroom-highlight > div > div {
        gap: 2.5rem !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #home-section-showroom-highlight .showroom-highlight-media {
        max-width: 42rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy {
        padding-right: 0 !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy h2 {
        font-size: 2.6rem !important;
        margin-bottom: 2rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy > div:first-of-type {
        gap: 1.75rem !important;
        margin-bottom: 2.25rem !important;
    }
}

@media (max-width: 1024px) {
    #home-section-showroom-highlight {
        padding: 3.5rem 0 !important;
    }

    #home-section-showroom-highlight > div {
        padding: 0 1.5rem !important;
    }

    #home-section-showroom-highlight img {
        min-height: 0 !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy h2 {
        font-size: 2.25rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy > div:first-of-type {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.35rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-actions {
        gap: 1rem !important;
        align-items: stretch !important;
    }

    #home-section-showroom-highlight .showroom-highlight-actions a:first-child,
    #home-section-showroom-highlight .showroom-highlight-actions a:last-child {
        width: 100% !important;
        justify-content: space-between !important;
    }
}

@media (max-width: 767px) {
    #home-section-showroom-highlight {
        padding: 3rem 0 !important;
    }

    #home-section-showroom-highlight > div {
        padding: 0 1rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-layout,
    #home-section-showroom-highlight .showroom-highlight-copy-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #home-section-showroom-highlight .showroom-highlight-layout {
        align-items: stretch !important;
        gap: 2rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy-grid {
        gap: 1.1rem !important;
    }

    #home-section-showroom-highlight img {
        min-height: 0 !important;
        border-radius: 2rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-badge {
        right: 0.75rem !important;
        bottom: 0.75rem !important;
        left: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        padding: 1rem 1.2rem !important;
        border-radius: 1.2rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-badge p:first-child {
        font-size: 0.72rem !important;
        letter-spacing: 0.24rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-badge p:last-child {
        font-size: 0.92rem !important;
        white-space: normal !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy h2 {
        font-size: 1.9rem !important;
        margin-bottom: 1.5rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy > div:first-of-type {
        gap: 1.1rem !important;
        margin-bottom: 1.75rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy p,
    #home-section-showroom-highlight .showroom-highlight-copy a {
        font-size: 0.95rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy > div:nth-of-type(2) {
        margin-bottom: 1.75rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-actions a:first-child {
        padding: 10px 18px !important;
    }
}

@media (max-width: 479px) {
    #home-section-showroom-highlight {
        padding: 2.5rem 0 !important;
    }

    #home-section-showroom-highlight > div {
        padding: 0 0.85rem !important;
    }

    #home-section-showroom-highlight img {
        border-radius: 1.4rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-copy h2 {
        font-size: 1.7rem !important;
    }

    #home-section-showroom-highlight .showroom-highlight-badge {
        padding: 0.9rem 1rem !important;
    }
}

/* ----------------------------------------------------------
   Popular Tags
   ---------------------------------------------------------- */
#home-section-popular-tags {
    background: #fbf7f2;
    padding: 3.25rem 0 3rem;
    border-top: 1px solid #eadfd5;
}

#home-section-popular-tags .popular-tags-heading {
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3rem;
    color: #6b5248;
    text-transform: uppercase;
}

#home-section-popular-tags .tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#home-section-popular-tags .tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 1.1rem;
    border: 1px solid #e3d5c7;
    border-radius: 999px;
    background: #fff;
    color: #5a3a32;
    font-size: 0.87rem;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

#home-section-popular-tags .tag-pill:hover {
    border-color: #c7674d;
    background: #c7674d;
    color: #fff;
}

@media (max-width: 767px) {
    #home-section-popular-tags {
        padding: 2.5rem 0 2.25rem;
    }
}
