/* Savonia rail – native carousels (savonia-rail.js) and one product card design for all of them:
   white card, green top edge, soft shadow (as the order-success box). Loaded on every page (Savonia_ProductPage). */
:root {
    --sv-green: #a9cf45;
    --sv-green-dark: #7fa12a;
    --sv-green-soft: #f3f8e6;
    --sv-orange: #dc8430;        /* only the big add-to-cart button of the product page (warm amber, complements the green) */
    --sv-orange-dark: #c06d1c;
    --sv-text: #2f2f2f;
    --sv-muted: #6b6b6b;
    --sv-line: #ececec;
    --sv-radius: 10px;
    --sv-shadow: 0 2px 12px rgba(0, 0, 0, .07);
}

/* ---------- rail (carousel) ---------- */
.sv-rail { position: relative; --sv-gap: 16px; --sv-per: 4; }
.sv-rail__track {
    display: flex !important; gap: var(--sv-gap); margin: 0 -10px !important; padding: 6px 10px 16px !important; scroll-padding: 0 10px; align-items: stretch; list-style: none;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; outline: 0;
}
.sv-rail__track::-webkit-scrollbar { display: none; }
.sv-rail--moving .sv-rail__track { scroll-snap-type: none; }
.sv-rail__track > * {
    flex: 0 0 calc((100% - (var(--sv-per) - 1) * var(--sv-gap)) / var(--sv-per));
    min-width: 0; max-width: none !important; width: auto !important; float: none !important; margin: 0 !important;
    scroll-snap-align: start;
}
.sv-rail--single { --sv-gap: 0px; }
.sv-rail--single .sv-rail__track { padding: 0 !important; }
.sv-rail--single .sv-rail__track > * { flex-basis: 100%; }
.sv-rail__track:focus-visible { box-shadow: 0 0 0 2px var(--sv-green); border-radius: var(--sv-radius); }

.sv-rail__nav {
    position: absolute; top: calc(50% - 26px); z-index: 2; width: 42px; height: 42px; padding: 0;
    border: 1px solid var(--sv-line); border-radius: 50%; background: #fff; box-shadow: var(--sv-shadow);
    color: var(--sv-text); cursor: pointer; transition: opacity .2s, background-color .2s;
}
.sv-rail__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sv-rail__nav:hover { background: var(--sv-green); border-color: var(--sv-green); color: #fff; }
.sv-rail__nav--prev { left: -14px; }
.sv-rail__nav--next { right: -14px; }
.sv-rail__nav:disabled, .sv-rail--static .sv-rail__nav { opacity: 0; pointer-events: none; }
@media (hover: none), (max-width: 767px) { .sv-rail--cards .sv-rail__nav { display: none; } }

.sv-rail__dots { display: flex; justify-content: center; gap: 8px; padding: 10px 0 2px; }
.sv-rail__dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #d5d5d5; cursor: pointer; }
.sv-rail__dots button[aria-current="true"] { background: var(--sv-green); width: 22px; border-radius: 5px; }
.sv-rail--single .sv-rail__nav { top: calc(50% - 21px); }
.sv-rail--single .sv-rail__nav--prev { left: 10px; }
.sv-rail--single .sv-rail__nav--next { right: 10px; }

/* ---------- section titles ---------- */
.sv-rail-box, .savonia-rv { margin: 36px 0 8px; }
.savonia-pp .sv-rail-box .sv-rail-box__title, .sv-rail-box__title, .savonia-pp .savonia-rv > h2 {
    margin: 0 0 10px; padding: 0; border: 0; background: none;
    color: var(--sv-text); font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: 0; text-transform: none;
}
.sv-rail-box__title:after, .savonia-pp .savonia-rv > h2:after { content: none; }
.savonia-rv .savonia-rv-sub { margin: -4px 0 8px; padding: 0; font-size: 14px; }

/* ---------- product card (one design for all rails) ---------- */
.sv-card, .sv-rail--cards .item-area {
    position: relative; display: flex; flex-direction: column;
    background: #fff; border: 0; border-top: 4px solid var(--sv-green); border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow); overflow: hidden; text-align: left;
}
.products-grid li.item.sv-card { padding: 0 !important; min-height: 0; border-bottom: 0; }
.sv-card .product-image { position: relative; display: block; padding: 10px 10px 0; background: #fff; }
.sv-card .product-image img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.sv-card__badge {
    position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 12px;
    background: #ee3124; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3;
}
.sv-card__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 10px 12px 14px; }
.sv-card__name { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; text-transform: none; }
.sv-card__name a {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;
    height: 4.05em; color: var(--sv-text); font-weight: 600; text-decoration: none;
}
.sv-card__name a:hover { color: var(--sv-green-dark); }
.sv-card__rating .ratings { margin: 0; }
.sv-card__rating .amount, .sv-card__rating .rating-links { display: none; }
.sv-card__price { margin-top: auto; }
.sv-card__price .price-box { margin: 0; text-align: left; }
.sv-card__price .price-box p { display: inline-block; margin: 0 6px 0 0; }
.sv-card__price .price { font-size: 17px; font-weight: 700; }
.sv-card__price .old-price .price { font-size: 13px; font-weight: 400; color: #999; }
.sv-card__price .price-label, .sv-card__price .prp-label { display: none; }
.sv-card__cart, .sv-rail--cards .actions .addtocart {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 42px; margin: 4px 0 0; padding: 0 12px;
    border: 0; border-radius: 21px; background: var(--sv-green); color: #fff !important;
    font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none !important; cursor: pointer; transition: background-color .2s;
}
.sv-card__cart:hover, .sv-rail--cards .actions .addtocart:hover { background: var(--sv-green-dark); }
/* after a successful add the button shows "✓ Adăugat" for a moment */
.sv-card__cart:active, .sv-rail--cards .actions .addtocart:active { transform: scale(.98); }
.sv-card__cart.is-added, .sv-rail--cards .actions .addtocart.is-added { background: var(--sv-green-dark) !important; }
.btn-cart.is-added { background: var(--sv-green) !important; border-color: var(--sv-green) !important; }
.sv-card__cart--view { background: #fff; border: 1.5px solid var(--sv-green); color: var(--sv-green-dark) !important; }
.sv-card__cart--view:hover { color: #fff !important; }

/* Porto cards in a rail (home page product widgets, "Continua de unde ai ramas") in the same design */
.sv-rail--cards .item { padding: 0 !important; }
.sv-rail--cards .product-image-area { padding: 10px 10px 0; margin: 0; border: 0; }
.sv-rail--cards .product-image-area img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.sv-rail--cards .details-area { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 10px 12px 14px; text-align: left; }
.sv-rail--cards .details-area .product-name { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; text-align: left; text-transform: none; }
.sv-rail--cards .details-area .product-name a {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis; height: 4.05em; color: var(--sv-text); font-weight: 600;
}
.sv-rail--cards .price-box { margin: auto 0 0; text-align: left; }
.sv-rail--cards .price-box .price { font-size: 17px; font-weight: 700; }
.sv-rail--cards .actions { margin: 0; padding: 0; border: 0; }
.sv-rail--cards .actions .addtocart i { display: none; }
.sv-rail--cards .loader-container { display: none; }

@media (max-width: 767px) {
    .sv-rail { --sv-gap: 12px; }
    .sv-rail-box, .savonia-rv { margin-top: 28px; }
    .savonia-pp .sv-rail-box .sv-rail-box__title, .sv-rail-box__title, .savonia-pp .savonia-rv > h2 { font-size: 18px; }
    .sv-card__body, .sv-rail--cards .details-area { padding: 8px 10px 12px; }
    .sv-card__price .price, .sv-rail--cards .price-box .price { font-size: 16px; }
    .sv-card__cart, .sv-rail--cards .actions .addtocart { min-height: 44px; padding: 0 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .sv-rail__track { scroll-behavior: auto; } }

/* PRP in the rails: the label stays, the explanation bubble is not shown (it slid under the next card) */
.sv-rail .tooltipprp { border-bottom: 0; cursor: default; }
.sv-rail .tooltiptextprp { display: none !important; }

/* equal card heights: the li / owl item is stretched by the flex row, the Porto card fills it */
.sv-rail--cards .sv-rail__track > .item { display: flex; }
.sv-rail--cards .sv-rail__track > .item > .item-area { flex: 1; }
/* the owl-era -10px side margin is not needed any more (it pushed the rails out of the page) */
.owl-top-narrow { margin-left: 0 !important; margin-right: 0 !important; }

/* ---------- page width: fluid from 992px, content at most 1500px (all pages) ---------- */
@media (min-width: 992px) {
    .container, .main.container, .footer .container { width: auto; max-width: 1500px; padding-left: 24px; padding-right: 24px; }
    /* sticky product bar: its content stays within the page width */
    .sticky-product > .container { max-width: 1500px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
    .container .container { max-width: none; padding-left: 0; padding-right: 0; }
}
/* laptops (1024–1279px): the main menu stays on one line */
@media (min-width: 992px) and (max-width: 1279px) {
    .main-nav ul.menu > li > a, .fixed-header ul.menu > li > a { padding-left: 9px !important; padding-right: 9px !important; font-size: 13px !important; }
}

/* ---------- product list (category, search): the same card in a grid ---------- */
/* narrower filter column from 992px: 3 cards at 1024px, 4 at 1366px, 5 at 1500px */
@media (min-width: 992px) {
    .col2-left-layout .col-left.sidebar { width: 250px; }
    .col2-left-layout .col-main { width: calc(100% - 250px); }
}
.products-grid.sv-grid {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 20px 16px;
    margin: 16px 0 24px !important; padding: 0 !important; list-style: none;
}
.products-grid.sv-grid:before, .products-grid.sv-grid:after { content: none; display: none; }
.products-grid.sv-grid > li.item.sv-card { width: auto !important; float: none !important; margin: 0 !important; clear: none !important; }
@media (max-width: 767px) {
    .products-grid.sv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
}
.toolbar .view-mode { display: none; } /* grid only */
.sv-card__stock {
    position: absolute; left: 12px; bottom: 8px; padding: 3px 8px; border-radius: 12px;
    background: rgba(47, 47, 47, .85); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3;
}
.sv-card__cart--off { background: #eee; color: #888 !important; cursor: default; }
.sv-card__cart--off:hover { background: #eee; }
.sv-card__label {
    position: absolute; top: 12px; right: 12px; padding: 4px 9px; border-radius: 12px;
    background: #000; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: .02em; text-transform: uppercase;
}

/* Porto cards in rails (home page): the button stays inside the card */
.sv-rail--cards .details-area .actions { position: static; width: auto; margin: auto 0 0 !important; padding: 0 !important; text-align: center; }
.sv-rail--cards .details-area .actions .addtocart { box-sizing: border-box; width: 100%; margin: 0; float: none; }
.sv-rail--cards .details-area .price-box { margin-bottom: 8px; }

/* ---------- stock badge ---------- */
.sv-stock, .product-shop .availability {
    display: inline-flex; align-items: center; margin: 6px 0; padding: 4px 12px 4px 10px; border-radius: 14px;
    background: var(--sv-green-soft); color: var(--sv-green-dark); font-size: 13px; font-weight: 600; line-height: 1.4;
}
.sv-stock:before, .product-shop .availability.in-stock span:before {
    content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #5ba51f;
    box-shadow: 0 0 0 3px rgba(91, 165, 31, .18); vertical-align: 1px;
}
.product-shop .availability span { margin-left: 4px; color: inherit; font-weight: 700; }
.sv-stock span { margin: 0; }
.sv-stock--out, .product-shop .availability.out-of-stock { background: #f4f4f4; color: #777; }
.sv-stock--out:before { background: #bbb; box-shadow: none; }
.sticky-product .sv-stock { margin: 0 0 0 8px; padding: 2px 10px 2px 8px; font-size: 12px; }

/* ---------- desktop header: logo | search | account, favourites, cart ---------- */
.sv-hicon { display: none; }
@media (min-width: 992px) {
    .header-container.type4 .header.container { display: flex; align-items: center; gap: 28px; padding-top: 18px; padding-bottom: 18px; }
    .header-container.type4 .header > .logo { flex: 0 0 auto; float: none; margin: 0 !important; max-width: 240px; }
    .header-container.type4 .header > .logo img { max-height: 58px; width: auto; }
    .header-container.type4 .search-area { order: 2; flex: 1 1 auto; float: none; position: relative; left: auto; top: auto; margin: 0; max-width: 760px; }
    .header-container.type4 .search-area .search-icon { display: none; }
    .header-container.type4 .header #search_mini_form { display: block; width: 100%; margin: 0; }
    .header-container.type4 .header .form-search {
        position: relative; width: 100% !important; height: 48px; padding: 0; border: 1.5px solid #2f2f2f; border-radius: 24px; background: #fff;
    }
    .header-container.type4 .header .form-search:focus-within { border-color: var(--sv-green); box-shadow: 0 0 0 3px rgba(169, 207, 69, .25); }
    .header-container.type4 .header #search_mini_form .form-search input#search {
        width: 100%; height: 45px; padding: 0 70px 0 22px; border: 0; background: transparent; font-size: 15px; color: var(--sv-text);
    }
    .header-container.type4 .header .form-search button.button {
        position: absolute; top: 4px; right: 4px; width: 58px; height: 37px; padding: 0; border: 0; border-radius: 19px;
        background: var(--sv-green); color: #fff; line-height: 37px;
    }
    .header-container.type4 .header .form-search button.button:hover { background: var(--sv-green-dark); }
    .header-container.type4 .header .form-search button.button i { color: #fff; font-size: 18px; line-height: 37px; }
    .header-container.type4 .cart-area { order: 3; display: flex; align-items: center; gap: 22px; float: none; position: static; margin: 0 0 0 auto; }
    .sv-hicon { position: relative; display: flex; align-items: center; gap: 8px; color: var(--sv-text) !important; text-decoration: none !important; }
    .sv-hicon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .sv-hicon span { display: flex; flex-direction: column; line-height: 1.15; }
    .sv-hicon small { color: #777; font-size: 12px; }
    .sv-hicon b { font-size: 15px; font-weight: 700; }
    .sv-hicon:hover { color: var(--sv-green-dark) !important; }
    .sv-hcount {
        position: absolute; top: -7px; left: 18px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 10px;
        background: var(--sv-green-dark); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 15px; text-align: center;
    }
    .sv-hcount[hidden] { display: none; }
    /* mini cart as the third icon */
    .header-container.type4 .mini-cart { position: relative; top: 0; left: 0; width: auto !important; height: auto; }
    .header-container.type4 .mini-cart .mybag-link {
        display: flex; align-items: center; gap: 8px; position: relative; top: 0; width: auto !important; height: auto; padding: 0;
        background: none; color: var(--sv-text) !important; line-height: 1.15; text-decoration: none; text-transform: none;
    }
    .header-container.type4 .mini-cart .mybag-link:hover { color: var(--sv-green-dark) !important; }
    .header-container.type4 .mini-cart .mybag-link .icon-mini-cart:before { content: none; }
    .header-container.type4 .mini-cart .mybag-link .icon-mini-cart {
        display: block; width: 32px; height: 30px; background-color: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4h2.4l2.2 11h11l2.3-8H7'/%3E%3Ccircle cx='9' cy='19.5' r='1.4'/%3E%3Ccircle cx='17' cy='19.5' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4h2.4l2.2 11h11l2.3-8H7'/%3E%3Ccircle cx='9' cy='19.5' r='1.4'/%3E%3Ccircle cx='17' cy='19.5' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .header-container.type4 .mini-cart .mybag-link .icon-mini-cart { position: static; flex: 0 0 32px; margin: 0; font-size: 0; }
    .header-container.type4 .mini-cart .cart-info {
        display: flex; flex-direction: column; position: static !important; width: auto !important; margin: 0; padding: 0;
        background: none; color: inherit; line-height: 1.15; text-align: left; text-transform: none;
    }
    .header-container.type4 .mini-cart .cart-info > span:not(.cart-qty) { display: none; }
    .header-container.type4 .mini-cart .cart-info:before { content: "Coșul"; color: #777; font-size: 12px; }
    .header-container.type4 .mini-cart .cart-info:after { content: "meu"; font-size: 15px; font-weight: 700; color: var(--sv-text); }
    .header-container.type4 .mini-cart .cart-qty {
        position: absolute; top: -7px; left: 18px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 10px;
        background: var(--sv-green-dark); color: #fff; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
    }
    .header-container.type4 .menu-icon { display: none; }
}
