/*
 * Storefront shell & components.
 * Loaded after themes.css; consumes the --theme-* tokens only, so every
 * theme (including dark/bold) applies. Uses logical properties for RTL.
 */

:root {
    --sf-header-height: 68px;
    --sf-touch: 44px;
    --sf-section-space: clamp(2.5rem, 6vw, 4.5rem);
    --sf-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */

.sf-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sf-main {
    flex: 1 0 auto;
}

.sf-main:focus {
    outline: none;
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] h5,
html[data-theme] h6 {
    color: var(--theme-color-text);
    line-height: var(--theme-line-height-tight);
}

.sf-skip-link {
    position: absolute;
    inset-inline-start: var(--theme-space-4);
    top: -100px;
    z-index: 2000;
    padding: var(--theme-space-2) var(--theme-space-4);
    background: var(--theme-color-primary);
    color: var(--theme-color-text-inverse) !important;
    border-radius: var(--theme-radius-md);
    font-weight: var(--theme-weight-semibold);
}

.sf-skip-link:focus {
    top: var(--theme-space-2);
}

html[data-theme] :focus-visible {
    outline: 2px solid var(--theme-color-primary);
    outline-offset: 2px;
}

/* Arrows that point "forward" in reading direction */
[dir="rtl"] .sf-arrow {
    display: inline-block;
    transform: scaleX(-1);
}

/* ---------- Top bar ---------- */

.sf-topbar {
    background: var(--theme-color-primary);
    color: var(--theme-color-text-inverse);
    font-size: var(--theme-font-size-sm);
}

.sf-topbar a,
html[data-theme] .sf-topbar a {
    color: inherit;
}

.sf-topbar a:hover {
    color: inherit;
    opacity: 0.85;
}

.sf-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.sf-icon-link:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ---------- Navbar ---------- */

.sf-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

html[data-theme] .sf-navbar {
    min-height: var(--sf-header-height);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-color-border);
    box-shadow: var(--theme-shadow-sm);
}

.sf-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.sf-brand img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.sf-nav {
    gap: var(--theme-space-1);
    align-items: center;
}

html[data-theme] .sf-nav .nav-link {
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--theme-radius-md);
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-medium);
    white-space: nowrap;
    background: transparent;
}

html[data-theme] .sf-nav .nav-link:hover {
    background: var(--theme-color-surface);
    color: var(--theme-color-primary) !important;
}

html[data-theme] .sf-nav .nav-link.active {
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-primary) !important;
    font-weight: var(--theme-weight-semibold);
}

.sf-nav .nav-link::after {
    display: none !important;
}

.sf-nav .dropdown-toggle::after {
    display: inline-block !important;
    margin-inline-start: 0.35em;
}

html[data-theme] .sf-nav-cta {
    padding: 0.45rem 1rem;
    border-radius: var(--theme-radius-md);
    white-space: nowrap;
    color: var(--theme-color-text-inverse) !important;
}

.sf-nav .logout {
    width: 100%;
    text-align: start;
    border: 0;
    background: none;
}

/* Icon buttons (cart, menu) — comfortable 44px touch target */
.sf-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sf-touch);
    height: var(--sf-touch);
    border: 0;
    border-radius: var(--theme-radius-md);
    background: transparent;
    color: var(--theme-color-text) !important;
    font-size: 1.4rem;
    line-height: 1;
}

.sf-icon-btn:hover {
    background: var(--theme-color-surface);
    color: var(--theme-color-primary) !important;
}

.navbar-toggler.sf-icon-btn {
    padding: 0;
    box-shadow: none;
}

.sf-cart-badge {
    position: absolute;
    top: 2px;
    inset-inline-end: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--theme-color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: var(--theme-weight-bold);
    line-height: 1;
    border: 2px solid var(--theme-navbar-bg);
}

.cart-icon-container {
    padding: 0 !important;
}

/* ---------- Search ---------- */

.sf-search {
    position: relative;
    width: 100%;
    margin: 0;
}

.sf-search-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    color: var(--theme-color-text-muted);
    pointer-events: none;
}

html[data-theme] .sf-search-input {
    width: 100%;
    height: var(--sf-touch);
    padding-block: 0;
    padding-inline: 40px 14px;
    border: 1px solid var(--theme-color-border);
    border-radius: 999px;
    background: var(--theme-color-surface);
    color: var(--theme-color-text);
    font-size: var(--theme-font-size-sm);
}

html[data-theme] .sf-search-input:focus {
    background: var(--theme-color-surface-raised);
    border-color: var(--theme-color-primary);
    box-shadow: 0 0 0 3px var(--theme-focus-ring);
    outline: none;
}

.sf-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

/* jQuery UI autocomplete menu */
html[data-theme] .ui-autocomplete {
    z-index: 1100;
    max-height: 320px;
    overflow-y: auto;
    padding: var(--theme-space-1);
    background: var(--theme-color-surface-raised);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    box-shadow: var(--theme-shadow-md);
    font-family: var(--theme-font-family);
}

html[data-theme] .ui-autocomplete .ui-menu-item-wrapper {
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: var(--theme-radius-sm);
    color: var(--theme-color-text);
}

html[data-theme] .ui-autocomplete .ui-state-active {
    margin: 0;
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-primary);
}

/* Desktop layout */
@media (min-width: 992px) {
    .sf-navbar .offcanvas {
        flex-grow: 1;
    }

    .sf-navbar .offcanvas-body {
        display: flex;
        justify-content: space-between;
    }

    .sf-search {
        flex: 1 1 200px;
        min-width: 160px;
        max-width: 320px;
    }

    .sf-nav {
        flex-shrink: 0;
    }
}

/* Between lg and xl there is little room: tighter nav links */
@media (min-width: 992px) and (max-width: 1199.98px) {
    html[data-theme] .sf-nav .nav-link {
        padding: 0.5rem 0.55rem !important;
    }
}

/* Mobile off-canvas menu */
@media (max-width: 991.98px) {
    :root {
        --sf-header-height: 60px;
    }

    .sf-brand img {
        height: 34px;
    }

    .sf-navbar .offcanvas {
        width: min(340px, 88vw);
    }

    .sf-navbar .offcanvas-header {
        border-bottom: 1px solid var(--theme-color-border);
    }

    .sf-navbar .offcanvas-body {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .sf-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    html[data-theme] .sf-nav .nav-link {
        display: flex;
        align-items: center;
        min-height: var(--sf-touch);
        font-size: var(--theme-font-size-md);
    }

    html[data-theme] .sf-nav-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: var(--sf-touch);
        margin-top: var(--theme-space-2);
    }

    .sf-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: 0;
        padding-inline-start: var(--theme-space-3);
    }
}

/* ---------- Footer ---------- */

html[data-theme] .sf-footer {
    margin-top: var(--sf-section-space);
    font-size: var(--theme-font-size-sm);
    color: var(--theme-color-text-muted) !important;
}

.sf-footer img {
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.sf-footer-heading {
    margin-bottom: var(--theme-space-4);
    font-size: var(--theme-font-size-md);
    font-weight: var(--theme-weight-semibold);
}

.sf-footer-text {
    max-width: 46ch;
    line-height: 1.8;
}

.sf-footer-list li {
    margin-bottom: var(--theme-space-3);
}

.sf-footer-list .bi {
    color: var(--theme-color-primary);
    flex-shrink: 0;
}

html[data-theme] .sf-footer-link {
    color: var(--theme-color-text-muted);
}

html[data-theme] .sf-footer-link:hover {
    color: var(--theme-color-primary);
}

.sf-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--theme-color-border);
    border-radius: 50%;
    background: var(--theme-color-surface-raised);
    color: var(--theme-color-text) !important;
}

.sf-social-btn:hover {
    background: var(--theme-color-primary);
    border-color: var(--theme-color-primary);
    color: var(--theme-color-text-inverse) !important;
}

.sf-footer-bottom {
    padding: var(--theme-space-5) 0 calc(var(--theme-space-5) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--theme-color-border);
    text-align: center;
    font-size: var(--theme-font-size-xs);
}

/* ---------- Cart notification toast ---------- */

.cart-notification {
    position: fixed;
    top: calc(var(--sf-header-height) + 12px);
    inset-inline-end: 16px;
    z-index: 1090;
    width: min(360px, calc(100vw - 32px));
    margin: 0;
    box-shadow: var(--theme-shadow-lg);
}

/* ---------- Sections ---------- */

.sf-section {
    padding-block: var(--sf-section-space);
}

.sf-section-alt {
    background: var(--theme-color-surface);
}

.sf-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--theme-space-3);
    margin-bottom: var(--theme-space-6);
}

.sf-section-head.is-centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sf-section-title {
    margin: 0;
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: var(--theme-weight-bold);
}

.sf-section-subtitle {
    margin: var(--theme-space-1) 0 0;
    color: var(--theme-color-text-muted);
}

.sf-link-more {
    display: inline-flex;
    align-items: center;
    gap: var(--theme-space-1);
    font-weight: var(--theme-weight-semibold);
    white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero-hero .swiper-hero {
    padding-bottom: 0 !important;
}

.hero-hero .hero-slide {
    min-height: clamp(340px, 56vw, 560px);
    padding: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.hero-overlay::before {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0.1) 100%);
}

[dir="rtl"] .hero-overlay::before {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0.1) 100%);
}

.hero-overlay .container {
    position: relative;
    z-index: 2;
}

.hero-overlay .hero-content {
    max-width: 640px;
    padding: 0;
}

.hero-content .carousel-subtitle {
    font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.25rem) !important;
    font-weight: var(--theme-weight-medium);
    opacity: 0.9;
    margin-bottom: var(--theme-space-2);
}

html[data-theme] .hero-content .carousel-title {
    color: #fff;
    font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.75rem) !important;
    line-height: 1.1;
    margin-bottom: var(--theme-space-3);
}

.hero-content .carousel-description {
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem) !important;
    opacity: 0.92;
}

.hero-hero .swiper-button-next,
.hero-hero .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
}

.hero-hero .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.6;
}

.hero-hero .swiper-pagination-bullet-active {
    opacity: 1;
    width: 22px;
    border-radius: 4px;
}

@media (max-width: 767.98px) {
    .hero-hero .swiper-button-next,
    .hero-hero .swiper-button-prev {
        display: none;
    }
}

/* ---------- Category tiles ---------- */

.sf-category-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--theme-radius-lg);
    aspect-ratio: 4 / 5;
    background: var(--theme-color-surface);
    isolation: isolate;
}

.sf-category-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms var(--sf-ease);
}

.sf-category-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 55%);
}

.sf-category-tile:hover img {
    transform: scale(1.05);
}

.sf-category-tile-body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 1;
    padding: var(--theme-space-4);
    color: #fff;
}

html[data-theme] .sf-category-tile-body h3 {
    margin: 0 0 2px;
    color: #fff;
    font-size: var(--theme-font-size-lg);
    font-weight: var(--theme-weight-bold);
}

.sf-category-tile-body span {
    font-size: var(--theme-font-size-sm);
    opacity: 0.85;
}

/* ---------- Product card ---------- */

html[data-theme] .card:hover {
    transform: none;
    box-shadow: var(--theme-shadow-sm);
}

html[data-theme] .sf-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--theme-color-surface-raised);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-card-radius);
    box-shadow: none;
}

html[data-theme] .sf-product-card:hover,
html[data-theme] a.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--theme-shadow-md);
}

.sf-product-media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--theme-color-surface);
    overflow: hidden;
}

.sf-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms var(--sf-ease);
}

.sf-product-card:hover .sf-product-media img {
    transform: scale(1.04);
}

.sf-product-badge {
    position: absolute;
    top: var(--theme-space-2);
    inset-inline-start: var(--theme-space-2);
    padding: 3px 10px !important;
    border-radius: 999px !important;
    background: var(--theme-color-danger);
    color: #fff;
    font-size: var(--theme-font-size-xs);
    font-weight: var(--theme-weight-semibold);
}

.sf-product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--theme-space-2);
    padding: var(--theme-space-3) var(--theme-space-3) var(--theme-space-4);
}

html[data-theme] .sf-product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    margin: 0;
    color: var(--theme-color-text);
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-medium);
    line-height: 1.3;
}

html[data-theme] .sf-product-title a {
    color: inherit;
}

html[data-theme] .sf-product-title a:hover {
    color: var(--theme-color-primary);
}

/* Make the whole card clickable through the title link */
.sf-product-title a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.sf-product-card {
    position: relative;
}

.sf-price {
    color: var(--theme-color-primary);
    font-size: var(--theme-font-size-lg);
    font-weight: var(--theme-weight-bold);
    white-space: nowrap;
}

.sf-product-actions {
    position: relative;
    z-index: 2;
    margin-top: auto;
}

.sf-product-actions .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .sf-product-actions .btn {
        font-size: 0.8rem;
        padding-inline: 0.4rem;
    }

    .sf-product-actions .btn .bi {
        display: none;
    }
}

/* ---------- Trust / benefits bar ---------- */

html[data-theme] .platform-stats-bar .stat-icon,
html[data-theme] .platform-stats-bar .stat-label {
    color: var(--theme-color-text-inverse);
}

html[data-theme] .platform-stats-bar .stat-sublabel {
    color: var(--theme-color-text-inverse) !important;
    opacity: 0.8;
}

/* ---------- Promo banners & newsletter ---------- */

.sf-promo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: var(--theme-space-3);
    height: 100%;
    min-height: 240px;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-primary);
    color: var(--theme-color-text-inverse);
}

.sf-promo.is-secondary {
    background: var(--theme-color-secondary);
}

html[data-theme] .sf-promo h2,
html[data-theme] .sf-promo p {
    margin: 0;
    color: inherit;
}

.sf-promo h2 {
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: var(--theme-weight-bold);
}

.sf-promo-tag {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: var(--theme-font-size-xs);
    font-weight: var(--theme-weight-semibold);
}

html[data-theme] .sf-btn-on-primary {
    background: var(--theme-color-text-inverse);
    border: 0;
    color: var(--theme-color-primary);
    font-weight: var(--theme-weight-semibold);
}

html[data-theme] .sf-btn-on-primary:hover {
    background: var(--theme-color-text-inverse);
    color: var(--theme-color-primary-hover);
    opacity: 0.92;
}

html[data-theme] .newsletter {
    margin: 0;
    padding: clamp(1.75rem, 5vw, 3rem);
    border-radius: var(--theme-radius-lg);
}

html[data-theme] .newsletter h2,
html[data-theme] .newsletter p,
html[data-theme] .newsletter .bi {
    color: inherit;
}

.newsletter-form {
    display: flex;
    gap: var(--theme-space-2);
    max-width: 480px;
    margin: 0 auto;
}

html[data-theme] .newsletter-form .form-control {
    flex: 1;
    min-width: 0;
    max-width: none;
    height: 48px;
    border: 0;
    color: #111827;
    background: #fff;
}

@media (max-width: 479.98px) {
    .newsletter-form {
        flex-direction: column;
    }
}

/* ---------- Testimonials ---------- */

html[data-theme] .testimonial-card {
    height: 100%;
    padding: var(--theme-space-5);
    background: var(--theme-color-surface-raised);
    border: 1px solid var(--theme-color-border);
}

.sf-rating {
    color: var(--theme-color-warning);
    letter-spacing: 2px;
}

.sf-rating .is-off {
    color: var(--theme-color-border);
}

.sf-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-primary);
    font-weight: var(--theme-weight-bold);
}

/* ---------- Brands ---------- */

.sf-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    padding: var(--theme-space-3);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface-raised);
}

.sf-brand-logo img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.75;
    transition: filter 200ms ease, opacity 200ms ease;
}

.sf-brand-logo:hover img,
.sf-brand-logo:focus-visible img {
    filter: none;
    opacity: 1;
}

.sf-brand-logo span {
    color: var(--theme-color-text);
    font-weight: var(--theme-weight-semibold);
}

/* ---------- FAQ & benefits ---------- */

html[data-theme] .accordion {
    --bs-accordion-bg: var(--theme-color-surface-raised);
    --bs-accordion-color: var(--theme-color-text);
    --bs-accordion-border-color: var(--theme-color-border);
    --bs-accordion-btn-color: var(--theme-color-text);
    --bs-accordion-btn-bg: var(--theme-color-surface-raised);
    --bs-accordion-active-color: var(--theme-color-primary);
    --bs-accordion-active-bg: var(--theme-color-primary-soft);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

html[data-theme] .accordion-item {
    overflow: hidden;
    border-radius: var(--theme-radius-md) !important;
}

[data-theme="dark"] .accordion-button::after,
[data-theme="bold"] .accordion-button::after {
    filter: invert(1);
}

.sf-benefit {
    display: flex;
    align-items: flex-start;
    gap: var(--theme-space-4);
    padding: var(--theme-space-4);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface-raised);
}

.sf-benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-primary);
    font-size: 1.4rem;
}

html[data-theme] .sf-benefit h3 {
    margin: 0 0 4px;
    font-size: var(--theme-font-size-md);
    font-weight: var(--theme-weight-semibold);
}

.sf-benefit p {
    margin: 0;
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-sm);
}

/* ---------- About ---------- */

.sf-about-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--theme-radius-lg);
}

.sf-prose {
    color: var(--theme-color-text-muted);
    line-height: 1.9;
}

.sf-prose img {
    max-width: 100%;
    height: auto;
}

/* ---------- Swiper controls ---------- */

html[data-theme] .swiper-button-next,
html[data-theme] .swiper-button-prev {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme-color-surface-raised);
    color: var(--theme-color-primary);
    box-shadow: var(--theme-shadow-md);
}

html[data-theme] .swiper-button-next::after,
html[data-theme] .swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
}

html[data-theme] .swiper-pagination-bullet-active {
    background: var(--theme-color-primary);
}

.products-swiper,
.swiper-testimonials {
    padding-bottom: 44px !important;
}

/* ---------- Listing pages ---------- */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

[dir="rtl"] .breadcrumbs .fa-angle-right {
    transform: scaleX(-1);
}

html[data-theme] .page_title {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
    font-weight: var(--theme-weight-bold);
}

.sf-empty {
    padding: var(--theme-space-6) var(--theme-space-4);
    border: 1px dashed var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    text-align: center;
    color: var(--theme-color-text-muted);
}

.sf-empty .bi {
    display: block;
    margin-bottom: var(--theme-space-3);
    font-size: 2.5rem;
    color: var(--theme-color-text-muted);
}

html[data-theme] .pagination {
    --bs-pagination-color: var(--theme-color-primary);
    --bs-pagination-bg: var(--theme-color-surface-raised);
    --bs-pagination-border-color: var(--theme-color-border);
    --bs-pagination-hover-color: var(--theme-color-primary-hover);
    --bs-pagination-hover-bg: var(--theme-color-surface);
    --bs-pagination-active-bg: var(--theme-color-primary);
    --bs-pagination-active-border-color: var(--theme-color-primary);
    --bs-pagination-active-color: var(--theme-color-text-inverse);
    --bs-pagination-focus-box-shadow: 0 0 0 3px var(--theme-focus-ring);
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

/* ---------- Legacy utility colours → theme tokens ----------
   Older views use Bootstrap's fixed-colour utilities, which made dark
   themes show white blocks and dark-on-dark text. */

html[data-theme] .bg-white,
html[data-theme] .card-footer.bg-white {
    background-color: var(--theme-color-surface-raised) !important;
}

html[data-theme] .bg-light,
html[data-theme] .bg-secondary-subtle {
    background-color: var(--theme-color-surface) !important;
}

html[data-theme] .text-dark:not(.badge):not(.btn),
html[data-theme] .text-black {
    color: var(--theme-color-text) !important;
}

html[data-theme] .text-success {
    color: var(--theme-color-success) !important;
}

html[data-theme] .text-primary {
    color: var(--theme-color-primary) !important;
}

html[data-theme] .feature-card,
html[data-theme] .country-pill,
html[data-theme] .brand-pill {
    background: var(--theme-color-surface-raised);
    border-color: var(--theme-color-border);
}

html[data-theme] .alert-success {
    background: var(--theme-color-primary-soft);
    border-color: var(--theme-color-success);
    color: var(--theme-color-text);
}

html[data-theme] .alert-danger {
    background: color-mix(in srgb, var(--theme-color-danger) 12%, var(--theme-color-surface-raised));
    border-color: var(--theme-color-danger);
    color: var(--theme-color-text);
}

html[data-theme] .overflow-auto::-webkit-scrollbar-track,
html[data-theme] .row.product-scroll-row::-webkit-scrollbar-track {
    background: var(--theme-color-surface);
}

html[data-theme] .overflow-auto::-webkit-scrollbar-thumb,
html[data-theme] .row.product-scroll-row::-webkit-scrollbar-thumb {
    background: var(--theme-color-border);
}

html[data-theme] .btn-close {
    filter: none;
}

/* Bootstrap only lightens the select chevron under data-bs-theme="dark" */
html[data-theme="dark"] .form-select,
html[data-theme="bold"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

[data-theme="dark"] .btn-close,
[data-theme="bold"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Product strips: show 2 cards per row on phones instead of a single 85% card */
@media (max-width: 767.98px) {
    .row.product-scroll-row > div {
        flex: 0 0 46%;
        max-width: 46%;
    }
}

@media (max-width: 359.98px) {
    .row.product-scroll-row > div {
        flex: 0 0 72%;
        max-width: 72%;
    }
}

/* ======================================================
   Product detail page
   ====================================================== */

[v-cloak] {
    display: none !important;
}

.sf-gallery-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface);
}

.sf-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 150ms ease;
}

.sf-gallery-thumbs {
    display: flex;
    gap: var(--theme-space-2);
    margin-top: var(--theme-space-3);
    padding-bottom: var(--theme-space-1);
    overflow-x: auto;
    scrollbar-width: thin;
}

.thumbnail-btn {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface);
    cursor: pointer;
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0 !important;
    border-radius: 0;
    transform: none !important;
}

.thumbnail-btn:hover {
    border-color: var(--theme-color-text-muted);
}

.thumbnail-btn.active {
    border-color: var(--theme-color-primary);
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.sf-gallery-hint {
    margin: var(--theme-space-2) 0 0;
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-xs);
    text-align: center;
}

html[data-theme] .sf-product-brand {
    display: inline-block;
    margin-bottom: var(--theme-space-2);
    color: var(--theme-color-primary);
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-semibold);
}

html[data-theme] .sf-product-heading {
    margin-bottom: var(--theme-space-3);
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: var(--theme-weight-bold);
}

.sf-product-price {
    color: var(--theme-color-primary);
    font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
    font-weight: var(--theme-weight-bold);
    line-height: 1;
}

.sf-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-semibold);
}

.sf-stock.is-in {
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-success);
}

.sf-stock.is-out {
    background: color-mix(in srgb, var(--theme-color-danger) 12%, transparent);
    color: var(--theme-color-danger);
}

.sf-buy-box {
    padding: var(--theme-space-5);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface-raised);
}

.sf-qty {
    width: 148px;
    flex-wrap: nowrap;
}

.sf-qty .btn,
.sf-qty .form-control {
    height: 48px;
}

.sf-qty .form-control {
    font-weight: var(--theme-weight-semibold);
    -moz-appearance: textfield;
}

.sf-qty .form-control::-webkit-outer-spin-button,
.sf-qty .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

html[data-theme] .sf-qty .btn-outline-secondary {
    border-color: var(--theme-color-border);
    color: var(--theme-color-text);
}

html[data-theme] .sf-qty .btn-outline-secondary:hover {
    background: var(--theme-color-surface);
}

#add-to-cart-btn {
    min-height: 48px;
}

.sf-trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--theme-space-2) var(--theme-space-5);
    margin: var(--theme-space-4) 0 0;
    padding: 0;
    list-style: none;
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-sm);
}

.sf-trust-list li {
    display: inline-flex;
    align-items: center;
    gap: var(--theme-space-2);
}

.sf-trust-list .bi {
    color: var(--theme-color-primary);
    font-size: 1.1rem;
}

html[data-theme] .sf-block-title {
    margin-bottom: var(--theme-space-3);
    font-size: var(--theme-font-size-xl);
    font-weight: var(--theme-weight-bold);
}

.sf-description {
    overflow-wrap: anywhere;
}

.sf-description table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.sf-order-card {
    padding: var(--theme-space-5);
    border: 1px solid var(--theme-color-border);
    border-top: 4px solid var(--theme-color-primary);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface-raised);
    box-shadow: var(--theme-shadow-md);
    scroll-margin-top: calc(var(--sf-header-height) + 16px);
}

@media (min-width: 992px) {
    .sf-order-card {
        position: sticky;
        top: calc(var(--sf-header-height) + 16px);
    }
}

.sf-order-card .form-control,
.sf-order-card .form-select {
    min-height: 46px;
}

.sf-order-success {
    padding: var(--theme-space-4) 0;
    text-align: center;
}

.sf-order-success > .bi {
    display: block;
    margin-bottom: var(--theme-space-3);
    color: var(--theme-color-success);
    font-size: 3rem;
}

html[data-theme] .sf-order-success h3 {
    font-size: var(--theme-font-size-xl);
    font-weight: var(--theme-weight-bold);
}

.sf-bundle {
    margin-bottom: var(--theme-space-2);
    padding: var(--theme-space-3) var(--theme-space-4);
    border: 2px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface-raised);
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.sf-bundle:hover {
    border-color: var(--theme-color-text-muted);
}

.sf-bundle.is-selected {
    border-color: var(--theme-color-primary);
    background: var(--theme-color-primary-soft);
}

.sf-bundle-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--theme-color-border);
    border-radius: 50%;
    background: var(--theme-color-surface-raised);
}

.sf-bundle.is-selected .sf-bundle-radio {
    border: 6px solid var(--theme-color-primary);
}

.sf-bundle-qty {
    font-weight: var(--theme-weight-semibold);
}

.sf-bundle-price {
    color: var(--theme-color-primary);
    font-size: var(--theme-font-size-lg);
    font-weight: var(--theme-weight-bold);
}

html[data-theme] .sf-bundle-item-title {
    margin-bottom: var(--theme-space-2);
    color: var(--theme-color-primary);
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-semibold);
}

/* Mobile sticky order bar (replaces the old full-width floating button) */
#scroll-to-order-btn.sf-sticky-order {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: var(--theme-space-3);
    padding: var(--theme-space-2) var(--theme-space-4) calc(var(--theme-space-2) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--theme-color-border);
    background: var(--theme-color-surface-raised);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    transition: transform 200ms ease;
}

#scroll-to-order-btn.sf-sticky-order.is-hidden {
    transform: translateY(110%);
}

.sf-sticky-order-price {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sf-sticky-order-price small {
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-xs);
}

.sf-sticky-order-price strong {
    color: var(--theme-color-primary);
    font-size: var(--theme-font-size-lg);
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    /* keep page content clear of the sticky bar */
    .sf-product-page {
        padding-bottom: 96px;
    }
}

@media (min-width: 992px) {
    #scroll-to-order-btn.sf-sticky-order {
        display: none;
    }
}

/* ======================================================
   Panels, cart, checkout
   ====================================================== */

.sf-panel {
    padding: var(--theme-space-5);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface-raised);
}

@media (max-width: 575.98px) {
    .sf-panel {
        padding: var(--theme-space-4);
    }
}

@media (min-width: 992px) {
    .sf-summary {
        position: sticky;
        top: calc(var(--sf-header-height) + 16px);
    }
}

html[data-theme] .card-header {
    background: var(--theme-color-surface);
    border-color: var(--theme-color-border);
    color: var(--theme-color-text);
}

.sf-hint {
    padding: var(--theme-space-3) var(--theme-space-4);
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface);
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-sm);
}

/* Back arrows point toward the start edge */
[dir="ltr"] .sf-arrow-back {
    display: inline-block;
    transform: scaleX(-1);
}

/* Cart lines: image | info | qty | total — wraps cleanly on phones */
.sf-cart-line {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto auto;
    grid-template-areas: "thumb info qty total";
    align-items: center;
    gap: var(--theme-space-3) var(--theme-space-4);
    padding: var(--theme-space-4) 0;
    border-bottom: 1px solid var(--theme-color-border);
    transition: opacity 150ms ease;
}

.sf-cart-line:first-child {
    padding-top: 0;
}

.sf-cart-line.is-updating {
    opacity: 0.55;
    pointer-events: none;
}

.sf-cart-thumb {
    grid-area: thumb;
    display: block;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface);
}

.sf-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-cart-info {
    grid-area: info;
    min-width: 0;
}

html[data-theme] .sf-cart-name {
    margin: 0 0 2px;
    font-size: var(--theme-font-size-md);
    font-weight: var(--theme-weight-semibold);
}

html[data-theme] .sf-cart-name a {
    color: var(--theme-color-text);
}

html[data-theme] .sf-cart-name a:hover {
    color: var(--theme-color-primary);
}

.sf-cart-qty {
    grid-area: qty;
}

.sf-cart-total {
    grid-area: total;
    min-width: 96px;
    text-align: end;
}

.sf-qty-sm {
    width: 120px;
}

.sf-qty-sm .btn,
.sf-qty-sm .form-control {
    height: 40px;
}

@media (max-width: 575.98px) {
    .sf-cart-line {
        grid-template-columns: 72px minmax(0, 1fr) auto;
        grid-template-areas:
            "thumb info info"
            "thumb qty total";
        gap: var(--theme-space-2) var(--theme-space-3);
    }

    .sf-cart-thumb {
        width: 72px;
        height: 72px;
        align-self: start;
    }

    .sf-cart-total {
        min-width: 0;
    }
}

/* Summary rows */
.sf-summary-rows {
    margin: 0 0 var(--theme-space-4);
}

.sf-summary-rows > div {
    display: flex;
    justify-content: space-between;
    gap: var(--theme-space-3);
    padding: var(--theme-space-2) 0;
}

.sf-summary-rows dt {
    font-weight: var(--theme-weight-regular);
}

.sf-summary-rows dd {
    margin: 0;
    text-align: end;
}

.sf-summary-rows .sf-summary-total {
    margin-top: var(--theme-space-2);
    padding-top: var(--theme-space-3);
    border-top: 1px solid var(--theme-color-border);
    font-size: var(--theme-font-size-lg);
}

.sf-summary-rows .sf-summary-total dt,
.sf-summary-rows .sf-summary-total dd {
    font-weight: var(--theme-weight-bold);
}

.sf-summary-rows .sf-summary-total dd {
    color: var(--theme-color-primary);
}

.order-items {
    max-height: 320px;
    overflow-y: auto;
}

.order-items li + li {
    border-top: 1px solid var(--theme-color-border);
}

.sf-summary-thumb {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--theme-radius-md);
    background: var(--theme-color-surface);
}

.sf-summary-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.sf-summary-qty {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--theme-color-text-muted);
    color: var(--theme-color-bg);
    font-size: 0.7rem;
    font-weight: var(--theme-weight-bold);
}

.sf-summary-name {
    overflow: hidden;
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

/* Checkout steps */
html[data-theme] .sf-step-title {
    display: flex;
    align-items: center;
    gap: var(--theme-space-3);
    margin-bottom: var(--theme-space-4);
    font-size: var(--theme-font-size-lg);
    font-weight: var(--theme-weight-semibold);
}

.sf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--theme-color-primary);
    color: var(--theme-color-text-inverse);
    font-size: var(--theme-font-size-sm);
    font-weight: var(--theme-weight-bold);
}

.checkout-page .form-group {
    margin-bottom: 0;
}

.checkout-page .help-block,
.checkout-page .invalid-feedback {
    font-size: var(--theme-font-size-xs);
}

.shipping-option {
    display: flex;
    align-items: center;
    gap: var(--theme-space-3);
    margin-bottom: var(--theme-space-2);
    padding: var(--theme-space-3) var(--theme-space-4);
    border: 2px solid var(--theme-color-border);
    border-radius: var(--theme-radius-md);
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.shipping-option:hover {
    border-color: var(--theme-color-text-muted);
}

.shipping-option:has(input:checked) {
    border-color: var(--theme-color-primary);
    background: var(--theme-color-primary-soft);
}

html[data-theme] .form-check-input:checked {
    background-color: var(--theme-color-primary);
    border-color: var(--theme-color-primary);
}

/* Order confirmation */
.order-success-page .card {
    border-color: var(--theme-color-border);
}

/* ======================================================
   Auth, contact, error
   ====================================================== */

.sf-auth {
    max-width: 440px;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    background: var(--theme-color-surface-raised);
    box-shadow: var(--theme-shadow-md);
}

.sf-auth-head {
    margin-bottom: var(--theme-space-5);
    text-align: center;
}

.sf-auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--theme-space-3);
    border-radius: 50%;
    background: var(--theme-color-primary-soft);
    color: var(--theme-color-primary);
    font-size: 1.6rem;
}

.sf-auth .form-control {
    min-height: 46px;
}

.sf-auth-switch {
    margin: var(--theme-space-5) 0 0;
    padding-top: var(--theme-space-4);
    border-top: 1px solid var(--theme-color-border);
    color: var(--theme-color-text-muted);
    font-size: var(--theme-font-size-sm);
    text-align: center;
}

/* intl-tel-input: full width and RTL-friendly */
.sf-auth .iti {
    display: block;
    width: 100%;
}

html[data-theme] .iti__country-list {
    background: var(--theme-color-surface-raised);
    border-color: var(--theme-color-border);
    color: var(--theme-color-text);
}

.sf-map {
    overflow: hidden;
    border: 1px solid var(--theme-color-border);
    border-radius: var(--theme-radius-lg);
    aspect-ratio: 4 / 3;
}

.sf-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.sf-error {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--theme-space-6) 0;
    text-align: center;
}

.sf-error-code {
    margin-bottom: var(--theme-space-2);
    color: var(--theme-color-primary);
    font-size: clamp(4rem, 3rem + 6vw, 7rem);
    font-weight: var(--theme-weight-bold);
    line-height: 1;
    opacity: 0.85;
}

/* Toastify (order form messages) themed */
html[data-theme] .toastify {
    background: var(--theme-color-text);
    color: var(--theme-color-bg);
    border-radius: var(--theme-radius-md);
    box-shadow: var(--theme-shadow-lg);
    font-family: var(--theme-font-family);
}
