/*
 * Custom overrides for the Petpal-based template, layered on top of
 * templateAssets/css/main.css (and main.rtl.css). Keep this file loaded
 * LAST in layout.jinja so its rules win the cascade.
 */

/*
 * row-cols-* doesn't exist anywhere in this project's Bootstrap build -
 * it's Bootstrap 4 (confirmed via its --breakpoint-* custom properties),
 * and row-cols is a Bootstrap 5 feature. category-section.jinja's
 * `row-cols-2 row-cols-sm-3 row-cols-md-4 row-cols-lg-6` does nothing at
 * all as a result, so its 6 category items never wrap into a responsive
 * grid - on mobile they all try to fit in one row and overflow past the
 * viewport edge. Implemented with the same formula Bootstrap 5 itself uses
 * (width: 100% / N), for exactly the variants used in this theme.
 */
.row-cols-2 > * {
    flex: 0 0 auto;
    width: 50%;
}
@media (min-width: 576px) {
    .row-cols-sm-3 > * {
        flex: 0 0 auto;
        width: 33.3333%;
    }
}
@media (min-width: 768px) {
    .row-cols-md-4 > * {
        flex: 0 0 auto;
        width: 25%;
    }
}
@media (min-width: 992px) {
    .row-cols-lg-6 > * {
        flex: 0 0 auto;
        width: 16.6667%;
    }
}

/*
 * .footer__shape-wrap img is position:absolute, meant to sit in the
 * footer's bottom corners - but neither .footer__area nor any ancestor up
 * to <html> has position:relative, so it has no positioned containing
 * block and falls back to the (viewport-sized) initial containing block
 * instead. Result: the decorative paw shapes render ~1 viewport-height down
 * from the very TOP of the page, nowhere near the actual footer (verified:
 * on a 2596px page with the footer starting at 2008px, the shape rendered
 * at 732px). Anchoring the footer itself fixes it.
 */
.footer__area {
    position: relative;
}

/*
 * footer.jinja's logistics-pay-icons (shipping/payment method icons, ported
 * from components/footer-store-section.jinja) has no styling anywhere in
 * this theme - each logo's own source image is a different shape (Tabby's
 * wide pill, Mastercard/Visa/mada's circular badges, Apple Pay's dark
 * rounded box...), so with no chrome of their own they sat directly on the
 * footer's dark background at wildly inconsistent sizes with no shared
 * visual rhythm. A uniform white rounded "chip" behind each one gives every
 * logo the same footprint regardless of its own image's shape/aspect ratio.
 */
.logistics-pay-icons {
    gap: 10px;
}

@media (max-width: 767px) {
.logistics-pay-icons {
    justify-content: center !important;
}
}
.logistics-pay-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 10px;
    background: var(--tg-color-white-default, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.logistics-pay-icons a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.logistics-pay-icons img {
    height: 20px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/*
 * .section-padding-space / .section-slider-padding-space / .slider-container
 * are only defined in assets/main.css (disabled since the Petpal redesign),
 * yet most sections (features-section, cards-slider-section,
 * category-products-section, partners, ggallery, products-section,
 * testimonials via .section-slider-padding-space) use them for their outer
 * top/bottom spacing. Without them, sections butt up directly against each
 * other with zero gap. Ported forward as-is.
 */
.section-padding-space {
    padding-top: 30px;
    padding-bottom: 30px;
}

.section-slider-padding-space {
    padding-top: 15px;
    padding-bottom: 15px;
}

.home > .section-padding-space:first-child {
    padding-top: 0;
}

.slider-container {
    padding-left: 15px;
    padding-right: 15px;
}

/*
 * .section-title (the heading used by features-section, cards-slider-section,
 * category-products-section, partners, ggallery, products-section,
 * testimonials) is likewise only defined in the disabled stylesheets, so
 * there's currently no gap at all between a section's title and its content.
 * Ported forward, plus a bit more breathing room below than the original
 * 15px given how much content typically sits directly under it here.
 */
.section-title {
    font-size: 2.271rem;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 25px;
}
/* Used as the main heading by nearly every section in this theme (see the
   list above) - 2.271rem (~36px) reads fine on a full-width desktop
   section but is oversized on a phone screen, where every section ported
   that same desktop size with no mobile scaling at all. */
@media (max-width: 767.98px) {
    .section-title {
        font-size: 1.4rem;
    }
}

/*
 * .box-1-1 (the padding-top aspect-ratio-box trick giving an image a default
 * height without an explicit pixel value) was only ever defined in
 * assets/custom.css, disabled since the Petpal redesign. Without it, every
 * .box-1-1 usage - sections/ggallery.jinja, templates/product.jinja,
 * templates/categories.jinja - has no height at all unless a custom height
 * is explicitly set, and renders as an invisible 0-height box. Ported
 * forward as-is.
 */
.box-1-1 {
    position: relative;
    width: 100%;
}

.box-1-1:before {
    content: "";
    display: block;
    /* overridable per-instance via style="--box-ratio: X%" (e.g. ggallery.jinja
       sizing a full-width banner item shorter than a square) */
    padding-top: var(--box-ratio, 100%);
}

.box-1-1 .content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.box-1-1.ratio2_1:before {
    padding-top: 50%;
}
.box-1-1.ratio1_2:before {
    padding-top: 200%;
}
.box-1-1.ratio4_3:before {
    padding-top: 75%;
}
.box-1-1.ratio16_9:before {
    padding-top: 56.25%;
}
.box-1-1.ratio21_9:before {
    padding-top: 42.85%;
}

/*
 * .features__icon only has sizing rules for an inline <svg> (the original
 * demo injected small hand-authored icon SVGs via SVGInject) - our
 * features-section.jinja uses an uploaded <img> instead, which has no size
 * constraint at all and would render at whatever size the source image
 * happens to be.
 */
.features__icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/*
 * features-section.jinja's .col-xl-3/.col-lg-4/.col-sm-6 grid only becomes a
 * multi-up grid at 576px+ - below that (true mobile, no sm/lg/xl override
 * applies) each column is Bootstrap's own unconditional width:100%, so
 * .features__item - a bare flex row with no background/border/padding of
 * its own - stretched full width while the icon+text group inside only took
 * its own content size, hugging one edge with a large empty gap to the
 * other. Give it real card chrome, but ONLY at that same full-width
 * breakpoint - at sm+ the grid already packs items into narrow columns
 * side by side, where the plain original look (no card, no icon badge) is
 * correct and shouldn't change.
 */
@media (max-width: 575.98px) {
    .features__item {
        justify-content: space-between;
        background: var(--tg-color-white-default, #fff);
        border: 1px solid var(--secondary-color-alt7, #ebebeb);
        border-radius: 16px;
        padding: 16px 18px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
        transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    }
    .features__item:hover {
        border-color: var(--tg-theme-primary, #894B8D);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
        transform: translateY(-3px);
    }
    .features__content {
        flex: 1;
    }
    .features__icon {
        flex-shrink: 0;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(137, 75, 141, 0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s ease;
    }
    .features__icon img {
        width: 28px;
        height: 28px;
    }
    .features__item:hover .features__icon {
        background: var(--tg-theme-primary, #894B8D);
    }
    .features__item:hover .features__icon img {
        filter: brightness(0) invert(1);
    }
}

/*
 * spinner.gif's own file is 320x320 - the width/height="14" HTML attributes
 * on <img class="add-to-cart-progress"> should be enough on their own, but
 * pin it in CSS too so its real (huge) intrinsic size can never win out.
 */
.product-card-add-to-cart .add-to-cart-progress {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/*
 * Neither bootstrap.min.css nor bootstrap-rtl.css in this project ships the
 * .offcanvas component's CSS at all (both predate it / are custom builds
 * without it) - only templateAssets/js/bootstrap.bundle.min.js's JS side is
 * present. Without this, #shoppingCart (components/cart-sidebar.jinja) has
 * no fixed position/hidden state/transition at all, so it just renders as a
 * plain block in normal page flow (showing under the footer) instead of a
 * hidden drawer that slides in on click. Recreated from scratch here.
 */
.offcanvas {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    color: inherit;
    visibility: hidden;
    background-color: var(--tg-color-white-default, #fff);
    outline: 0;
}

.offcanvas.offcanvas-end {
    inset-inline-end: 0;
    width: 400px;
    transform: translateX(100%);
}

[dir="rtl"] .offcanvas.offcanvas-end {
    transform: translateX(-100%);
}

.offcanvas.showing,
.offcanvas.hiding {
    transition: transform 0.3s ease-in-out;
}

.offcanvas.show:not(.hiding),
.offcanvas.showing {
    transform: translateX(0);
}

.offcanvas.showing,
.offcanvas.hiding,
.offcanvas.show {
    visibility: visible;
}

.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.offcanvas-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.offcanvas-backdrop.show {
    opacity: 0.5;
}

/*
 * Bootstrap's reboot styles every <a> without an href (buttons styled as
 * links, e.g. onclick-driven "add to cart") back to color: inherit on
 * hover/focus:
 *
 *   a:not([href]):not([tabindex]):hover,
 *   a:not([href]):not([tabindex]):focus {
 *     color: inherit;
 *     text-decoration: none;
 *   }
 *
 * That selector's specificity (0,3,1) beats .btn:hover (0,2,0) from
 * main.css, so any href-less .btn anchor (e.g. .product-card-add-to-cart)
 * loses its intended white hover color back to whatever it inherits.
 * Re-declare the same selector shape at matching specificity - loaded
 * after bootstrap.min.css - so our color wins instead of Bootstrap's.
 */
a.btn:not([href]):hover,
a.btn:not([href]):focus {
    color: var(--tg-color-white-default, #fff);
}

/*
 * product-card.jinja's wishlist toggle needs to look and behave like
 * Petpal's own .product__action icons (white circle, centered glyph,
 * hidden until the card is hovered, inverts color on its own hover) -
 * main.css only styles all of that for `.product__action a`, an
 * element-specific selector that skips the <button> elements the real
 * wishlist toggle uses for its logged-in states. Mirror the same rules
 * for buttons so both look and behave identically.
 */
.product__action .wishlist-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tg-color-white-default, #fff);
    font-size: 18px;
    line-height: 0;
    border: none;
    color: #A1A0A9;
    transform: translateX(20px);
    transition: visibility 0.3s ease-out 0.1s, opacity 0.3s ease-out 0.15s, transform 0.3s ease-out 0.1s;
    transition-delay: 0.1s;
    opacity: 0;
}

.product__action .wishlist-btn.filled {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
    border-color: var(--tg-theme-primary, #894B8D);
}

.product__item:hover .product__action .wishlist-btn {
    opacity: 1;
    transform: translateX(0);
}

.product__action .wishlist-btn:hover {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}

/*
 * product-card.jinja (moved out of an inline <style> block there, since it
 * was re-declared once per card in the DOM - one copy here covers every
 * instance of the component instead).
 */

/* main.css only gives .product__item a bottom margin - no border/box
   around the card at all. Add one so cards read as distinct tiles
   instead of image+content floating loose in the grid. */
.product__item {
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 15px;
    padding: 12px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.product__item:hover {
    border-color: var(--tg-theme-primary, #894B8D);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* A card with a rating shows an extra .product__reviews row that a card
   without one doesn't, so same-row cards ended up visibly different
   heights - main.css never gives .product__item a floor to grow to, nor
   pushes .price down to compensate. A fixed min-height (rather than
   height:100% of the grid cell) works regardless of whether the parent
   row/swiper actually stretches its children, and .price still lands at a
   consistent bottom edge below that height via margin-top:auto. */
.product__item {
    min-height: 355px;
    display: flex;
    flex-direction: column;
}
.product__item .product__thumb {
    flex-shrink: 0;
}
.product__item .product__content {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product__item .product__content .price {
    margin-top: auto;
}

/* product-card.jinja always renders .product__reviews when reviews are
   enabled store-wide, but only fills it with stars/count when the product
   actually has a rating (product.rating) - a product with none gets an
   empty, contentless div. main.css never gives that div a height of its
   own, so it collapses to 0px when empty vs ~20px+ when it holds star
   icons, and cards in the same row (particularly on the Swiper sliders,
   which - per the min-height note above - don't reliably stretch to a
   shared height like a Bootstrap grid row does) end up with different
   title/price positions depending on whether that one product happens to
   have a rating yet. Reserve the same height whether it's empty or not. */
.product__reviews {
    min-height: 20px;
}

/* .product__thumb img only has width:100% in main.css, so real product
   photos (arbitrary aspect ratios) render at whatever height matches
   their own shape, making cards in the same row uneven. Force a fixed
   square thumbnail instead. */
.product__thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* .sale-wrap is pinned to a single fixed top:20px/left:20px spot in
   main.css, meant for exactly one badge. Stack multiple badge lines
   vertically inside it instead of letting them overlap, and push the
   whole group down when the real sale/new badge is also showing there. */
.product__thumb .sale-wrap.product-card-extra-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.product__thumb .sale-wrap.product-card-extra-badges.has-primary-badge {
    top: 56px;
}

/*
 * Products listing page (templates/products.jinja): the filter/sort bar
 * (components/products-filter.jinja) and its price-filter panel
 * (components/products-filter-form.jinja) use none of the Petpal classes -
 * .btn-filter, .filter-block-width, .select-dropdown, .custom-checkbox-input,
 * .btn.round - none of them exist anywhere in main.css, so they were falling
 * back to bare Bootstrap defaults (plain gray-bordered buttons, a native
 * unstyled dropdown/checkbox). Give them the same look as the rest of the
 * theme instead.
 */
.products-filter {
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}
.products-filter .filter-buttons-container {
    gap: 16px;
    align-items: flex-end;
}
.products-filter .filter-result,
.products-filter .filter-order {
    font-size: 12px;
    color: var(--tg-body-color, #6a6a6a);
    margin-bottom: 6px;
}
/*
 * .btn-filter reuses the theme's generic .btn class for its base shape
 * (pill radius, flex layout), but .btn is really meant for solid
 * call-to-action buttons: it ships its own colored fill AND a `::before`
 * pseudo-element - a full-size circle in --tg-theme-secondary, parked just
 * below the button (top:110%) - that sweeps up to cover it on :hover/:focus
 * (main.css's `.btn:hover, .btn:focus-visible { background: ... }` and
 * `.btn:hover:before { top: -40% }`). None of that is disabled by a plain
 * `.btn-filter:hover { color: ... }` override, since it never touches
 * `background` or the pseudo-element - so hovering a filter/sort pill
 * showed the leftover CTA sweep (secondary-color fill) together with this
 * rule's own purple text, instead of the intended plain border/text change.
 * Filter/sort toggles aren't calls to action, so kill the sweep entirely.
 */
.products-filter .btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid #DDD;
    border-radius: 30px;
    background: var(--tg-color-white-default, #fff);
    color: var(--tg-body-color, #222);
    font-weight: 600;
    line-height: 1;
    overflow: visible;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}
/*
 * The desktop "Filter" button also carries `d-none d-lg-block` to toggle
 * against the mobile collapse button - Bootstrap's `.d-lg-block` is
 * `display: block !important`, which beats this rule's own `inline-flex`
 * regardless of selector specificity (!important always wins over a normal
 * declaration). Forced to block, the button's own trailing "&nbsp;&nbsp;"
 * text node - which used to sit right after it inline - gets pushed onto a
 * phantom extra line below it instead (block-level elements always start/end
 * a line even inside an inline-block parent). That made the "Filter" group
 * ~30px taller than the "Sort by" group next to it, and since they're
 * bottom-aligned (`align-items: flex-end`), the shorter "Sort by" group's
 * whole row - label included - rendered 30px lower, reading as if the two
 * had wrapped onto separate lines even though flex-wrap was never involved.
 * Match .d-lg-block's own !important so this rule can actually win at lg+.
 */
.products-filter .btn-filter.d-lg-block {
    display: inline-flex !important;
}
.products-filter .btn-filter::before {
    display: none;
}
.products-filter .btn-filter:hover,
.products-filter .btn-filter:focus,
.products-filter .btn-filter:focus-visible {
    background: var(--tg-color-white-default, #fff);
    border-color: var(--tg-theme-primary, #894B8D);
    color: var(--tg-theme-primary, #894B8D);
}
.products-filter #product-filter-count {
    color: var(--tg-theme-primary, #894B8D);
}
.products-filter .dropdown-menu.select-dropdown {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 200px;
}
.products-filter .dropdown-menu.select-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.products-filter .dropdown-menu.select-dropdown .dropdown-item:hover {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}

/* components/products-filter.jinja marks whichever sort mode matches the
   current URL params with .active (the button's own label already showed
   this, the dropdown's own items never did) - a light tint distinguishes
   "currently selected" from the stronger solid :hover state above without
   competing with it. */
.products-filter .dropdown-menu.select-dropdown .dropdown-item.active {
    background: var(--primary-color-op-5, rgba(137, 75, 141, 0.08));
    color: var(--tg-theme-primary, #894B8D);
    font-weight: 600;
}
.products-filter .dropdown-menu.select-dropdown .dropdown-item.active:hover {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}

/* filter modal (desktop "Filter" button) - default Bootstrap modal has
   square corners and no padding rhythm of its own. */
#filterModal .modal-content {
    border: none;
    border-radius: 20px;
    padding: 30px;
}
#filterModal #products-list-filter-form-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
}

/* price-filter panel (components/products-filter-form.jinja) */
.form-products-filter .form-control {
    border-radius: 10px;
    padding: 10px 15px;
}
.form-products-filter .form-control:focus {
    border-color: var(--tg-theme-primary, #894B8D);
    box-shadow: 0 0 0 0.15rem rgba(137, 75, 141, 0.15);
}
.form-products-filter label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: inline-block;
}
.btn-sale-price {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid #DDD;
    border-radius: 30px;
    cursor: pointer;
}
/* .checkbox-container/.custom-checkmark implement a standard "hide the real
   checkbox, draw a styled box that reacts to its :checked state" pattern -
   the markup already existed, only the CSS driving it never did, so the box
   itself and its checked state were both entirely invisible. */
.checkbox-container {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}
.custom-checkbox-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.custom-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--tg-color-white-default, #fff);
    border: 1px solid #DDD;
    border-radius: 5px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.custom-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--tg-color-white-default, #fff);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.custom-checkbox-input:checked ~ .custom-checkmark {
    background: var(--tg-theme-primary, #894B8D);
    border-color: var(--tg-theme-primary, #894B8D);
}
.custom-checkbox-input:checked ~ .custom-checkmark:after {
    display: block;
}
.btn.round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    font-weight: 600;
    border: 1px solid transparent;
}
.btn.round.btn-white {
    background: var(--tg-color-white-default, #fff);
    border-color: #DDD;
    color: var(--tg-body-color, #222);
}
.btn.round.btn-white:hover {
    border-color: var(--tg-theme-primary, #894B8D);
    color: var(--tg-theme-primary, #894B8D);
}
.btn.round.primary {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}
.btn.round.primary:hover {
    opacity: 0.9;
    color: var(--tg-color-white-default, #fff);
}

/*
 * .breadcrumb-separator's flaticon-right-arrow-angle glyph points right by
 * default (correct for LTR: "Home > Category" reads left-to-right, deeper
 * pages sit to the right) - main.rtl.css carries this rule over completely
 * unchanged from main.css, since rtlcss only mirrors positional properties
 * and there's no transform here to mirror. In RTL, breadcrumbs read
 * right-to-left (deeper pages sit to the LEFT of "الرئيسية"), so the arrow
 * needs to point left instead - same fix already applied to the testimonial
 * nav buttons and pagination arrows for the same underlying reason.
 */
[dir="rtl"] .breadcrumb-separator i {
    display: inline-block;
    transform: rotate(180deg);
}

/*
 * .product-button-prev/.product-button-next (products-section.jinja,
 * category-products-section.jinja, and templates/product.jinja's
 * related-products swiper) get mirrored positions for RTL via
 * main.rtl.css - prev moves to the right edge, next to the left, matching
 * RTL reading order - but same story as the breadcrumb arrow above: their
 * flaticon glyphs keep pointing whichever way they did for LTR, since
 * rtlcss only mirrors positional properties, not this icon choice. Both
 * icons already point correctly for LTR (prev=left chevron on the left,
 * next=right arrow on the right), so only the RTL case needs flipping.
 */
[dir="rtl"] .product__nav-wrap button.product-button-prev i,
[dir="rtl"] .product__nav-wrap button.product-button-next i {
    display: inline-block;
    transform: rotate(180deg);
}

/*
 * .category__area .category__item's card design (sections/category-section.jinja,
 * templates/categories.jinja) is used by both the homepage category row and
 * the standalone "all categories" listing page - moved here (was previously
 * duplicated in category-section.jinja's own <style> block) so both share
 * one definition. Real category photos come in arbitrary sizes/ratios -
 * force them into the small square thumbnail this card expects instead of
 * rendering at their native (often huge/portrait) size.
 */
.category__area .category__item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/*
 * templates/category.jinja's breadcrumb hero shows the real category
 * description under the title/breadcrumb trail - main.css's breadcrumb__area
 * never needed this (products.jinja/categories.jinja have no per-item
 * description to show), so there's no rule for it at all.
 */
.breadcrumb__area .breadcrumb__des {
    margin-top: 15px;
    margin-bottom: 0;
    max-width: 700px;
    color: var(--tg-body-color, #6a6a6a);
}

/*
 * 404_not_found.jinja's "Go to Home" button icon (right_arrow.svg) points
 * right by default - correct for LTR (forward = right), but in RTL forward
 * reads right-to-left, so the arrow needs to point left instead. Same
 * left/right-vs-transform:rotate gap rtlcss can't fix on its own, already
 * hit for the category "view all" arrow, testimonials nav, and pagination.
 */
[dir="rtl"] .error__content .btn img.injectable {
    display: inline-block;
    transform: scaleX(-1);
}
/* the restored auto-redirect countdown message had no styling of its own */
.error__content .redirect-message {
    margin-top: 20px;
    margin-bottom: 0;
    font-size: 14px;
    color: var(--tg-body-color, #6a6a6a);
    text-transform: none;
}
.error__content .redirect-message #redirectCountdown {
    font-weight: 700;
    color: var(--tg-theme-primary, #894B8D);
}

/*
 * .tf-mini-cart-remove (cart-sidebar.jinja) has no CSS anywhere in this
 * theme - it rendered as plain unstyled text before, and swapping that text
 * for a trash icon needs its own size/color/hover treatment.
 */
.tf-mini-cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: #A1A0A9;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}
.tf-mini-cart-remove:hover {
    background: #FBEAEA;
    color: #E74C3C;
}

/*
 * assets/cart.css (dedicated to templates/cart.jinja) styles several key
 * elements - the "Products"/"Total summary" headings, the total row's price,
 * the coupon form heading, the free-shipping message - via
 * `var(--primary-color)`. Nothing defines that custom property in this
 * theme's active CSS, so an unresolvable var() silently dropped the intended
 * brand-purple accent. Alias it to --tg-theme-primary, which layout.jinja
 * maps to the merchant's real brand color, instead of rewriting every rule
 * in cart.css.
 */
:root {
    --primary-color: var(--tg-theme-primary, #894B8D);
}

/*
 * .btn-primary/.btn-outline-primary (Bootstrap's own classes, used for
 * "continue shopping"/the gift-card toggle/cart_loyalty_points_widget.jinja's
 * "استخدم" redemption button) have no theme override anywhere - Bootstrap's
 * own primary color is blue, clashing with the theme's brand color
 * everywhere else on the page.
 */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--tg-theme-primary, #894B8D);
    color: var(--tg-theme-primary, #894B8D);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--tg-theme-primary, #894B8D);
    border-color: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}

/*
 * !important here specifically because cart_loyalty_points_widget.jinja's
 * own "استخدم" button reuses this exact .btn.btn-primary class - whatever
 * ships it (or the vitrin: loyalty/bank-discounts widgets alongside it)
 * very likely injects its own !important override for .btn-primary to make
 * that one button look right by default, and with no !important of our own
 * that leaked onto every OTHER .btn-primary on the same page (checkout,
 * coupon submit, continue shopping) the moment one of those widgets was
 * present - hence "buttons only look right when the widget isn't there".
 */
.btn-primary {
    background: var(--tg-theme-primary, #894B8D) !important;
    border-color: var(--tg-theme-primary, #894B8D) !important;
    color: var(--text-color-primary-bg, #fff) !important;
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--tg-theme-primary, #894B8D) !important;
    border-color: var(--tg-theme-primary, #894B8D) !important;
    filter: brightness(0.92);
    color: var(--text-color-primary-bg, #fff) !important;
}
.btn-primary:disabled,
.btn-primary.disabled {
    background: var(--tg-theme-primary, #894B8D) !important;
    border-color: var(--tg-theme-primary, #894B8D) !important;
    opacity: 0.5;
}

/*
 * templates/cart.jinja's product table + summary panel (.tf-table-page-cart,
 * .tf-page-cart-footer, .wg-quantity, .tf-free-shipping-bar, .tf-btn...) -
 * none of these classes exist anywhere in this theme's CSS, so the whole
 * thing needs styling from scratch.
 */
.tf-page-cart-wrap {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}
.tf-page-cart-item {
    flex: 1 1 0;
    min-width: 0;
}
.tf-page-cart-footer {
    flex: 0 0 360px;
    width: 360px;
}
@media (max-width: 991.98px) {
    .tf-page-cart-wrap {
        flex-direction: column;
    }
    .tf-page-cart-footer {
        width: 100%;
    }
}

/* product table */
.tf-table-page-cart {
    width: 100%;
    border-collapse: collapse;
}
.tf-table-page-cart thead tr {
    background: var(--secondary-color-alt8, #f7f5f8);
}
.tf-table-page-cart thead th {
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-body-color, #6a6a6a);
    text-align: start;
}
.tf-table-page-cart thead th.text-center {
    text-align: center;
}
.tf-table-page-cart tbody tr {
    border-bottom: 1px solid var(--secondary-color-alt7, #ebebeb);
}
.tf-table-page-cart tbody td {
    padding: 16px 12px;
    vertical-align: middle;
    text-align: center;
}
.tf-table-page-cart .tf-cart-item_product {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: start;
}
.tf-table-page-cart .img-box {
    flex-shrink: 0;
    display: block;
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
}
.tf-table-page-cart .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tf-table-page-cart .cart-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.tf-table-page-cart .cart-title {
    font-weight: 600;
    color: var(--tg-heading-color, #17151b);
}
.tf-table-page-cart .cart-title:hover {
    color: var(--tg-theme-primary, #894B8D);
}
.tf-table-page-cart .remove-cart {
    font-size: 13px;
    color: #A1A0A9;
    cursor: pointer;
}
.tf-table-page-cart .remove-cart:hover {
    color: #E74C3C;
}
.tf-table-page-cart .cart-product-total-before-price {
    display: block;
    color: #A1A0A9;
    font-size: 0.85em;
}

/* quantity stepper - also used, unstyled until now, by components/cart-sidebar.jinja */
.wg-quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 30px;
    padding: 8px 14px;
}
.wg-quantity .btn-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tg-body-color, #6a6a6a);
}
.wg-quantity .btn-quantity:hover {
    color: var(--tg-theme-primary, #894B8D);
}
.wg-quantity input {
    width: 26px;
    border: none;
    text-align: center;
    padding: 0;
}

/* free-shipping progress bar */
.tf-free-shipping-bar {
    margin-bottom: 24px;
}
.tf-progress-bar {
    position: relative;
    height: 6px;
    border-radius: 30px;
    background: var(--secondary-color-alt7, #ebebeb);
    margin-bottom: 12px;
}
.tf-progress-bar > span {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 30px;
    background: var(--tg-theme-primary, #894B8D);
    transition: width 0.3s ease;
    min-width: 6px;
}
.tf-progress-bar .progress-car {
    position: absolute;
    inset-inline-end: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
}
[dir="rtl"] .tf-progress-bar .progress-car svg {
    transform: scaleX(-1);
}
.tf-progress-msg {
    font-size: 14px;
    color: var(--tg-body-color, #6a6a6a);
    text-align: center;
}
.tf-progress-msg .price {
    color: var(--tg-theme-primary, #894B8D);
}

/* summary / checkout panel */
.tf-page-cart-checkout {
    background: var(--tg-color-white-default, #fff);
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 16px;
    padding: 24px;
}
.shipping-calculator-title {
    font-size: 1.4rem;
    margin: 0 0 20px;
}
#cart-summary .tf-cart-totals-discounts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--secondary-color-alt7, #ebebeb);
    font-size: 0.9rem;
}
#cart-summary .tf-cart-totals-discounts:last-child {
    border-bottom: none;
}
#cart-summary .tf-cart-totals-discounts h3 {
    margin: 0;
    font-size: inherit;
    font-weight: 400;
}
#cart-summary .tf-cart-totals-discounts .total-value {
    white-space: nowrap;
    color: var(--tg-theme-primary, #894B8D);
}
#cart-summary .tf-cart-totals-discounts.cart-total-row {
    font-size: 1.1rem;
}
#cart-summary .tf-cart-totals-discounts.cart-total-row h3 {
    font-weight: 700;
}

/* coupon form: joined pill-shaped input+button */
.tf-page-cart-checkout .coupon-form h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}
.tf-page-cart-checkout .coupon-form input.send-coupon {
    border-radius: 30px 0 0 30px;
    border-color: #DDD;
}
[dir="rtl"] .tf-page-cart-checkout .coupon-form input.send-coupon {
    border-radius: 0 30px 30px 0;
}
.tf-page-cart-checkout .coupon-form button {
    border-radius: 0 30px 30px 0;
    background: var(--tg-theme-primary, #894B8D);
    border-color: var(--tg-theme-primary, #894B8D);
    margin-left: 0 !important;
    margin-right: 0 !important;
}
[dir="rtl"] .tf-page-cart-checkout .coupon-form button {
    border-radius: 30px 0 0 30px;
}

/* .tf-btn is a brand-new class (the "Purchase" button) with no styling
   anywhere - give it the same pill/CTA look as the rest of the theme's
   buttons (main.css's .btn), since it isn't (and can't easily be, given its
   own distinct class name) just an alias for that class. */
.tf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 100px;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 600;
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
    border: none;
    transition: opacity 0.3s ease;
}
.tf-btn:hover {
    opacity: 0.9;
    color: var(--tg-color-white-default, #fff);
}
.tf-btn.btn-disabled {
    background: #ccc;
    cursor: not-allowed;
}
@media (max-width: 767.98px) {
    .tf-table-page-cart thead {
        display: none;
    }
    .tf-table-page-cart, .tf-table-page-cart tbody, .tf-table-page-cart tr, .tf-table-page-cart td {
        display: block;
        width: 100%;
    }
    .tf-table-page-cart tbody tr {
        padding: 16px 0;
    }
    .tf-table-page-cart tbody td {
        text-align: start;
        padding: 8px 0;
    }
    .tf-table-page-cart .tf-cart-item_quantity,
    .tf-table-page-cart .tf-cart-item_price,
    .tf-table-page-cart .tf-cart-item_total {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .tf-table-page-cart [cart-data-title]::before {
        content: attr(cart-data-title);
        font-weight: 600;
        color: var(--tg-body-color, #6a6a6a);
    }
}

/*
 * .btn-block ("continue shopping", the gift-card toggle) was removed
 * entirely in Bootstrap 5 (replaced by .d-grid/.w-100) - this project's
 * bootstrap.rtl.min.css confirms it's gone (checked directly, zero matches).
 * "Purchase" above it already uses BS5's own .w-100 and renders full-width
 * correctly, which is exactly why "continue shopping" looked stuck at its
 * own content width right next to it: the class meant to do the same thing
 * for it never existed in this Bootstrap version.
 */
.btn-block {
    display: block;
    width: 100%;
}

/* templates/cart.jinja: the "Purchase"/"continue shopping" block had no
   spacing of its own from the coupon form directly above it. */
.cart-checkout-btn {
    margin-top: 24px;
}

/*
 * The empty-cart icon (.icon-shopping_cart_black_36dp-1-1) is a real,
 * working icomoon glyph, but both of its color layers are hardcoded to
 * white (icomoon.css's own .path1/.path2 rules) - meant to sit on a colored
 * badge background, not directly on this page's white background, where
 * it's simply invisible. .theme-title-primary (meant to recolor it) doesn't
 * exist anywhere either. Swapped for a plain, reliably-visible FontAwesome
 * icon instead of fighting the old icon's hardcoded colors.
 */
.cart-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(137, 75, 141, 0.08);
    color: var(--tg-theme-primary, #894B8D);
    font-size: 44px;
    margin-bottom: 10px;
}

/*
 * templates/shipping_payment.jinja was a leftover from the pre-Petpal theme:
 * a dashboard-style page (account-pages.css/shipping-section.css) with a
 * plain gray header bar and a big flat-purple vertical sidebar of tabs -
 * nothing here shares any class with the rest of the (Petpal-based) theme.
 * Rebuilt as a simple pill tab-nav + card content, matching every other
 * page's look, so all of this is fresh CSS rather than ported from anywhere.
 */
.shipping-payment-tabs {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.shipping-payment-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 30px;
    background: var(--tg-color-white-default, #fff);
    color: var(--tg-body-color, #6a6a6a);
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.shipping-payment-tabs .nav-link:hover {
    border-color: var(--tg-theme-primary, #894B8D);
    color: var(--tg-theme-primary, #894B8D);
}
.shipping-payment-tabs .nav-link.active {
    background: var(--tg-theme-primary, #894B8D);
    border-color: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}

/* shipping method cards */
.shipping-method-card {
    background: var(--tg-color-white-default, #fff);
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 20px;
}
.shipping-method-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--secondary-color-alt7, #ebebeb);
}
.shipping-method-head img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}
.shipping-method-head h4 {
    margin: 0;
    font-size: 1.1rem;
}
.shipping-method-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--secondary-color-alt7, #ebebeb);
}
.shipping-method-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.shipping-method-row .label {
    flex: 0 0 180px;
    font-weight: 600;
    color: var(--tg-heading-color, #17151b);
}
.shipping-method-row .value {
    flex: 1 1 0;
    min-width: 200px;
    color: var(--tg-body-color, #6a6a6a);
}
.shipping-method-row .cost-line {
    display: flex;
    gap: 6px;
}
.shipping-method-row .cost-line strong {
    color: var(--tg-theme-primary, #894B8D);
}
.shipping-method-row .link-more {
    background: none;
    border: none;
    padding: 0;
    color: var(--tg-theme-primary, #894B8D);
    text-decoration: underline;
    cursor: pointer;
}

/* covered-cities modal */
.shipping-cities-modal .modal-content {
    border: none;
    border-radius: 20px;
    padding: 10px;
}
.shipping-cities-modal .modal-header {
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* .close (this modal's dismiss "×" button) is a Bootstrap 4 class with no
   BS5 equivalent styling at all here - completely bare otherwise. */
.shipping-cities-modal .modal-header .close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: var(--tg-body-color, #6a6a6a);
}
.shipping-cities-modal .modal-header .close:hover {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
}
.shipping-cities-modal .form-element {
    position: relative;
    margin-bottom: 16px;
}
.shipping-cities-modal .form-element .icon-search {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    color: #A1A0A9;
}
.shipping-cities-modal .form-element .form-control {
    padding-inline-start: 40px;
    border-radius: 30px;
}
.shipping-cities-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}
.shipping-cities-list li {
    padding: 10px 6px;
    border-bottom: 1px solid var(--secondary-color-alt7, #ebebeb);
}

/* payment methods grid */
.payment-methods-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.payment-method-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 70px;
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 12px;
    background: var(--tg-color-white-default, #fff);
    padding: 10px;
}
.payment-method-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* bank account cards */
.bank-account-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--tg-color-white-default, #fff);
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.bank-account-logo {
    flex-shrink: 0;
    width: 80px;
}
.bank-account-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.bank-account-info {
    flex: 1 1 0;
    min-width: 220px;
}
.bank-account-info h5 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}
.bank-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.bank-account-row .label {
    flex: 0 0 140px;
    color: var(--tg-body-color, #6a6a6a);
}
.bank-account-row .value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.bank-account-row .copy-btn {
    cursor: pointer;
    color: #A1A0A9;
    font-size: 14px;
}
.bank-account-row .copy-btn:hover {
    color: var(--tg-theme-primary, #894B8D);
}
@media (max-width: 767.98px) {
    .shipping-method-row {
        flex-direction: column;
        gap: 4px;
    }
    .shipping-method-row .label {
        flex: none;
    }
    .bank-account-row {
        flex-wrap: wrap;
    }
    .bank-account-row .label {
        flex: 0 0 100%;
    }
}

/*
 * templates/page.jinja (generic CMS pages - About Us, Terms, Privacy Policy,
 * etc.) renders whatever rich HTML a merchant wrote in the page editor -
 * .page__content has no CSS anywhere, so headings/lists/links/images/quotes
 * would all fall back to bare browser defaults regardless of what the
 * merchant actually authored. Give it the same typography rhythm as the
 * rest of the theme instead of leaving it unstyled.
 */
.page__content {
    color: var(--tg-body-color, #6a6a6a);
    line-height: 1.8;
}
.page__content h1,
.page__content h2,
.page__content h3,
.page__content h4,
.page__content h5,
.page__content h6 {
    color: var(--tg-heading-color, #17151b);
    font-weight: 700;
    margin: 30px 0 15px;
    line-height: 1.3;
}
.page__content h1:first-child,
.page__content h2:first-child,
.page__content h3:first-child {
    margin-top: 0;
}
.page__content p {
    margin-bottom: 15px;
}
.page__content a {
    color: var(--tg-theme-primary, #894B8D);
    text-decoration: underline;
}
.page__content ul,
.page__content ol {
    margin-bottom: 15px;
    padding-inline-start: 22px;
}
.page__content li {
    margin-bottom: 6px;
}
.page__content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px 0;
}
.page__content blockquote {
    border-inline-start: 3px solid var(--tg-theme-primary, #894B8D);
    padding: 10px 20px;
    margin: 20px 0;
    background: rgba(137, 75, 141, 0.05);
    border-radius: 0 8px 8px 0;
}
.page__content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.page__content table th,
.page__content table td {
    padding: 10px 12px;
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
}

/*
 * templates/blogs.jinja's "Read More" button icon points right by default
 * (forward = right in LTR) - same left/right-vs-transform:rotate gap
 * rtlcss can't fix on its own, already hit repeatedly this session
 * (category "view all", 404's "Go to Home", testimonials nav, pagination).
 */
[dir="rtl"] .blog__post-content-three .btn i {
    display: inline-block;
    transform: scaleX(-1);
}

/* the currently-selected blog category in the sidebar (templates/blogs.jinja)
   had no distinct "selected" look of its own - only a :hover state. */
.sidebar-cat-list .list-wrap li.active a {
    color: var(--tg-theme-primary, #894B8D);
    font-weight: 600;
}

/*
 * .blog__details-thumb img (templates/blog.jinja's cover image) only sets
 * min-height/object-fit/border-radius - with no width rule at all, a real
 * photo just renders at its own intrinsic pixel width instead of filling
 * the (now full-width) column around it.
 */
.blog__details-thumb img {
    width: 100%;
    max-height: 520px;
}

/*
 * templates/product.jinja's content column is `.col-lg-6` (real Bootstrap
 * grid, kept so the real gallery/variant JS's layout expectations don't
 * change) *plus* Petpal's own `.product__details-content` class for its
 * typography/spacing rules - but that class also carries `margin-left: 40px`
 * (main.css), meant for Petpal's own non-Bootstrap two-column layout where
 * the margin IS the gutter. Added on top of a 50%-width Bootstrap column,
 * that extra 40px pushes the combined row past 100% width, so flex-wrap
 * drops this column onto its own line below the gallery instead of beside
 * it - breaking the whole two-column layout (confirmed by measuring both
 * columns' rects: both computed at the correct 50% width, but the second
 * one rendered ~750px below the first instead of next to it).
 */
.col-lg-6.product__details-content {
    margin-left: 0;
}
@media (max-width: 991.98px) {
    .col-lg-6.product__details-content {
        margin-top: 0;
    }
}

/*
 * templates/product.jinja: main.css styles every one of .product__details-
 * bottom's children (category/tags/social rows) as individual flex rows,
 * but never the outer wrapper/list itself, so those rows (here, just the
 * real share row) had no separation from the content above them.
 */
.product__details-bottom {
    margin-top: 20px;
    padding-top: 20px;
}
.product__details-bottom > .list-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/*
 * header.jinja: .tgmenu__action-three (search/login/wishlist/cart icons)
 * stays hidden below 768px as it always was (d-none d-md-block) - search
 * already lives in the .tgmobile__menu sidebar on mobile, and cramming
 * the full desktop icon row in next to the logo and hamburger doesn't
 * read well that narrow. .mobile-header-icons is the mobile-only
 * equivalent (just account/wishlist/cart, no search) - it used to live in
 * its own collapsible row below the nav, toggled by a separate button,
 * but now renders directly so there's nothing left to expand/collapse.
 * .mobile-nav-toggler itself moved into .logo (see below), so this row is
 * just the three icons now.
 */
.mobile-header-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: 18px; */
    gap: 13px;
}

/* Styled to match .mobile-nav-toggler (main.css: font-size 34px, color
   var(--tg-theme-primary), position: relative, line-height: 0) so all four
   mobile header icons read as one consistent set - a separate class rather
   than reusing .mobile-nav-toggler itself, since templateAssets/js/main.js
   binds a click handler to every .mobile-nav-toggler that opens the full
   sidebar menu, which would wrongly fire on these too. */
.mobile-header-icon {
    position: relative;
    display: block;
    line-height: 0;
    color: var(--tg-theme-primary);
    font-size: 20px;
    cursor: pointer;
}

/* .mobile-nav-toggler now sits inside .logo (header.jinja), next to the
   logo image itself, instead of grouped with the other mobile icons on
   the opposite side of the header. */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* main.css puts .tgmenu__nav at justify-content: space-between below
   991.98px, spreading .logo (+.mobile-nav-toggler) and .mobile-header-icons
   to opposite edges of the row with a big empty gap between them. Center
   the whole row as one group instead. */

@media (min-width: 992px) and (max-width: 1199.98px) {
    .tgmenu__nav {
        justify-content: space-between;
    }
}

@media (max-width: 991.98px) {
    .tgmenu__nav {
        align-content: center;
        gap: 24px;
    }
}

.mobile-header-icons .header-cart {
    display: flex;
    align-items: center;
    gap: 8px;
}

/*
 * .cart-badge (the small circular "1" over the bag icon) is only styled by
 * main.css under the ".tgmenu__action ul .header-cart a span" selector -
 * this icon set isn't a descendant of .tgmenu__action, so it rendered as
 * plain unstyled inline text instead of the circular badge seen on
 * desktop. Mirrored here, including main.rtl.css's flip of the badge from
 * the icon's right edge to its left (this store runs RTL). .header-cart is
 * the <a> itself now (not a wrapper around one), and already gets
 * position: relative from the reused .mobile-nav-toggler class.
 */
.mobile-header-icons .header-cart .cart-badge {
    position: absolute;
    top: -5px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tg-theme-primary);
    color: var(--text-color-primary-bg, #fff);
    font-size: 12px;
    font-weight: 600;
}

html[dir="rtl"] .mobile-header-icons .header-cart .cart-badge {
    left: -6px;
}

html[dir="ltr"] .mobile-header-icons .header-cart .cart-badge {
    right: -6px;
}

/*
 * .wishlist-badge (count of items in the wishlist) - no existing selector
 * anywhere styles a badge on .header-wishlist at all (unlike .header-cart's
 * ".tgmenu__action ul .header-cart a span" in main.css/main.rtl.css), so
 * this mirrors that same circular badge look for both the desktop nav link
 * and the mobile topbar link, with both sides handled directly via
 * html[dir] instead of relying on which of main.css/main.rtl.css loaded.
 */
/* Matches ".tgmenu__action ul .header-cart a"'s own font-size/line-height -
   .header-wishlist a had neither, so the heart rendered smaller than the
   bag/search/account icons next to it and threw off the badge positioning
   below. Color is set straight to the primary brand color to match how
   those other icons actually render (var(--tg-color-gray-2), what
   .header-cart/.header-search declare, does not visually match them here -
   something else in this cascade resolves them to the primary color, that
   this repo's CSS doesn't show directly). */
.tgmenu__action ul .header-wishlist a {
    position: relative;
    font-size: 28px;
    line-height: 0;
    color: var(--tg-theme-secondary);
}

.tgmenu__action ul .header-wishlist a .wishlist-badge,
.mobile-header-icons .header-wishlist .wishlist-badge {
    position: absolute;
    top: 3px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tg-theme-primary);
    /* Matches ".tgmenu__action ul .header-cart a span"'s own hardcoded white
       exactly - --text-color-primary-bg now resolves to a real dark color
       (on_primary), not white, so using it here made this badge's text a
       different color than the cart badge's on the exact same background. */
    color: var(--tg-color-white-default);
    font-size: 12px;
    font-weight: 600;
}

html[dir="rtl"] .tgmenu__action ul .header-wishlist a .wishlist-badge,
html[dir="rtl"] .mobile-header-icons .header-wishlist .wishlist-badge {
    left: -10px;
}

html[dir="ltr"] .tgmenu__action ul .header-wishlist a .wishlist-badge,
html[dir="ltr"] .mobile-header-icons .header-wishlist .wishlist-badge {
    right: -6px;
}

/*
 * components/sticky-lang-region-toolbar.jinja: used to be a single
 * position:fixed dock floating over every page. Now rendered inline in two
 * places instead, each independently toggleable via its own schema
 * setting - header.jinja's .tg-header__top (toolbar_variant: 'header') and
 * footer.jinja's .footer__bottom copyright column (toolbar_variant:
 * 'footer') - so the shared base styling below only covers the button
 * look itself, with placement handled per-variant.
 */
.sticky-lang-region-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sticky-toolbar-btn {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: var(--tg-color-white-default, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease;
}

.sticky-toolbar-btn:hover {
    transform: translateX(-4px);
}

html[dir="ltr"] .sticky-toolbar-btn:hover {
    transform: translateX(4px);
}

.sticky-toolbar-btn-region {
    color: var(--tg-theme-primary, #894B8D);
}

.sticky-toolbar-btn-lang {
    color: var(--tg-theme-primary, #894B8D);
}

/* .icon-language_white's own icomoon.css rule hardcodes color:#fff (it was
   built for a dark/colored background elsewhere in the theme) - invisible
   on a white button, so it needs a higher-specificity override here.
   Using the same primary purple as the region icon (rather than the
   theme's dark-navy secondary color, which reads as near-black at this
   small size) so both icons are clearly, consistently colored. */
.sticky-toolbar-btn-lang .icon-language_white:before {
    color: var(--tg-theme-primary, #894B8D);
}

/* header variant (header.jinja's .tg-header__top-row): a plain flex row,
   the toolbar as one item and the announcement text (flex: 1, its own
   text-align: center) taking the rest - a normal flow layout instead of
   absolutely positioning the toolbar over the announcement text, which in
   practice rendered flush against the viewport edge rather than the
   intended 15px inset from the (centered, narrower-than-viewport)
   .container. min-height keeps the bar's height stable whether or not the
   announcement text is present. */
.tg-header__top-row {
    display: flex;
    /* DOM order is [toolbar, announcement] - row-reverse always moves the
       first child to the main axis's "end", which is physically the left
       in RTL and the right in LTR, matching the toolbar's original
       dir-mirrored placement without needing an html[dir] override here. */
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
    min-height: 32px;
    padding: 6px 0;
}
.tg-header__top-row .tg-header__top-center {
    flex: 1;
    min-width: 0;
}

/* footer variant (footer.jinja, right under .footer__social): a labeled
   button rather than the header's icon-only round button - overrides
   .sticky-toolbar-btn's round/icon-only sizing with a proper pill button
   showing both the icon and "Language / Country" text (added in the
   component itself for this variant only). Colored to match
   .footer__social .list-wrap li a (main.css) exactly - white by default,
   switching to the theme primary color on hover, with no background fill -
   rather than the header variant's light-theme purple-on-white look, which
   read as mismatched against this footer's dark background. */
.sticky-lang-region-toolbar--footer {
    margin-top: 16px;
}
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn {
    width: auto;
    height: auto;
    padding: 9px 18px;
    gap: 8px;
    border-radius: 30px;
    background: transparent;
    border: 1px solid var(--tg-color-white-default, #fff);
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
}
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn span {
    color: var(--tg-color-white-default, #fff);
}
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn .icon-language_white:before {
    color: var(--tg-color-white-default, #fff);
}
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn:hover {
    border-color: var(--tg-theme-primary, #894B8D);
    transform: none;
}
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn:hover span,
.sticky-lang-region-toolbar--footer .sticky-toolbar-btn:hover .icon-language_white:before {
    color: var(--tg-theme-primary, #894B8D);
}

/*
 * The Noto-Sans-Arabic-for-RTL override that used to live here (on these
 * same two variables, for the same reason - the theme's own fonts are
 * Latin-only) moved into layout.jinja's :root block. This file is static
 * (no Jinja/settings access), so it couldn't read the merchant's chosen
 * settings.fonts_name - and being both more specific (html[dir="rtl"] vs
 * :root) and loaded after that block, it always won anyway, silently
 * discarding whatever font was actually chosen on every Arabic-language
 * page. layout.jinja now does both together, since it has both session.lang
 * and settings.fonts_name available.
 */

/*
 * templates/product.jinja's wishlist toggle (.add-to-wishlist span, wrapping
 * the two zid-visible/hidden-wishlist links plus the loading spinner) has no
 * layout of its own anywhere - it's a plain inline <span>, so its flex
 * (.wishlist-link, from main.css's ".product__wishlist-wrap a") and inline
 * (the loader <img>) children could end up wrapping unpredictably instead
 * of being read as one row. Also gives the already-in-wishlist state (.filled)
 * an actual filled look, matching product-card.jinja's own filled color
 * change - main.css only defines that for the card's icon-only button
 * variant (.product__action .wishlist-btn.filled), not this text+icon one.
 */
.add-to-wishlist {
    display: inline-flex;
    align-items: center;
}

/* main.css's ".product__thumb img { width: 100%; }" is a plain descendant
   selector - it matches ANY <img> under .product__thumb, including this
   20x20 loading spinner (product-card.jinja's wishlist toggle sits inside
   .product__thumb, unlike product.jinja's, which doesn't), stretching it up
   to the thumb's full width instead of its intended small size. */
.product__thumb .add-to-wishlist .loader {
    width: 20px;
    height: 20px;
}

.product__wishlist-wrap .wishlist-link.filled,
.product__wishlist-wrap .wishlist-link.filled:hover {
    color: var(--tg-theme-primary, #894B8D);
}

.product__wishlist-wrap .wishlist-link.filled i {
    background: var(--tg-theme-primary, #894B8D);
    color: var(--text-color-primary-bg, #fff);
    border-color: var(--tg-theme-primary, #894B8D);
}

/*
 * templates/product.jinja's .loyalty-widget-wrap/.bank-discounts-wrap -
 * vitrin:products/loyalty_points_widget.jinja, vitrin:shared/bank_discounts.jinja
 * and vitrin:products/payment_widgets.jinja are platform partials (not in this
 * repo) rendering their own inline CSS with a plain 1px gray border and no
 * radius, out of step with this theme's softer, rounded cards. Their own
 * selectors are un-!important'd single classes emitted later in the DOM than
 * this file, so nesting under our own wrapper class is enough to win purely
 * on specificity, no !important needed. Tabby's own widget (bank_discounts)
 * renders inside a closed shadow root - genuinely unstylable from here, so
 * only the space around it is touched.
 */
.loyalty-widget-wrap .loyalty-points-products-section {
    border: 1px solid var(--secondary-color-alt7, #ebebeb);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--tg-color-white-default, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.loyalty-widget-wrap .loyalty-points-products-section .loyalty-points-rewards {
    color: var(--tg-theme-primary, #894B8D);
    font-weight: 600;
}

.bank-discounts-wrap {
    margin-top: 12px;
    margin-bottom: 20px;
}

/*
 * components/rating-stars.jinja marks its "empty" star slots with
 * star-inactive so they can be colored consistently everywhere the
 * component is reused (product cards, product page, reviews, testimonials)
 * rather than relying on ancestor-specific rules like main.css's
 * .product__reviews .rating i:last-child - that one only ever colors a
 * single trailing star, which happens to work for whole/half ratings since
 * the true empty stars are always the trailing ones, but product-details.css's
 * .card-rate-comment .rating i / .rating-summary-score .rating i color
 * every star (filled and empty alike) gold with no way to tell them apart.
 * Same specificity as that pair, and (same as loyalty-widget-wrap's comment
 * above) templates/product.jinja's own top_links - which is what pulls in
 * product-details.css - renders later in the DOM than this file, so on the
 * product page itself that rule would otherwise win the tie. !important
 * makes this explicit "inactive" state always win instead, in every context
 * this component gets reused in, rather than depending on load order.
 */
.rating i.star-inactive {
    color: #BBC1CF !important;
}

/* Same reasoning/specificity fight as star-inactive above, for the filled
   state - explicit and consistent regardless of which ambient .rating i
   rule a given reuse context happens to have. */
.rating i.star-active {
    color: var(--tg-color-yellow-default, #FFBE17) !important;
}

/* Half star = a full star-inactive (gray) icon as the base, with a second
   full star-active (gold) icon absolutely positioned on top of it and
   clipped to 50% width - see the comment in rating-stars.jinja for why a
   single icon glyph (fa-star-half / fa-star-half-alt) can't get this exact
   two-tone look on its own. .fas already sets display: inline-block (Font
   Awesome's own base rule), so star-half-base just needs position:
   relative to anchor the overlay; the fill icon's left/right is set inline
   per-render based on page direction. */
.rating i.star-half-base {
    position: relative !important;
}
.rating i.star-half-fill {
    position: absolute !important;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

/*
 * Product grid cards (.product__item, inside #products-list's Bootstrap
 * .row) were only ever as tall as their own content - a title that wraps
 * to 2 lines, an extra .product__reviews row (only rendered when the
 * product actually has a rating), or a badge all made one card taller
 * than its neighbors with none of that, so the price/add-to-cart row
 * landed at a different height across the same row. Bootstrap's .row is
 * already display:flex with the default align-items: stretch, so every
 * .col in a row already gets stretched to match the tallest one - the
 * card itself just never filled that stretched height. Making it a flex
 * column that does, with .product__content growing to fill whatever's
 * left below the (fixed-size) image/thumb area and the price pinned to
 * the bottom of that, means the price/button row lines up at the same
 * height across a row regardless of how much title/review content sits
 * above it, without needing to hardcode a height anywhere.
 */
.product__item {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.product__content .price {
    margin-top: auto;
}

/* templates/products.jinja and templates/category.jinja both render this
   same #products-list grid (class="row gutter-20 row-cols-*"). .gutter-20
   only sets Bootstrap's --bs-gutter-x (horizontal gap) - --bs-gutter-y
   (the gap between wrapped rows) is never set, so it stays at Bootstrap's
   default of 0 and every row of cards butts directly against the next. */
#products-list {
    --bs-gutter-y: 24px;
}

/*
 * .product__reviews (main.css) is a plain nowrap flex row of the star
 * rating icons + a "(N reviews)" <span>, sized for a full-width desktop
 * card. On the mobile product slider (sections/products-section.jinja's
 * 2.2 slidesPerView breakpoint) each card is only ~150-180px of content
 * width - too narrow for 5 star icons plus the Arabic "(N المراجعات)" text
 * on one line, so the flex item shrinks below its text's natural width and
 * the text itself wraps to a second line. A card with a rating then grows
 * taller than a sibling card with none, breaking the row's shared height
 * (.product__item's height:100%/margin-top:auto above only pushes .price
 * down within whatever height the card already grew to - it doesn't stop
 * that growth in the first place). Force everything onto one line instead,
 * shrinking to fit and truncating the review count with an ellipsis rather
 * than ever wrapping.
 */
@media (max-width: 575.98px) {
    .product__reviews {
        gap: 4px;
        flex-wrap: nowrap;
    }
    .product__reviews .rating {
        flex-shrink: 0;
        gap: 1px;
    }
    .product__reviews .rating i {
        font-size: 12px;
    }
    .product__reviews span {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
}

/*
 * sections/products-section.jinja: the "more" button used to sit centered
 * on its own line below the whole product slider (text-center, mt-5). Moved
 * up next to the section title instead, on the opposite side of the row -
 * .section-title's own margin-top/bottom (main.css) is zeroed out (mb-0 in
 * the markup) since this row now owns that spacing instead.
 */
.home-products-section .section-header {
    gap: 16px;
    margin-bottom: 20px;
}

/*
 * .product__nav-wrap button (main.css) is opacity: 0 with no hover-reveal
 * rule anywhere in the compiled CSS or its SCSS source - the prev/next
 * arrows on every slider using this markup (sections/products-section.jinja,
 * sections/category-section.jinja) were permanently invisible, not just
 * hidden until hover. Always-visible-when-usable rather than hover-reveal,
 * since a hover-only fix would still leave them invisible on touch devices,
 * which have no hover state at all.
 *
 * Only the enabled/default state is forced visible here - NOT !important,
 * and swiper-bundle.min.css's own .swiper-button-disabled rule (opacity:
 * .35, added to a nextEl/prevEl automatically at whichever end of a
 * non-looping slider has nothing further to scroll to) is restored right
 * after with a selector specific enough to still win. Locking (Swiper's
 * separate swiper-button-lock => display:none, added to BOTH buttons
 * together when every slide already fits in one view - nothing to scroll
 * to in either direction) is untouched by either of these, since neither
 * sets display - so a slider with items <= its current slidesPerView still
 * shows no arrows at all, exactly the "only if more than the display count"
 * behavior asked for.
 */
.product__nav-wrap button {
    opacity: 1;
}
.product__nav-wrap button.swiper-button-disabled {
    opacity: .35;
}

/* header.jinja's logo <img class="image-logo"> is sized via an inline
   style="width: auto; max-height: 100%" (requesting a 175px-tall source
   image), sized for the full desktop header - on mobile it crowds the
   hamburger/search/cart icons next to it. !important is required here
   since only a stylesheet rule with !important can override an inline
   style. */
@media (max-width: 767.98px) {
    .logo .image-logo {
        width: 120px !important;
    }
}

/* assets/layout_loyalty_points.js injects .loyalty_button_footer at
   z-index: 999, inline, which sits above the mobile sidebar menu
   (.tgmobile__menu, z-index: 99, and its .tgmobile__menu-backdrop,
   z-index: 2, both from main.css) - the loyalty button stayed visible on
   top of the open sidebar instead of being covered by it. Raising just
   .tgmobile__menu/-backdrop's own z-index isn't enough on its own: once
   the page is scrolled, main.js adds .sticky-menu to #sticky-header
   (.tgmobile__menu's own ancestor), which main.css turns into
   position: fixed; z-index: 99 - that establishes a NEW stacking context
   capping everything inside it (including .tgmobile__menu, no matter its
   own z-index) at 99 when compared against body-level siblings like the
   loyalty button. Both the inner elements and this trapping ancestor need
   to clear 999. */
.tgmobile__menu-backdrop {
    z-index: 1000;
}
.tgmobile__menu {
    z-index: 1001;
}
#sticky-header.sticky-menu {
    z-index: 1002;
}

/* .footer__widget-title (main.css) is 26px, only stepped down to 24px
   below 1199.98px - no further reduction at actual phone widths, so every
   footer heading ("روابط سريعة", "خدمة العملاء"...) renders at near-desktop
   size on mobile. */
@media (max-width: 767.98px) {
    .footer__widget-title {
        font-size: 19px;
    }
}

/* Bootstrap's unprefixed .row-cols-N has no upper bound (it's the "xs and
   up" default, overridden by -sm-/-md-/-lg-/-xl- at their own breakpoints)
   - there's no built-in way to target *only* below 576px separately from
   that base. .row-cols-xs-N fills that gap, mirroring Bootstrap's own
   .row-cols-{bp}-N mechanism (flex: 0 0 auto; width: 100% / N) exactly,
   scoped to max-width: 575.98px so it only wins below the sm breakpoint. */
@media (max-width: 575.98px) {
    .row-cols-xs-1 > * {
        flex: 0 0 auto;
        width: 100%;
    }
    .row-cols-xs-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }
    .row-cols-xs-3 > * {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
    .row-cols-xs-4 > * {
        flex: 0 0 auto;
        width: 25%;
    }
    .row-cols-xs-5 > * {
        flex: 0 0 auto;
        width: 20%;
    }
    .row-cols-xs-6 > * {
        flex: 0 0 auto;
        width: 16.66666667%;
    }
}


nav#product-pagination {
    margin-bottom: 50px;
}
@media (max-width: 767px) {
    .pagination__wrap ul li a {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .header-wishlist .wishlist-badge{
        top:-5px !important;
    }
}