/* Savonia 2026-11-03: home page (cms-index-index) on phones and tablets.
   Content: CMS block 101 porto_homeslider_4 (top container) + CMS page 29 porto_home_4. No CMS change, CSS only.
   Loaded only on the home page by layout/savonia/home.xml (Savonia_Home), after savonia-rail.css.
   r2 (same day): rail titles, the "Continuă de unde ai rămas" header and the 3 benefits in the new design on every width. */

/* banner images without width/height in the CMS: reserve their box before they load (no layout shift) */
.cms-index-index .std img, .cms-index-index .top-container img { max-width: 100%; height: auto; }
.cms-index-index img[src*="landing-page/sustine-producatorii-romani"],
.cms-index-index img[src*="landing-page/descopera-gama-boema"],
.cms-index-index img[src*="landing-page/unturi-de-corp"],
.cms-index-index img[src*="landing-page/produse-lavanda"],
.cms-index-index img[src*="landing-page/accesorrii-savonia"],
.cms-index-index img[src*="landing-page/burete-naturale"] { aspect-ratio: 298 / 396; }
.cms-index-index img[src*="landing-page/sapunuri-100-naturale"] { aspect-ratio: 615 / 396; }
.cms-index-index img[src*="landing-page/uleiuri-esentiale-savonia"],
.cms-index-index img[src*="landing-page/sare-de-baie-savonia"],
.cms-index-index img[src*="landing-page/cadouri-savonia"] { aspect-ratio: 403 / 396; }
/* slider images: the CMS width/height (917x511) is not the real 1200x628 ratio */
.cms-index-index #banner-slider-demo-4 img { height: auto; aspect-ratio: 1200 / 628; object-fit: cover; }
/* before savonia-rail.js runs (no .sv-rail__track yet) the slides and cards stood in a column and then collapsed:
   CLS 0.55 on phones. Here they already stand in one row, with room for the dots under the slider. */
.cms-index-index #banner-slider-demo-4:not(.sv-rail__track) { display: flex; overflow: hidden; margin-bottom: 21px; }
.cms-index-index #banner-slider-demo-4:not(.sv-rail__track) > .item { flex: 0 0 100%; min-width: 0; }
.cms-index-index #sapun_product .owl-carousel:not(.sv-rail__track) { display: flex; gap: 16px; overflow: hidden; padding: 6px 0 16px; }
.cms-index-index #sapun_product .owl-carousel:not(.sv-rail__track) > * { flex: 0 0 calc((100% - 64px) / 5); min-width: 0; }

/* ---------- r2: the same design on every width ---------- */
/* rail titles like the product page rails (sv-rail-box__title): no Porto line, no capitals */
.cms-index-index .filter-title { margin: 32px 0 10px !important; padding: 0; border: 0; background: none !important; font-size: 20px !important; line-height: 1.3 !important; text-align: left; }
.cms-index-index .filter-title::before, .cms-index-index .filter-title::after { content: none !important; display: none !important; }
.cms-index-index .filter-title .content { padding: 0 !important; background: none !important; line-height: 1.3 !important; }
.cms-index-index .filter-title strong { color: var(--sv-text, #2f2f2f); font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none; }
/* "Continuă de unde ai rămas" (Savonia_RecentlyViewed, shown after cookie consent): title + muted line under it */
.cms-index-index .savonia-rv { margin: 32px 0 0; }
.cms-index-index .savonia-rv .filter-title { margin: 0 0 2px !important; }
.cms-index-index .savonia-rv .savonia-rv-sub { margin: 0 0 6px; padding: 0; color: var(--sv-muted, #6b6b6b); font-size: 14px; line-height: 1.5; }
.cms-index-index .savonia-rv + .filter-title, .cms-index-index .savonia-rv ~ .filter-title { margin-top: 24px !important; }

/* the 3 benefits: white card, icon in a green circle, text left */
.cms-index-index .homepage-bar { margin: 24px 0 !important; border: 0 !important; border-radius: var(--sv-radius, 10px) !important; background: #fff; box-shadow: var(--sv-shadow, 0 2px 12px rgba(0,0,0,.07)); }
.cms-index-index .homepage-bar .row { display: flex; margin: 0; }
.cms-index-index .homepage-bar .row::before, .cms-index-index .homepage-bar .row::after { display: none; }
.cms-index-index .homepage-bar .col-md-4 {
    display: flex; flex: 1 1 0; align-items: center; gap: 14px; width: auto; float: none; min-height: 0; padding: 18px 24px !important; text-align: left !important; border: 0;
}
.cms-index-index .homepage-bar .col-md-4 + .col-md-4 { border-left: 1px solid var(--sv-line, #ececec); }
.cms-index-index .homepage-bar em {
    position: static !important; display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; margin: 0 !important;
    border-radius: 50%; background: var(--sv-green-soft, #f3f8e6); color: var(--sv-green-dark, #7fa12a); font-size: 20px; line-height: 1;
}
.cms-index-index .homepage-bar em::before { margin: 0; }
.cms-index-index .homepage-bar .text-area { display: block; flex: 1; min-width: 0; margin: 0 !important; padding: 0 !important; text-align: left !important; }
.cms-index-index .homepage-bar h3 { margin: 0 0 2px; color: var(--sv-text, #2f2f2f); font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none; }
/* "TRANSPORT GRATUIT" is written in capitals in the CMS block: same case as the other two */
.cms-index-index .homepage-bar .col-md-4:first-child h3 { text-transform: lowercase; }
.cms-index-index .homepage-bar .col-md-4:first-child h3::first-letter { text-transform: uppercase; }
.cms-index-index .homepage-bar p { margin: 0; color: var(--sv-muted, #6b6b6b); font-size: 13px; line-height: 1.45; }

@media (max-width: 991px) {
    /* ---------- top: slider ---------- */
    .cms-index-index #slideshow > .container { padding-top: 12px !important; padding-bottom: 8px !important; }
    .cms-index-index #banner-slider-demo-4 img { width: 100%; }
    .cms-index-index #banner-slider-demo-4 .item { border-radius: var(--sv-radius, 10px) !important; }
    /* dots: same look, 44px tall tap area */
    .cms-index-index #slideshow .sv-rail__dots { padding: 0; }
    .cms-index-index #slideshow .sv-rail__dots button { position: relative; margin: 18px 0; }
    .cms-index-index #slideshow .sv-rail__dots button::after { content: ""; position: absolute; inset: -18px -4px; }
    .cms-index-index #banner-slider-demo-4:not(.sv-rail__track) { margin-bottom: 45px; }
    .cms-index-index #sapun_product .owl-carousel:not(.sv-rail__track) { gap: 12px; }
    .cms-index-index #sapun_product .owl-carousel:not(.sv-rail__track) > * { flex-basis: calc((100% - 12px) / 1.6); }

    /* ---------- top: the two side menus become one row of chips that scrolls sideways ---------- */
    .cms-index-index #slideshow .col-md-3 > .row {
        display: flex; gap: 8px; margin: 0 -15px !important; padding: 4px 15px 6px;
        overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 15px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .cms-index-index #slideshow .col-md-3 > .row::-webkit-scrollbar { display: none; }
    .cms-index-index #slideshow .col-md-3 > .row::before, .cms-index-index #slideshow .col-md-3 > .row::after { display: none; }
    .cms-index-index #slideshow .col-md-3 > .row > div, .cms-index-index #slideshow .side-custom-menu, .cms-index-index #slideshow .side-custom-menu ul { display: contents; }
    .cms-index-index #slideshow .side-custom-menu h2 { display: none; }
    .cms-index-index #slideshow .side-custom-menu li {
        flex: 0 0 auto; margin: 0; padding: 0; border: 0; list-style: none; scroll-snap-align: start;
    }
    /* "Produse noi" and "Promotii" (2nd menu) first, highlighted */
    .cms-index-index #slideshow .col-md-3 .col-md-12 + .col-md-12 li { order: -1; }
    .cms-index-index #slideshow .side-custom-menu li a {
        display: flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--sv-line, #ececec); border-radius: 22px;
        background: #fff; color: var(--sv-text, #2f2f2f); font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
    }
    .cms-index-index #slideshow .col-md-3 .col-md-12 + .col-md-12 li a { border-color: var(--sv-green, #a9cf45); background: var(--sv-green-soft, #f3f8e6); color: #4a6214; }
    .cms-index-index #slideshow .side-custom-menu li a:active { background: var(--sv-green-soft, #f3f8e6); }
    .cms-index-index #slideshow .side-custom-menu li a::before, .cms-index-index #slideshow .side-custom-menu li a::after { display: none; }

    /* ---------- green band: the 3 benefits as compact rows (icon left, text left) ---------- */
    .cms-index-index .homepage-bar { margin: 16px 0 !important; border: 0 !important; border-radius: var(--sv-radius, 10px) !important; background: #fff; box-shadow: var(--sv-shadow, 0 2px 12px rgba(0,0,0,.07)); }
    .cms-index-index .homepage-bar .row { display: flex; flex-direction: column; margin: 0; }
    .cms-index-index .homepage-bar .row::before, .cms-index-index .homepage-bar .row::after { display: none; }
    .cms-index-index .homepage-bar .col-md-4 {
        display: flex; flex: 0 0 auto; align-items: center; gap: 12px; width: auto; float: none; padding: 12px 16px !important; text-align: left !important; border: 0;
    }
    .cms-index-index .homepage-bar .col-md-4 + .col-md-4 { border-top: 1px solid var(--sv-line, #ececec); }
    .cms-index-index .homepage-bar em {
        position: static !important; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; margin: 0 !important;
        border-radius: 50%; background: var(--sv-green-soft, #f3f8e6); color: var(--sv-green-dark, #7fa12a); font-size: 17px; line-height: 1;
    }
    .cms-index-index .homepage-bar .text-area { display: block; flex: 1; min-width: 0; margin: 0 !important; padding: 0 !important; text-align: left !important; }
    .cms-index-index .homepage-bar h3 { margin: 0 0 2px; color: var(--sv-text, #2f2f2f); font-size: 15px; font-weight: 700; line-height: 1.3; text-transform: none; }
    .cms-index-index .homepage-bar p { margin: 0; color: var(--sv-muted, #6b6b6b); font-size: 13px; line-height: 1.4; }

    /* ---------- rails: same edge as the rest of the page, titles like the product page rails ---------- */
    .cms-index-index .top-container .container .main.container { width: auto; padding-left: 0 !important; padding-right: 0 !important; }
    .cms-index-index .top-container .main.container { margin-bottom: 8px !important; }
    .cms-index-index .filter-title { margin: 24px 0 8px !important; background-image: none !important; line-height: 1.3 !important; font-size: 18px !important; text-align: left; }
    .cms-index-index .filter-title::before, .cms-index-index .filter-title::after { display: none !important; }
    .cms-index-index .filter-title .content { padding: 0 !important; background: none !important; line-height: 1.3 !important; }
    .cms-index-index .filter-title strong { color: var(--sv-text, #2f2f2f); font-size: 18px; font-weight: 700; line-height: 1.3; text-transform: none; }

    /* cards: bigger on phones (about 1.6 visible), the next one peeks in; JS sets --sv-per inline, so the width is set here */
    .cms-index-index .sv-rail--cards .sv-rail__track > * { flex-basis: calc((100% - 12px) / 1.6) !important; }

    /* ---------- banners ---------- */
    /* "Sustine producatorii" + "Boema" side by side, "Sapunuri 100% naturale" full width (CMS block) */
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding-bottom: 10px"] { padding-bottom: 8px !important; }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding-bottom: 10px"] > [class*="col-"] { padding-bottom: 12px !important; }
    /* uleiuri / sare de baie / cadouri: one row that scrolls sideways, the next banner peeks in */
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] {
        display: flex; gap: 12px; margin: 0 -15px !important; padding: 20px 15px !important;
        overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 15px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"]::-webkit-scrollbar { display: none; }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"]::before,
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"]::after,
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] > .sm-clearer { display: none; }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] > .col-sm-4 {
        flex: 0 0 72%; width: auto; float: none; padding: 0 !important; scroll-snap-align: start;
    }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] > .col-sm-4 > div { margin: 0 !important; }
    /* banner corners like the cards */
    .cms-index-index .top-container .image-link, .cms-index-index .std .image-link { display: block; overflow: hidden; border-radius: 8px; }
    .cms-index-index .top-container .image-link img, .cms-index-index .std .image-link img { display: block; width: 100%; }

    /* the 4 category banners at the bottom (CMS page): 2 x 2 instead of 4 tall ones */
    .cms-index-index .std > .container { width: auto; padding: 0 !important; }
    .cms-index-index .std > .container > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 !important; padding: 20px 0 8px !important; }
    .cms-index-index .std > .container > .row::before, .cms-index-index .std > .container > .row::after, .cms-index-index .std > .container > .row > .sm-clearer { display: none; }
    .cms-index-index .std > .container > .row > .col-sm-3 { width: auto; float: none; padding: 0 !important; }
    .cms-index-index .std > .container > .row > .col-sm-3 > div { margin: 0 !important; }
    .cms-index-index .col-main { padding-bottom: 16px; }
}

/* tablets: 3 cards and a peek of the 4th (no arrows on touch screens, so the peek is the only hint) */
@media (min-width: 600px) and (max-width: 991px) {
    .cms-index-index .sv-rail--cards .sv-rail__track > * { flex-basis: calc((100% - 36px) / 3.3) !important; }
    .cms-index-index .sv-rail--cards .actions .addtocart { min-height: 44px; }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] > .col-sm-4 { flex-basis: 40%; }
    .cms-index-index .homepage-bar .row { flex-direction: row; }
    .cms-index-index .homepage-bar .col-md-4 { flex: 1 1 0; align-items: flex-start; }
    .cms-index-index .homepage-bar .col-md-4 + .col-md-4 { border-top: 0; border-left: 1px solid var(--sv-line, #ececec); }
    .cms-index-index .std > .container > .row { grid-template-columns: repeat(4, 1fr); }
}
/* small phones in landscape / phablets: 2.4 cards */
@media (min-width: 480px) and (max-width: 599px) {
    .cms-index-index .sv-rail--cards .sv-rail__track > * { flex-basis: calc((100% - 24px) / 2.4) !important; }
    .cms-index-index .top-container div[style*="e9f2d2"] .row[style*="padding: 30px 0px"] > .col-sm-4 { flex-basis: 56%; }
}

/* ---------- r2: favourites heart on the Porto cards of the home rails ---------- */
/* Porto kept it in the row above the add-to-cart button: hidden it still took room (the gap under the price),
   on hover it popped up there. Now a round button in the top-left corner of the picture, always visible (touch too). */
.cms-index-index .sv-rail--cards .item-area { position: relative; }
.cms-index-index .sv-rail--cards .actions .addtowishlist {
    position: absolute !important; top: 18px; left: 18px; z-index: 3; display: flex !important; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin: 0 !important; padding: 0; border: 0 !important; border-radius: 50%;
    background: rgba(255, 255, 255, .92) !important; box-shadow: 0 1px 6px rgba(0, 0, 0, .14); color: #8a8a8a !important;
    font-size: 16px; line-height: 1; visibility: visible !important; opacity: 1 !important; transform: none !important; transition: color .15s, transform .15s;
}
.cms-index-index .sv-rail--cards .actions .addtowishlist::after { content: ""; position: absolute; inset: -4px; } /* 44px tap area */
.cms-index-index .sv-rail--cards .actions .addtowishlist i { margin: 0; color: inherit; font-size: inherit; line-height: 1; }
.cms-index-index .sv-rail--cards .actions .addtowishlist:hover, .cms-index-index .sv-rail--cards .actions .addtowishlist:focus-visible { color: #d6453d !important; transform: scale(1.08) !important; }
.cms-index-index .sv-rail--cards .actions .addtowishlist:focus-visible { outline: 2px solid var(--sv-green, #a9cf45); outline-offset: 2px; }
@media (max-width: 767px) { .cms-index-index .sv-rail--cards .actions .addtowishlist { top: 14px; left: 14px; } }

/* ---------- r2: stars like the category / product page cards (11px, #f5a623 on grey, left) ---------- */
.cms-index-index .sv-rail--cards .ratings { margin: 0; text-align: left; }
.cms-index-index .sv-rail--cards .ratings .rating-box { float: none; margin: 0 !important; }
.cms-index-index .sv-rail--cards .ratings .amount, .cms-index-index .sv-rail--cards .ratings .rating-links { display: none; }
/* no review yet (width:0): the category cards show nothing here; the place stays, so price and button keep their line */
.cms-index-index .sv-rail--cards .ratings:has(.rating[style*="width:0"]) { visibility: hidden; }

/* ---------- r2: the side menu next to the slider (desktop) in the card design ---------- */
@media (min-width: 992px) {
    .cms-index-index #slideshow .side-custom-menu {
        overflow: hidden; margin-bottom: 16px !important; border: 0; border-radius: var(--sv-radius, 10px); background: #fff; box-shadow: var(--sv-shadow, 0 2px 12px rgba(0,0,0,.07));
    }
    .cms-index-index #slideshow .side-custom-menu h2 {
        display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 18px 10px; border: 0; border-top: 4px solid var(--sv-green, #a9cf45); background: none;
        color: var(--sv-text, #2f2f2f); font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none;
    }
    .cms-index-index #slideshow .side-custom-menu h2 em { order: -1; color: var(--sv-green-dark, #7fa12a); font-size: 15px; }
    .cms-index-index #slideshow .side-custom-menu ul { margin: 0; padding: 0 8px 8px; }
    .cms-index-index #slideshow .side-custom-menu li { margin: 0; padding: 0; border: 0 !important; list-style: none; }
    .cms-index-index #slideshow .side-custom-menu li a {
        display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px;
        color: var(--sv-text, #2f2f2f); font-size: 14px; line-height: 1.3; text-decoration: none; transition: background .15s, color .15s;
    }
    .cms-index-index #slideshow .side-custom-menu li a::before { display: none; }
    .cms-index-index #slideshow .side-custom-menu li a::after { content: "\203A"; color: #b8b8b8; font-size: 20px; line-height: 1; transition: transform .15s, color .15s; }
    .cms-index-index #slideshow .side-custom-menu li a:hover, .cms-index-index #slideshow .side-custom-menu li a:focus-visible { background: var(--sv-green-soft, #f3f8e6); color: #4a6214; }
    .cms-index-index #slideshow .side-custom-menu li a:hover::after { color: var(--sv-green-dark, #7fa12a); transform: translateX(3px); }
    /* "Ofertele Savonia": the two offers in green */
    .cms-index-index #slideshow .col-md-12 + .col-md-12 .side-custom-menu li a { font-weight: 600; color: #4a6214; }
}
