/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* Delivery-time badge, coloured per `source` tier via the --sv-del-color var.
   Icon + label sit together in a filled pill; the date, where it is shown, goes
   plain underneath. All tiers share one solid truck glyph filled with currentColor,
   so the pill's own colour carries the artwork and no per-tier icon rule is needed. */
.sv-del {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sv-del__main {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: var(--sv-del-color, #333);
    color: #fff;
}

.sv-del__icon {
    flex: 0 0 auto;
    line-height: 0;
    color: inherit;
}

.sv-del__icon svg {
    display: block;
    width: 100%;
    height: auto;
}

.sv-del__label {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    color: inherit;
    white-space: nowrap;
}

.sv-del__eta {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--wd-text-color, #777);
}

/* Loop card: the badge row overlays the top-left corner of the product image. The
   wrapper is what gets positioned — a second pill of unknown width cannot be placed
   beside the first without a shared row. The image is one big link, so nothing in
   here may swallow clicks meant for it. */
.sv-badges {
    position: absolute;
    top: 7px;
    /* Spans the image's width so space-between can hold the delivery pill at the
       left edge and the stock tag at the right. With only the delivery pill present
       — every in-stock card — space-between has nothing to push against and it
       stays exactly where it was. */
    inset-inline: 7px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5px;
    pointer-events: none;
}

.sv-del--loop {
    position: static;
}

.sv-del--loop .sv-del__main {
    gap: 5px;
    padding: 3px 8px;
}

.sv-del--loop .sv-del__icon {
    width: 21px;
}

.sv-del--loop .sv-del__label {
    font-size: 12px;
}

/* WoodMart's sale/new/hot labels claim the same corner, and render just after the
   badge row inside .product-element-top — drop them below it rather than under it. */
.sv-badges ~ .product-labels {
    top: 38px;
}

.sv-del--single {
    margin: 14px 0;
}

.sv-del--single .sv-del__main {
    gap: 10px;
}

/* Icon widths across the contexts below are sized to their label now that both
   sit inside a pill — at their old standalone sizes they inflate its height. */
.sv-del--single .sv-del__icon {
    width: 22px;
}

.sv-del--single .sv-del__label {
    font-size: 14px;
}

/* Slot inside the layout's Transporti row — right-aligned to match the row, and
   text only: that row supplies its own truck icon and needs no date. */
.sv-del--row {
    align-items: flex-end;
    text-align: right;
}

.sv-del--row .sv-del__main {
    padding: 5px 14px;
}

.sv-del--row .sv-del__label {
    font-size: 14px;
}

/* SCRUM-915 — "Vetëm online" after the delivery promise, on the same line.

   A tier can carry a note; the pill then reads "5 ditë + / Vetëm online" as
   icon, label, note in one row, so it stays the ordinary one-line pill with
   the stadium radius. The separator is drawn by CSS rather than stored in the
   note text, so the markup and the translation hold only the words. Loop,
   single and row pills carry the note; the basket-level cart and checkout pills
   never do (see functions.php). */
.sv-del__note::before {
    content: "/ ";
}

.sv-del__note {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    color: inherit;
    white-space: nowrap;
}

.sv-del--loop .sv-del__note {
    font-size: 12px;
}

.sv-del--single .sv-del__note,
.sv-del--row .sv-del__note {
    font-size: 14px;
}

/* Cart / checkout line item, under the product name. */
.sv-del--item {
    margin-top: 4px;
}

.sv-del--item .sv-del__main {
    gap: 6px;
}

.sv-del--item .sv-del__icon {
    width: 16px;
}

.sv-del--item .sv-del__label {
    font-size: 11px;
}

.sv-del--item .sv-del__eta {
    margin-top: 1px;
    font-size: 12px;
}

/* Order-level row in the cart totals / checkout review table. */
.sv-del--total {
    align-items: flex-end;
    text-align: right;
}

.sv-del--total .sv-del__main {
    gap: 8px;
}

.sv-del--total .sv-del__icon {
    width: 20px;
}

.sv-del--total .sv-del__label {
    font-size: 13px;
}

.sv-del--total .sv-del__eta {
    font-size: 12px;
}

/* Price and Add to cart share the card's last line. The button used to float over
   the image in WoodMart's top-right overlay; it is rendered here instead, keeping
   the theme's own classes so it looks and behaves the same. */
.sv-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sv-price-row__price {
    min-width: 0;
}

.sv-price-row__btn {
    flex: 0 0 auto;
}

/* WoodMart sizes its icon buttons at 50px for an image overlay — too tall to sit
   on a line of text. */
.sv-price-row__btn.wd-action-btn.wd-style-icon > a {
    width: 38px;
    height: 38px;
}

/* The overlay's Add to cart slot is left behind empty now the button lives on the
   price line. Hidden unconditionally rather than with :empty — the slot can only
   be empty here, and :empty silently stops matching if anything at all lands
   inside it, leaving a blank box in the corner of every card. */
.product-element-top .wd-buttons > .wd-add-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .sv-del--loop .sv-del__main {
        gap: 4px;
        padding: 2px 7px;
    }

    .sv-del--loop .sv-del__icon {
        width: 19px;
    }

    .sv-del--loop .sv-del__label {
        font-size: 10px;
    }

    .sv-del--loop .sv-del__note {
        font-size: 10px;
    }

    .sv-badges ~ .product-labels {
        top: 32px;
    }

    /* The noted pill is the longest text on a narrow card, so it sits tighter. */
    .sv-del--noted.sv-del--loop .sv-del__main {
        gap: 3px;
        padding: 2px 6px;
    }

    .sv-del--noted.sv-del--loop .sv-del__label,
    .sv-del--noted.sv-del--loop .sv-del__note {
        letter-spacing: 0;
    }

    .sv-price-row__btn.wd-action-btn.wd-style-icon > a {
        width: 34px;
        height: 34px;
    }
}

/* SCRUM-640 #1 — the crimson utility strip ("Na kontaktoni" / "Kyçu / Regjistrohu")
   is desktop-only. The header builder's own `hide_mobile` is not enough: it merely
   zeroes --wd-top-bar-sm-h, which sizes .whb-top-bar-inner, while the Customizer's
   unscoped `.whb-top-bar { height: 2rem }` keeps re-inflating the row itself. Taking
   the row out below WoodMart's 1024px header breakpoint is what actually removes it.
   Marked !important because that Customizer rule prints inline, after this file. */
@media (max-width: 1024px) {
    .whb-top-bar,
    .whb-clone .whb-top-bar {
        display: none !important;
    }
}

/* SCRUM-640 #5, extended by SCRUM-799 #2 — on phones the best-sellers heading and
   its "Shiko te gjitha" link collapse into one brand-coloured strip, white text,
   everything on a single line.

   Four containers get it, all heading a row of products: `4ae0916` is the
   homepage best-sellers pair this was written for, `50c195d` the "Të gjitha
   produktet" pair further down the same page, `a9ff283` the pair at the foot of
   the shop archive layout (#1239), and `5c6217e` the "Produkte të ngjashme"
   heading in the single product layout (#1055). That last one holds the title
   alone — related products are chosen from the product being viewed, so there is
   no wider list to send anyone to and no arrow to sit beside it; the rules below
   that reach for a second child simply find nothing there. Rebuilding any of the
   four in Elementor changes its id and these selectors would need the new one.
   768.98px is this site's own Elementor mobile breakpoint (kit 15), so the strip
   and the title's mobile font size switch at exactly the same width.

   Vertical centring here is by CONSTRUCTION, not by nudging. The strip has a fixed
   40px height and zero vertical padding, and both texts get a 40px line-height, so
   the browser puts each one's content area in the middle of an identical 40px line
   box. That centres them in the strip and against each other in one move, whatever
   their font sizes, with no optical correction to re-tune if the copy or the
   typeface changes. Earlier attempts centred the boxes and then fought the leading
   inside them; this removes the leading question entirely. */
@media (max-width: 768.98px) {
    .elementor-element-4ae0916,
    .elementor-element-50c195d,
    .elementor-element-a9ff283,
    .elementor-element-5c6217e {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 40px;
        padding: 0 12px;
        border-radius: 4px;
        background-color: #AC2055;
    }

    /* Every level between the strip and the text: Elementor forces the widget's
       inner box to height:100%, and the title sits three wrappers deep, so each one
       passes the full height down and centres what it holds. Margins go too — the
       theme and Elementor both add bottom margins that would offset the line. */
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) > .elementor-element,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) > .elementor-element > .elementor-widget-container,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .title-wrapper,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .liner-continer {
        display: flex;
        align-items: center;
        min-width: 0;
        margin: 0 !important;
    }

    /* !important because Elementor prints the per-widget colour and size rules
       inline, after this stylesheet and at a higher specificity. */
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .title {
        overflow: hidden;
        margin: 0 !important;
        padding: 0;
        color: #fff !important;
        font-size: 1rem !important;
        line-height: 40px !important;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) :is(.elementor-widget-text-editor, .elementor-widget-icon) {
        flex: 0 0 auto;
    }

    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .elementor-widget-text-editor,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .elementor-widget-text-editor a,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d, .elementor-element-a9ff283, .elementor-element-5c6217e) .elementor-widget-text-editor p {
        margin: 0;
        padding: 0;
        color: #fff !important;
        font-size: .75rem !important;
        line-height: 40px !important;
        white-space: nowrap;
    }
}

/* SCRUM-640 #2 — mobile action row: burger left, pill search field filling the
   middle, account and cart right, on the brand colour.

   Two cascade facts shape the selectors below. First, WoodMart injects its part
   stylesheets as <link> tags inside the markup, so they land AFTER this file and win
   any tie — `.whb-color-dark:not(.whb-with-bg){background-color:#fff}` in
   header-base is what kept painting this row white. Second, the Customizer CSS
   prints inline later still, with !important on this row's padding. Both are beaten
   on specificity rather than with a pile of !important, by qualifying with the
   .whb-main-header / .whb-clone wrapper.

   All four elements sit in one builder column (whb-column_mobile5) and Header
   Builder has no placement controls inside a column, so the arrangement is done
   here. Desktop is untouched: that column is .whb-hidden-lg, which the theme only
   renders below 1024px, and the row rules live in the same query. */
@media (max-width: 1024px) {
    /* Deliberately NOT :not(.whb-with-bg): the row carries a grey background set in
       Header Builder for desktop, which applies at every width. The builder emits it
       as plain `.whb-header-bottom` (one class), so qualifying with the wrapper is
       enough to win on mobile without !important, and desktop keeps the grey. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom {
        background-color: #AC2055;
    }

    /* Both rows pinned to one gutter so the logo above and the burger below line up.
       The Customizer pads this row 3.5rem a side — 112px on a phone — and the theme
       puts the top row on a 95% clamp, so neither is left to its own devices. */
    :is(.whb-main-header, .whb-clone) :is(.whb-general-header, .whb-header-bottom) > :is(.container, .container-fluid) {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    :is(.whb-main-header, .whb-clone) .whb-header-bottom .whb-column_mobile5 {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    /* The theme gives every tools element `padding-inline: 10px`, so with a 10px row
       gap on top the account and cart sat 30px apart. Trimming the padding and
       dropping the gap pulls them together, and since the field below is flex: 1,
       every pixel freed here goes to the search box. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .whb-column_mobile5 .wd-tools-element > a {
        padding-inline: 4px;
    }

    /* The field takes whatever the burger and the two right-hand icons leave over.
       Its own small margins are the only separation left in the row. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-search-form {
        flex: 1 1 auto;
        min-width: 0;
        margin-inline: 10px;
        padding-inline: 0;
    }

    /* The form is entirely variable-driven — height, radius, border, colours all read
       from these — so the pill is a matter of setting them, not overriding rules. The
       theme sets the same vars at three classes' worth of specificity from a later
       sheet, hence the wrapper prefix here. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-search-form .searchform {
        --wd-form-height: 40px;
        --wd-form-brd-radius: 999px;
        --wd-form-brd-width: 0px;
        --wd-form-bg: #fff;
        --wd-form-color: #333;
        --wd-form-placeholder-color: #777;
        width: 100%;
    }

    /* The "Menu" and "Llogaria Ime" labels have no room beside a full-width field. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-tools-text {
        display: none;
    }

    /* White controls on the brand colour. The account's ring is drawn with
       currentColor, so it follows this without a rule of its own. The magnifier
       inside the field is not affected: the theme wires it to --wd-form-color,
       set to #333 with the pill's other variables above, which is what keeps it
       visible against the white field. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .whb-column_mobile5 :is(.wd-tools-element, .wd-tools-element > a, .wd-tools-icon) {
        color: #fff;
    }

    /* No disc behind the account icon: WoodMart's glyph already draws its own ring,
       and a filled circle underneath it showed as a grey crescent above the outline
       rather than as a second circle. The reference has the bare ringed glyph too. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-header-my-account > a {
        background-color: transparent;
    }

    /* That ring is a border, not a colour — the theme draws it at
       rgba(0,0,0,0.105), which reads grey beside the solid black glyphs. currentColor
       ties it to the icon colour above, so the two can never drift apart again. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-tools-element.wd-design-6 > a > :is(.wd-tools-inner, .wd-tools-icon) {
        border-color: currentColor;
    }

    /* Account a size down: the ring makes it read bigger than the bare glyphs beside
       it. Default is a 42px box with 13px side padding around a 20px glyph, so all
       three shrink together — dropping only the padding would leave an oval. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-header-my-account {
        --wd-tools-sp: 6px;
        --wd-tools-icon-base-width: 14px;
    }

    /* Explicit square rather than letting padding + glyph decide the width, which is
       what left it a rounded rectangle: the ring box is 42px tall by default and its
       width came out wider than that. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-header-my-account > a > :is(.wd-tools-inner, .wd-tools-icon) {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 24px;
        min-width: 24px;
        height: 24px;
        padding: 0;
        border-radius: 50%;
    }

    /* Counter bubble inverted now the icons are white — a dark bubble beside white
       glyphs read as a different icon set. */
    :is(.whb-main-header, .whb-clone) .whb-header-bottom .wd-cart-number {
        background-color: #fff;
        color: #AC2055;
    }
}

/* Announcement text that slides back and forth inside its own box.
   Add `sv-bounce` to the widget in Elementor → Advanced → CSS Classes. The <p> the
   widget renders is what moves, so no extra markup is needed.

   The travel distance is `container width - text width`, expressed with container
   query units: 100cqw is the wrapper, 100% in a translate is the text's own width.
   That one expression covers both cases — text narrower than the box slides across
   the space left over, text wider than the box slides far enough to reveal its tail
   — and `alternate` is what turns a one-way scroll into a bounce. */
.sv-bounce {
    container-type: inline-size;
    overflow: hidden;
}

.sv-bounce > p,
.sv-bounce .sv-bounce__text {
    display: inline-block;
    margin: 0;
    white-space: nowrap;
    animation: sv-bounce-x 9s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes sv-bounce-x {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100cqw - 100%));
    }
}

@media (prefers-reduced-motion: reduce) {
    .sv-bounce > p,
    .sv-bounce .sv-bounce__text {
        animation: none;
    }
}

/* SCRUM-640 #2 — the promo text in the white row bounces across the space the logo
   leaves ("teksti promocional qe levize").

   The column does the clipping and the text element does the moving: they cannot be
   the same box, and the header's text element renders its content directly inside
   itself with no inner wrapper, so there is nothing else to animate. Making the
   column the container-query context also means the travel distance is measured
   against the column, not the viewport, so the text turns around exactly at the
   edges whatever the logo beside it is doing. Reuses the sv-bounce-x keyframes. */
@media (max-width: 1024px) {
    /* The logo column is .whb-mobile-left, which the theme gives `flex: 1 1 0%` — an
       equal share of the row — so the text could not start before the halfway mark.
       Sizing that column to the logo itself hands the rest of the row to the text. */
    /* max-width as well as flex-basis: the theme gives .whb-mobile-left
       `flex: 1 1 0%`, an equal share of the row, which is 200px+ on a phone for a
       140px logo. flex: 0 0 auto sizes it to the logo; the cap means nothing can
       re-inflate it and squeeze the promo text again. */
    .whb-general-header .whb-column_mobile2 {
        flex: 0 0 auto;
        max-width: 150px;
    }

    /* justify-content overrides .whb-mobile-right's flex-end, so the text starts at
       the logo instead of being pushed against the far edge.

       The insets are MARGINS, not padding, and that distinction matters: `overflow`
       clips at the padding box, so overflowing text paints straight through any
       padding and gets cut at the border edge anyway. Margins shrink the clip box
       itself, which is what actually keeps the text off the screen edge — 5px from
       the logo, and flush to the container's own 12px gutter on the right. It also replaces .whb-mobile-right's own
       `margin-left: -10px`, so the gap is one number instead of two fighting. */
    .whb-general-header .whb-column_mobile4 {
        container-type: inline-size;
        justify-content: flex-start;
        flex: 1 1 auto;
        min-width: 0;
        margin-inline: 5px 0;
        overflow: hidden;
    }

    /* The text has to FIT its column, or the bounce just alternates which end gets
       clipped — the tail at one extreme, the first letter at the other. At this size
       the line is narrower than the space the logo leaves, so `100cqw - 100%` comes
       out positive: it slides across the room left over and stays whole throughout.
       A noticeably longer line would clip again; drop the size or shorten the copy. */
    .whb-general-header .whb-column_mobile4 .wd-header-text {
        display: inline-block;
        flex: 0 0 auto;
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
        animation: sv-bounce-x 4s ease-in-out infinite alternate;
        will-change: transform;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whb-general-header .whb-column_mobile4 .wd-header-text {
        animation: none;
    }
}

/* SCRUM-640 #8, via SCRUM-799 — loop card titles occupy two lines, by being made
   short enough to fit them rather than by being clipped to them.

   The shortening happens in functions.php, per section, since how many characters
   make two lines depends on how wide the card is. All this rule does is stop the
   theme clipping a name that has already been made to fit.

   The theme's cap is the one that has to be beaten:

     [class*="title-line-"] .wd-product .wd-entities-title {
         overflow: hidden;
         max-height: calc(var(--title-line-count, 1) * var(--title-line-height, 1.4em));
     }

   Every products grid carries `title-line-two`, which sets that count to 2. Three
   selectors there means four here, and WoodMart injects its part stylesheets after
   this file so a tie would lose.

   min-height holds two lines' worth for short names so they do not ride up, and
   the flex alignment below pushes the price row to the foot of the card so the
   prices line up across a row regardless. Scoped to .product-element-bottom so
   category tiles, which share .wd-entities-title, are left alone. */
.product-element-bottom .wd-entities-title {
    min-height: 2.7em;
    line-height: 1.35;
}

/* No height cap. Two lines is achieved by shortening the name until it fits, in
   functions.php, not by hiding the part that does not — a clipped line reads as a
   rendering fault, and on these products it is the model number that disappears.
   The allowance is per section there, because a card's line count depends on its
   width: 45 characters in a grid card, 32 in the promo block's carousel, whose
   cards are about two-thirds as wide.

   The theme's own cap has to be turned off for that to hold, since it would clip
   at two lines regardless of whether the text had already been made to fit. */
[class*="title-line-"] .wd-product .product-element-bottom .wd-entities-title {
    max-height: none;
    overflow: visible;
}

/* Prices and buttons sit on the same line across a row, whatever the titles above
   them do. Every card is a flex column and the price row is pushed to its foot.
   Keyed to .wd-product, the card itself, rather than to the .wd-products grid:
   carousels have no such wrapper — their cards sit in .wd-carousel >
   .wd-carousel-wrap > .wd-carousel-item — and the card class is on both.

   The chain is flex all the way down, with NO percentage heights. An earlier
   version hung it on `height: 100%`, which silently does nothing when the parent's
   own height is `auto` — a stretched grid item or carousel slide has a used height
   but not a definite one, so the percentage had nothing to resolve against and
   every card fell back to its content height. `flex: 1 1 auto` at each level asks
   for the same thing without needing the parent to have been measured first.

   The theme has its own version of this (woo-opt-stretch-cont) which pushes `.price`
   down with margin-top:auto. It cannot work here: the price now sits inside
   .sv-price-row__price, so it is no longer a flex child of the card, and that rule
   is only wired up at the breakpoints matching the grid's wd-stretch-cont-* class
   — `-lg` alone on these grids, which is desktop only. */
.wd-product {
    display: flex;
    flex-direction: column;
}

.wd-product > .product-wrapper {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.wd-product .product-element-bottom {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

/* Pushes itself and the button row below it to the foot of the card.
   
   The extra .product-wrapper in this selector is load-bearing, not tidiness. The
   theme resets the margins of everything inside a card:

     .wd-product :is(.product-wrapper, .product-element-bottom, …)
       > *:not(:is(.product-element-bottom, .wd-entities-title, [class*="wd-product-"], .price))
       { margin-block: 0 }

   .sv-price-row is not on that exception list — the list names `.price`, which
   used to be the direct child here before the price and button row were built —
   so that rule sets margin-top back to 0. It scores three classes, the same as the
   obvious selector for this, and WoodMart injects its part stylesheets as <link>
   tags inside the markup, so they land after this file and win every tie. Four
   classes settles it without !important. This, not the flex chain, is why the
   prices would not move. */
.wd-product .product-wrapper .product-element-bottom > .sv-price-row {
    margin-top: auto;
}

/* None of the above lines anything up unless the cards are the same height to
   begin with. Grid items stretch by default. Carousel slides do not: the theme
   stretches them only through `.wd-products[class*="wd-stretch-cont"]`, and a
   carousel's wrapper is `.wd-carousel`, not `.wd-products`, so none of those rules
   ever reach it — which is why the promo block was the worst of them. */
.wd-carousel-wrap {
    align-items: stretch;
}

.wd-carousel-item {
    display: flex;
    flex-direction: column;
    height: auto;
}

.wd-carousel-item > .wd-product {
    flex: 1 1 auto;
}

/* Out-of-stock tag, in the price row where the add-to-cart button sits on a card
   that can be bought. Muted red rather than the brand pink: the delivery badge and
   the price already speak in pink, and this has to read as a different kind of
   message — a state, not a promise. */
.sv-oos {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #FDE8E8;
    color: #C81E1E;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .sv-oos {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* ---------------------------------------------------------------------------
   SCRUM-799
   --------------------------------------------------------------------------- */

/* SCRUM-799 #4 — "Blej Tani" and the cart button share the card's last row, with
   the price on the line above. Both add the product to the cart; the filled one
   is simply the treatment that invites the tap, the way Aztech's cards work.

   The icon button keeps the WoodMart classes it already had, so only its position
   changes here — its glyph, loading state and AJAX binding are untouched. */
.sv-buy-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

/* Same story as the price row's margin-top: the theme's `margin-block: 0` reset
   scores three classes and lands after this file, so a one-class rule here would
   have its top margin quietly zeroed and the buttons would sit flush against the
   price. */
.wd-product .product-wrapper .product-element-bottom > .sv-buy-row {
    margin-top: 8px;
}

.sv-buy-row__buy {
    flex: 1 1 auto;
    min-width: 0;
}

.sv-buy-row__cart {
    flex: 0 0 auto;
}

/* The anchor is WooCommerce's own loop button, which arrives carrying `button`.
   Restyling it here rather than adding a class to it keeps the markup identical
   to the one the icon button is built from. */
/* The label truncates rather than spilling out of the card. A loop card can get
   narrow — inside the scroller, or in a 2-column phone grid — and a button that
   overflows its card drags the cart button out of the row with it, which is how
   the crushed best-seller rows came apart. */
.sv-buy-row__buy > a {
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #AC2055;
    border-radius: 4px;
    background-color: #AC2055;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.sv-buy-row__buy > a:hover,
.sv-buy-row__buy > a:focus {
    background-color: #8d1a46;
    border-color: #8d1a46;
    color: #fff;
}

/* WooCommerce marks the button `added`/`loading` during the AJAX round trip and
   WoodMart animates it; the label must stay legible against the fill throughout. */
.sv-buy-row__buy > a.loading,
.sv-buy-row__buy > a.added {
    color: #fff;
    opacity: .75;
}

/* The "View cart" link WooCommerce appends after a successful add would push the
   row apart mid-card. The cart in the header already reports the change. */
.sv-buy-row__buy > a.added ~ .added_to_cart,
.sv-buy-row__cart .added_to_cart {
    display: none;
}

.sv-buy-row__cart.wd-action-btn.wd-style-icon > a {
    width: 38px;
    height: 38px;
    border: 1px solid #AC2055;
    border-radius: 4px;
    color: #AC2055;
}

/* SCRUM-844 #1 — out of stock: the same two buttons, greyed out. The extra class
   outranks the live-button rules above, hover and focus included, so a disabled
   button never lights up on the way past. */
.sv-buy-row--disabled .sv-buy-row__buy > a,
.sv-buy-row--disabled .sv-buy-row__buy > a:hover,
.sv-buy-row--disabled .sv-buy-row__buy > a:focus {
    border-color: #d4d4d4;
    background-color: #d4d4d4;
    color: #fff;
    cursor: not-allowed;
}

.sv-buy-row--disabled .sv-buy-row__cart.wd-action-btn.wd-style-icon > a,
.sv-buy-row--disabled .sv-buy-row__cart.wd-action-btn.wd-style-icon > a:hover {
    border-color: #d4d4d4;
    color: #bdbdbd;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .sv-buy-row {
        gap: 6px;
    }

    .wd-product .product-wrapper .product-element-bottom > .sv-buy-row {
        margin-top: 6px;
    }

    .sv-buy-row__buy > a {
        min-height: 34px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .sv-buy-row__cart.wd-action-btn.wd-style-icon > a {
        width: 34px;
        height: 34px;
    }
}

/* SCRUM-799 #5 — loop card titles set the way Aztech sets them: Poppins, all caps,
   and lighter than the theme's default so the caps do not shout.

   Caps come from text-transform rather than from rewriting the product names,
   which have to stay mixed case everywhere else — the product page, the cart,
   order emails and the admin list all read from the same title. Scoped to
   .product-element-bottom for the same reason as the two-line clamp above it:
   category tiles share .wd-entities-title and are left alone. */
.product-element-bottom .wd-entities-title {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .product-element-bottom .wd-entities-title {
        font-size: 12px;
    }
}

/* SCRUM-799 #2 — the shop archive's "see all" arrow, matching the two on the
   homepage. The markup comes from woodmart_child_seeall_arrow(), which replaces
   the text link the section used to carry.

   Sized to match the homepage arrows exactly: 40px, dropping to 30px on phones,
   which is what those two widgets are set to in Elementor. */
.sv-seeall-icon {
    flex: 0 0 auto;
    line-height: 0;
}

.sv-seeall-icon a {
    display: inline-block;
    line-height: 0;
}

.sv-seeall-icon svg {
    display: block;
    width: 40px;
    height: 40px;
    fill: #AC2055;
}

.sv-seeall-icon a:hover svg,
.sv-seeall-icon a:focus svg {
    fill: #8d1a46;
}

/* Inside the pink strip on phones the arrow goes white, for the same reason as
   the homepage one: pink on pink is invisible. Same 768.98px as the strip. */
@media (max-width: 768.98px) {
    .sv-seeall-icon svg {
        width: 30px;
        height: 30px;
    }

    .elementor-element-a9ff283 .sv-seeall-icon svg {
        fill: #fff;
    }

    .elementor-element-a9ff283 .sv-seeall-icon a:hover svg,
    .elementor-element-a9ff283 .sv-seeall-icon a:focus svg {
        fill: #f3d3df;
    }
}

/* SCRUM-799 #3 — the best-seller blocks become a single row that scrolls
   sideways, drifting right to left on its own and swipeable by hand at any time.

   The manual half of that is what decides the technique: this is a real scroll
   container, so touch, wheel, trackpad, drag and keyboard all move it natively and
   the marquee in assets/js/bestsellers-scroller.js only has to nudge scrollLeft.
   A transform-based track would have had to reimplement every one of those.

   `grid-auto-flow: column` over a single explicit row is what turns WoodMart's flow
   of cards into one line running rightwards, without touching the markup. The
   .sv-scroller class is added in functions.php to the widgets listed in
   woodmart_child_scroller_widgets(). */
.sv-scroller .products {
    /* Columns in view, and the space between them. Overridden per breakpoint
       below; everything else about the track sizing follows from these two. */
    --sv-cols: 6;
    --sv-gap: 20px;

    display: grid;
    grid-auto-flow: column;
    /* One row. Explicit rather than left to the default so the intent is visible:
       with column flow, any extra explicit row would silently start stacking cards
       two-deep again. */
    grid-template-rows: auto;
    /* Mandatory. WoodMart's own .wd-grid-g sets
       `grid-template-columns: repeat(var(--wd-col), minmax(0, 1fr))`, and leaving
       those explicit tracks in place is not a cosmetic detail — with column flow
       the cards fill the six 1fr tracks first, each a sixth of the container, and
       only then start on the auto tracks sized below. The row came out as three
       full-width cards followed by an overflowing tail of narrow ones. Clearing
       the template is what puts every column on grid-auto-columns. */
    grid-template-columns: none;
    /* A definite width, NOT minmax(0, …). Grid tracks shrink to fit their
       container before they overflow it, so a track whose minimum is 0 collapses
       instead of scrolling — twelve columns crushed into a phone rather than two
       and a bit, which is exactly what a max-only track produced here. Giving the
       track one definite size is what forces the overflow the scroller needs. */
    grid-auto-columns: calc((100% - (var(--sv-gap) * (var(--sv-cols) - 1))) / var(--sv-cols));
    gap: var(--sv-gap);
    overflow-x: auto;
    overflow-y: hidden;
    /* Proximity rather than mandatory: mandatory snapping fights the drift, pulling
       the row back to the nearest card faster than it can leave it. */
    scroll-snap-type: x proximity;
    /* The drift writes scrollLeft every frame; smooth scrolling would queue an
       animation against each of those writes. Manual swipe is unaffected. */
    scroll-behavior: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* WoodMart lays its grids out with float and width classes on the cards, sized by
   the wd-products column count. Inside a grid container those do nothing useful and
   the widths fight the tracks, so they are cleared here. */
.sv-scroller .products > .product {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}

/* A horizontal scrollbar under the row reads as a broken layout; the cards
   visibly continue past the edge, and they move by themselves. */
.sv-scroller .products::-webkit-scrollbar {
    display: none;
}

/* Four columns on a desktop width, narrowing to a little over two on a phone so
   the cut-off card at the edge shows there is more to swipe to. */
/* Two on a phone, six on desktop — the counts asked for, and the same as the
   grids these sections are set to in Elementor. */
@media (max-width: 768px) {
    .sv-scroller .products {
        --sv-cols: 2;
        --sv-gap: 12px;
    }
}

/* `sv-scroller--mobile` scrolls on phones and is an ordinary grid above them.
   Rather than guess at what to unset, this restores the exact declarations
   WoodMart's own `.wd-grid-g` makes — grid-template-columns from --wd-col, which
   the widget sets inline per breakpoint — so the section renders as though the
   scroller had never touched it. */
@media (min-width: 769px) {
    .sv-scroller--mobile .products {
        grid-auto-flow: row;
        grid-template-columns: repeat(var(--wd-col), minmax(0, 1fr));
        grid-auto-columns: auto;
        gap: var(--wd-gap-lg, 20px);
        overflow: visible;
    }
}

/* Pagination belongs to a grid that pages; this row scrolls instead. */
.sv-scroller .wd-products-element > .wd-nav-pagination-wrap,
.sv-scroller .products-footer {
    display: none;
}
/* SCRUM-799 #2 — the "see all" arrows beside the two homepage product rows.

   `ee81ec6` sits beside "Produktet më të shitura", `b06c1b4` beside "Të gjitha
   produktet". They stay arrows — the glyph is the point — and only their colour
   changes, because the surface behind them changes.

   Elementor prints the widget's colour into the page's generated CSS at
   `.elementor-14 .elementor-element.elementor-element-<id>.elementor-view-default
   .elementor-icon svg`, five classes deep and loaded after this file, so the two
   properties it sets there are the two that carry !important. `color` goes along
   with `fill` because an icon font renders through the former and an inline SVG
   through the latter, and the widget can emit either. */
:is(.elementor-element-ee81ec6, .elementor-element-b06c1b4) .elementor-icon,
:is(.elementor-element-ee81ec6, .elementor-element-b06c1b4) .elementor-icon svg {
    color: #AC2055 !important;
    fill: #AC2055 !important;
}

/* On phones both homepage headings and their arrows sit inside the brand-pink
   strip, where a pink arrow is invisible against its own background. White is the
   only colour that reads there, and the strip is the only place it is needed —
   above the breakpoint these sit on white and keep the pink arrow set further up.
   Scoped to the strip containers rather than to a width alone, so the colour and
   the strip cannot drift apart if that breakpoint ever moves. */
@media (max-width: 768.98px) {
    :is(.elementor-element-4ae0916, .elementor-element-50c195d) .elementor-icon,
    :is(.elementor-element-4ae0916, .elementor-element-50c195d) .elementor-icon svg {
        color: #fff !important;
        fill: #fff !important;
    }
}

/* SCRUM-799 — the struck-through "was" price is legible.

   The theme paints it --color-gray-300, which is #bbb: about 2.1:1 against white
   and worse again on the promo block's pink, where it was reported as barely
   visible. --color-gray-600 (#666) is the next step in the theme's own scale that
   clears 4.5:1, so the old price stays plainly secondary to the black title and
   the pink sale price without disappearing.

   Two selectors because the theme sets the colour twice, on `.price del` and on
   `del .amount`, each with one class — and WoodMart injects its part stylesheets
   after this file, so matching that count would lose the tie. */
:is(.wd-product, .single-product) .price del,
:is(.wd-product, .single-product) .price del .amount {
    color: var(--color-gray-600, #666);
}

/* SCRUM-850 — the "Nenkategoria" and "Brand" filters scroll like "Kategoria".

   "Kategoria" is WoodMart's own category widget: with the theme's widget scroll
   option on it wraps its list in .wd-scroll / .wd-scroll-content, and
   Theme Settings > Product Archive > Widgets > "Height for filters widgets"
   (widget_heights) emits `max-height: 223px` for that wrapper. The other two are
   core WooCommerce layered-nav widgets, whose list is a bare
   <ul class="woocommerce-widget-layered-nav-list"> with no hook to add those
   classes, so they rendered as one unscrollable list.

   The 223px below mirrors widget_heights (223 at the time of writing) and has to
   be kept in sync by hand whenever that theme option changes.

   On this site the shop sidebar is an Elementor container using WoodMart's
   off-canvas column option: below 1025px the theme's JS adds .wd-side-hidden to
   that container and turns it into a fixed drawer that scrolls itself. The cap
   applies inside that drawer as well, on purpose: "Kategoria" keeps its 223px
   there too, because WoodMart's .wd-scroll-content rule has no breakpoint, and
   the three filters are meant to behave identically.

   The scrollbar colours replicate WoodMart's .wd-scroll rules on the list itself,
   as it has no .wd-scroll ancestor. `scrollbar-width` stays inside the same
   Firefox-only block the theme uses: set in Chromium it switches off the
   ::-webkit-scrollbar styling and the bar would no longer match "Kategoria". */
.e-con > .elementor-widget-wd_sidebar .widget_layered_nav .woocommerce-widget-layered-nav-list {
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 223px;
    padding-inline-end: 5px;
    --scrollbar-track-bg: rgba(0, 0, 0, 0.05);
    --scrollbar-thumb-bg: rgba(0, 0, 0, 0.12);
}

.e-con > .elementor-widget-wd_sidebar .widget_layered_nav .woocommerce-widget-layered-nav-list::-webkit-scrollbar {
    width: 5px;
}

.e-con > .elementor-widget-wd_sidebar .widget_layered_nav .woocommerce-widget-layered-nav-list::-webkit-scrollbar-track {
    background-color: var(--scrollbar-track-bg);
}

.e-con > .elementor-widget-wd_sidebar .widget_layered_nav .woocommerce-widget-layered-nav-list::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg);
}

@-moz-document url-prefix() {
    .e-con > .elementor-widget-wd_sidebar .widget_layered_nav .woocommerce-widget-layered-nav-list {
        scrollbar-width: thin;
    }
}

/* Single product gallery: only arrows that change the photo.

   WoodMart renders two carousels with their own arrows: the main photo
   (.wd-gallery-images, arrows .wd-pos-sep.wd-hover-1) and the thumbnail strip
   (.wd-gallery-thumb, arrows .wd-thumb-nav). The strip's arrows only scroll the
   thumbnails sideways and look dead once the thumbs fit, while the main arrows
   do change the photo but `wd-hover-1` only reveals them while the cursor is
   over the big image, so customers click the wrong pair.

   Everything is scoped to `.single-product .woocommerce-product-gallery`:
   .wd-nav-arrows also drives the best-sellers, related-products and category
   carousels, which must keep their hover behaviour.

   The main arrows' resting state comes from lib-swiper-arrows (desktop only,
   ≥1025px): opacity 0 + pointer-events none on the buttons and a ±30px
   translateX on .wd-prev/.wd-next, undone on container hover. Both are
   neutralised at a higher specificity. No !important, on purpose: WoodMart's
   own `.wd-lock` (nothing to scroll) and `.wd-disabled` (at either end) rules
   keep winning, so a locked arrow stays hidden and a disabled one stays grey.
   A gallery without `wd-has-thumb` has a single image and nothing to navigate,
   so both arrow sets are hidden there outright. */
.single-product .woocommerce-product-gallery .wd-gallery-thumb .wd-nav-arrows.wd-thumb-nav,
.single-product .woocommerce-product-gallery:not(.wd-has-thumb) .wd-nav-arrows {
    display: none;
}

.single-product .woocommerce-product-gallery .wd-gallery-images .wd-nav-arrows.wd-hover-1.wd-pos-sep .wd-btn-arrow {
    opacity: 1;
    pointer-events: auto;
}

.single-product .woocommerce-product-gallery .wd-gallery-images .wd-nav-arrows.wd-hover-1.wd-pos-sep .wd-btn-arrow.wd-prev,
.single-product .woocommerce-product-gallery .wd-gallery-images .wd-nav-arrows.wd-hover-1.wd-pos-sep .wd-btn-arrow.wd-next {
    transform: none;
}
