/* ==========================================================================
   MASSIMO SHOES — Pagina de start (content/pages/acasa.html)

   Sus: slider cu 3 bannere (ghete cu panou din CSS, botine cu toc, ghete taupe), apoi avantaje, categorii
   și colecțiile de produse.
   ========================================================================== */

.ms-home {
    --ms-home-purple: #5c4d85;
    --ms-home-purple-dark: #493b70;
    --ms-home-border: #ded7eb;
}

.ms-home__hero {
    position: relative;
    aspect-ratio: 2048 / 945;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 6px;
    background: #f2edf8;
}

/* Slider doar CSS: 3 bannere care se estompează pe rând, câte 6s.
   visibility în keyframes: bannerul ascuns nu mai primește click-ul. */
.ms-home__slide {
    position: absolute;
    inset: 0;
    display: block;
    animation: ms-home-fade 18s infinite;
}

.ms-home__slide:nth-child(2) {
    animation-delay: -12s;
}

.ms-home__slide:nth-child(3) {
    animation-delay: -6s;
}

.ms-home__hero:hover .ms-home__slide {
    animation-play-state: paused;
}

@keyframes ms-home-fade {
    0%, 30% { opacity: 1; visibility: visible; }
    33.33%, 96.67% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
}

/* Cu JS (home.js): slide-ul activ prin .is-active, fără animația CSS. */
.ms-home__hero.is-js .ms-home__slide {
    animation: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.ms-home__hero.is-js .ms-home__slide.is-active {
    opacity: 1;
    visibility: visible;
}

/* Comenzi slider: dreapta jos, pastilă de sticlă. */
.ms-home__nav {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.ms-home__nav button {
    margin: 0;
    padding: 0;
    min-height: 0;
    border: 0;
    box-shadow: none;
    cursor: pointer;
    line-height: 1;
}

.ms-home__nav .ms-home__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50% !important;
    color: #2b2640;
    transition: background 0.2s ease;
}

.ms-home__nav .ms-home__arrow:hover {
    background: #fff;
}

.ms-home__arrow--next svg {
    transform: rotate(180deg);
}

.ms-home__nav .ms-home__dot {
    width: 8px;
    height: 8px;
    background: rgba(43, 38, 64, 0.35);
    border-radius: 999px !important;
    transition: width 0.25s ease, background 0.25s ease;
}

.ms-home__nav .ms-home__dot[aria-current="true"] {
    width: 22px;
    background: #5c4d85;
}

.ms-home__nav button:focus-visible {
    outline: 2px solid #5c4d85;
    outline-offset: 2px;
}

@media (max-width: 549px) {
    .ms-home__nav {
        right: 8px;
        bottom: 8px;
        gap: 4px;
        padding: 3px;
    }

    .ms-home__nav .ms-home__arrow {
        width: 26px;
        height: 26px;
    }

    .ms-home__nav .ms-home__arrow svg {
        width: 14px;
        height: 14px;
    }
}

/* Panou „sticlă” cu titlu și buton, peste bannerele fără text. */
.ms-home__glass {
    position: absolute;
    top: 50%;
    left: 5%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    max-width: min(440px, 42%);
    padding: clamp(18px, 2.6vw, 34px);
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(29, 26, 34, 0.18);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    color: #2b2640;
}

.ms-home__glass-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ms-home__glass-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 3.6vw, 46px);
    line-height: 1.1;
    text-wrap: balance;
}

.ms-home__glass-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #5c4d85;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.ms-home__glass-btn::after {
    content: "→";
    transition: transform 0.2s ease;
}

.ms-home__slide:hover .ms-home__glass-btn,
.ms-home__slide:focus-visible .ms-home__glass-btn {
    background: #493b70;
}

.ms-home__slide:hover .ms-home__glass-btn::after {
    transform: translateX(3px);
}

/* Fără backdrop-filter: panou opac, textul rămâne lizibil. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ms-home__glass {
        background: rgba(255, 255, 255, 0.85);
    }
}

@media (max-width: 549px) {
    .ms-home__glass {
        top: 8px;
        left: 8px;
        transform: none;
        gap: 8px;
        max-width: 58%;
        padding: 12px 14px;
        border-radius: 12px;
    }

    .ms-home__glass-kicker {
        display: none;
    }

    .ms-home__glass-title {
        font-size: 18px;
    }

    .ms-home__glass-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ms-home__slide {
        animation: none;
    }

    .ms-home__hero:not(.is-js) .ms-home__slide + .ms-home__slide {
        display: none;
    }
}

.ms-home__hero > br,
.ms-home__hero > p:empty {
    display: none;
}

.ms-home__hero > p {
    display: contents;
}

/* Bannerul are textul în stânga: pe ecrane înguste îl ținem în cadru. */
.ms-home__banner {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
}

.ms-home__collection {
    margin-bottom: 48px;
}

.ms-home__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ms-home-border);
}

.ms-home__heading h2 {
    margin: 0;
}

.ms-home__more {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.ms-home__more a {
    color: var(--ms-home-purple);
}

.ms-home__more a::after {
    content: " →";
}

.ms-home__more a:hover,
.ms-home__more a:focus-visible {
    color: var(--ms-home-purple-dark);
    text-decoration: underline;
}

@media (max-width: 549px) {
    .ms-home__hero {
        margin-bottom: 14px;
    }

    .ms-home__collection {
        margin-bottom: 36px;
    }
}

/* --------------------------------------------------------------------------
   Categorii sezon (Botine / Cizme & Ghete): carduri crem cu poză și etichetă
   -------------------------------------------------------------------------- */

.ms-home__cats {
    --ms-home-cream: #f6f1ec;
    --ms-home-tile: #ebe3db;
    --ms-home-ink: #1d1a22;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.ms-home__group {
    padding: 22px 22px 24px;
    background: var(--ms-home-cream);
    border-radius: 18px;
}

.ms-home__title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 18px;
    color: var(--ms-home-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.ms-home__title::before,
.ms-home__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #b9aca0;
}

.ms-home__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ms-home__cat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    color: var(--ms-home-ink);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(29, 26, 34, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ms-home__cat-img {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--ms-home-tile);
}

.ms-home__cat-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ms-home__cat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    padding: 12px 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(17px, 1.6vw, 22px);
    line-height: 1.2;
}

.ms-home__cat-label::after {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border: solid currentColor;
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.ms-home__cat:hover,
.ms-home__cat:focus-visible {
    color: var(--ms-home-ink);
    box-shadow: 0 10px 24px rgba(29, 26, 34, 0.12);
    transform: translateY(-2px);
}

.ms-home__cat:hover .ms-home__cat-img img,
.ms-home__cat:focus-visible .ms-home__cat-img img {
    transform: scale(1.04);
}

.ms-home__cat:hover .ms-home__cat-label::after,
.ms-home__cat:focus-visible .ms-home__cat-label::after {
    transform: translateX(3px) rotate(45deg);
}

.ms-home__cat:focus-visible {
    outline: 2px solid var(--ms-home-purple);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .ms-home__cat,
    .ms-home__cat-img img,
    .ms-home__cat-label::after {
        transition: none;
    }
}

@media (max-width: 849px) {
    .ms-home__cats {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 36px;
    }
}

@media (max-width: 549px) {
    .ms-home__group {
        padding: 16px 12px 14px;
        border-radius: 14px;
    }

    .ms-home__grid {
        gap: 10px;
    }

    .ms-home__cat-label {
        min-height: 56px;
        padding: 10px 12px;
    }
}

/* wpautop pune <br>/<p> goale între carduri; altfel ocupă celule din grid. */
.ms-home__cats > br,
.ms-home__cats > p:empty,
.ms-home__grid > br,
.ms-home__grid > p:empty {
    display: none;
}

/* --------------------------------------------------------------------------
   Rând avantaje (schimb, transport, plată, retur)
   -------------------------------------------------------------------------- */

.ms-home__perks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    grid-auto-rows: 1fr; /* toate rândurile la înălțimea celui mai înalt card */
}

.ms-home__perks > br,
.ms-home__perks > p:empty {
    display: none;
}

.ms-home__perk {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #f8f6fc;
    border: 1px solid #ebe5f4;
    border-radius: 12px;
    color: #1d1a22;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.ms-home__perk:hover,
a.ms-home__perk:focus-visible {
    color: #1d1a22;
    border-color: #c9bddc;
    box-shadow: 0 6px 18px rgba(29, 26, 34, 0.08);
}

a.ms-home__perk:focus-visible {
    outline: 2px solid var(--ms-home-purple);
    outline-offset: 2px;
}

.ms-home__perk-icon {
    display: inline-flex;
    flex: none;
    color: var(--ms-home-purple);
}

.ms-home__perk-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.4;
}

.ms-home__perk-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.3;
}

.ms-home__perk-text strong {
    font-size: 15px;
    font-weight: 700;
}

.ms-home__perk-text span {
    color: #5f5a6b;
    font-size: 13px;
}

@media (max-width: 1099px) {
    .ms-home__perks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobil: 2×2 compact, centrat — iconiță sus, titlu scurt, detaliu mic. */
@media (max-width: 549px) {
    .ms-home__perks {
        gap: 8px;
        margin-bottom: 24px;
    }

    .ms-home__perk {
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px 6px;
        text-align: center;
        border-radius: 10px;
    }

    .ms-home__perk-text {
        align-items: center;
    }

    .ms-home__perk-text strong {
        font-size: 12.5px;
        line-height: 1.25;
        letter-spacing: -0.01em;
    }

    .ms-home__perk-text strong,
    .ms-home__perk-text span {
        text-wrap: balance;
    }

    .ms-home__perk-text span {
        font-size: 12px;
        line-height: 1.3;
    }

    .ms-home__perk-icon svg {
        width: 28px;
        height: 28px;
    }
}

/* "Vezi toate modelele" mereu în dreapta titlului. */
.ms-home__heading {
    flex-wrap: nowrap;
}

.ms-home__more {
    margin-left: auto;
    text-align: right;
}

/* wpautop înfășoară linkurile în <p>; display: contents le lasă copiii direct în grid. */
.ms-home__perks > p,
.ms-home__grid > p {
    display: contents;
}

/* Banda „Ghid de mărimi” – același design ca banda „Ai nevoie de ajutor?” din footer. */
.ms-home__size {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    /* full width: iese din container până la marginile ecranului; conținutul rămâne aliniat la 1240px ca în footer */
    margin: 0 calc(50% - 50vw) 48px;
    padding: 32px max(15px, calc(50vw - 620px));
    border-radius: 0;
    background: #2b2640;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
    line-height: 1.5;
}
.ms-home__size-icon { display: none; }
.ms-home__size-text { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ms-home__size-text strong { color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 2.4vw, 28px); font-weight: 400; line-height: 1.2; }
.ms-home__size-btn {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 48px;
    padding: 10px 22px;
    border: 1px solid #5c4d85;
    border-radius: 8px;
    background: #5c4d85;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s ease;
}
.ms-home__size-btn:hover { background: #6b5b98; color: #fff; }
.ms-home__size br, .ms-home__size > p:empty { display: none; }
.ms-home__size > p { display: contents; }

@media (max-width: 549px) {
    .ms-home__size {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        margin-bottom: 32px;
        padding: 22px 18px;
    }
    .ms-home__size-btn { align-self: stretch; justify-content: center; }
}
