/* =====================================================================
   storefront.css
   Loaded by base.html (the public shop). Grouped by area:
   header and navigation, footer, home page, product cards and listings,
   product detail, cart and checkout, account and info pages.
   ===================================================================== */

.site-main {
    min-height: 60vh;
}

body.no-scroll {
    overflow: hidden;
}

/* Shared page spacing for storefront pages */
.page-section {
    padding-block: var(--space-5);
}

.section-header {
    max-width: 640px;
    margin: 0 auto var(--space-4);
    text-align: center;
}

.section-title {
    margin-bottom: var(--space-2);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
}

.section-subtitle,
.section-description {
    margin: 0;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------------
   Header: maintenance banners
   --------------------------------------------------------------------- */
.maintenance-admin-banner,
.maintenance-notice-banner {
    padding: 0.5rem 0;
    font-size: var(--text-sm);
    text-align: center;
}

.maintenance-admin-banner {
    background: var(--gray-900);
    color: var(--text-inverse);
}

.maintenance-notice-banner {
    background: var(--warning-bg);
    border-bottom: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.maintenance-admin-banner .nav-container,
.maintenance-notice-banner .nav-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.maintenance-admin-banner-link {
    margin-left: var(--space-2);
    color: var(--text-inverse);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Header: site navigation (main_nav_2.html)
   --------------------------------------------------------------------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-inline: var(--page-gutter);
}

/* Logo row */
.nav2-top-row .nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: var(--text);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-logo img {
    width: auto;
    max-height: 44px;
    object-fit: contain;
}

.nav-toggle-mobile {
    position: absolute;
    left: var(--page-gutter);
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-2);
    border: 0;
    border-radius: var(--radius);
    background: none;
}

.nav-toggle-mobile span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: var(--text);
}

.nav2-divider {
    display: none;
}

/* Menu + actions row */
.nav2-bottom-row {
    border-top: 1px solid var(--border);
}

.nav2-bottom-row .nav-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 52px;
}

.nav2-menu-col {
    position: relative;
    flex: 1;
    min-width: 0;
    transition: opacity var(--duration) var(--ease);
}

.nav2-actions-col {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--space-3);
}

.nav-horizontal-menu {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link-horizontal {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--duration-fast) var(--ease);
}

.nav-link-horizontal:hover,
.nav-link-horizontal.active {
    background: var(--surface-muted);
    text-decoration: none;
}

.all-menu-btn {
    border: 1px solid var(--border);
}

.nav-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--duration) var(--ease);
}

.nav-item:hover > .nav-link-horizontal .nav-arrow,
.nav-item:focus-within > .nav-link-horizontal .nav-arrow {
    transform: rotate(180deg);
}

/* Desktop search: grows over the menu when focused (JS toggles the class) */
.nav-search-bar {
    position: relative;
    min-width: 0;
}

.nav2-desktop-search {
    flex: 0 1 240px;
    width: 240px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    width: 100%;
    min-height: 36px;
    padding: 0.375rem 0.75rem 0.375rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-muted) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7771' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'/%3e%3c/svg%3e") no-repeat 0.75rem center / 15px;
    font-size: var(--text-sm);
    transition: border-color var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease);
}

.search-input:focus {
    background-color: var(--surface);
    border-color: var(--blue-600);
    box-shadow: var(--focus-ring);
    outline: none;
}

#siteNav2.nav2-search-active .nav2-menu-col {
    opacity: 0;
    pointer-events: none;
}

#siteNav2.nav2-search-active .nav2-actions-col {
    flex: 1;
}

#siteNav2.nav2-search-active .nav2-desktop-search {
    flex: 1 1 auto;
    width: auto;
}

/* Cart link and count */
.nav-actions-top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-link,
.nav2-mobile-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1.25rem;
    text-decoration: none;
}

.cart-link:hover,
.nav2-mobile-cart:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--gray-900);
    color: var(--text-inverse);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    line-height: 18px;
    text-align: center;
}

/* Mobile bar: search + cart under the logo */
.nav2-mobile-bar {
    display: none;
    border-top: 1px solid var(--border);
}

.nav2-mobile-bar .nav-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.nav2-mobile-search {
    flex: 1;
}

.nav2-mobile-bar .search-input {
    font-size: 16px; /* stops iOS zooming into the field */
}

@media (max-width: 991.98px) {
    .nav2-bottom-row {
        display: none;
    }

    .nav2-mobile-bar {
        display: block;
    }

    .nav-toggle-mobile {
        display: flex;
    }

    .nav2-top-row .nav-container {
        min-height: 56px;
    }
}

@media (max-width: 1199.98px) {
    .nav2-desktop-search {
        flex-basis: 180px;
        width: 180px;
    }
}

/* Dropdown and mega menus (shown on hover / focus) */
.dropdown-menu-nav,
.mega-menu {
    position: absolute;
    top: 100%;
    z-index: var(--z-dropdown);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(var(--motion-rise) * 0.5));
    transition: var(--popover-closed);
}

.dropdown-menu-nav {
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: var(--space-1);
    list-style: none;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.nav-item:hover > .dropdown-menu-nav,
.nav-item:focus-within > .dropdown-menu-nav,
.has-mega:hover > .mega-menu,
.has-mega:focus-within > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: var(--popover-open);
}

/* Moving straight to another menu item: the menu being left goes at once
   instead of waiting out the grace delay, so two panels never overlap */
.nav-horizontal-menu:has(> .nav-item:hover) > .nav-item:not(:hover) > .dropdown-menu-nav,
.nav-horizontal-menu:has(> .nav-item:hover) > .nav-item:not(:hover) > .mega-menu {
    transition: var(--popover-switch);
}

/* Inside an opening menu the columns and links follow the panel in, one
   after another */
@keyframes menu-item-in {
    from {
        opacity: 0;
        transform: translateY(calc(var(--motion-rise) * 0.4));
    }
}

.has-mega:is(:hover, :focus-within) > .mega-menu .mega-column,
.nav-item:is(:hover, :focus-within) > .dropdown-menu-nav > li {
    animation: menu-item-in var(--motion-enter) var(--ease-out)
               calc(var(--hover-intent) + var(--menu-item-delay, 0ms)) backwards;
}

.mega-column:nth-child(2),
.dropdown-menu-nav > li:nth-child(2) { --menu-item-delay: calc(var(--motion-stagger) * 0.6); }
.mega-column:nth-child(3),
.dropdown-menu-nav > li:nth-child(3) { --menu-item-delay: calc(var(--motion-stagger) * 1.2); }
.mega-column:nth-child(4),
.dropdown-menu-nav > li:nth-child(4) { --menu-item-delay: calc(var(--motion-stagger) * 1.8); }
.mega-column:nth-child(n+5),
.dropdown-menu-nav > li:nth-child(n+5) { --menu-item-delay: calc(var(--motion-stagger) * 2.4); }

.dropdown-menu-nav a,
.dropdown-menu-nav .dropdown-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--text-sm);
    text-decoration: none;
}

.dropdown-menu-nav a:hover {
    background: var(--surface-muted);
}

.dropdown-text {
    color: var(--text-muted);
}

.external-icon {
    width: 12px;
    height: 12px;
    margin-left: auto;
    color: var(--text-muted);
}

/* The mega menu spans the header width, just below it */
.has-mega {
    position: static;
}

.mega-menu {
    left: 0;
    right: 0;
    padding: var(--space-4) var(--page-gutter);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.mega-menu-inner {
    max-width: var(--container);
    margin: 0 auto;
}

.mega-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.mega-column {
    flex: 1 1 160px;
    min-width: 0;
}

.mega-column-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.mega-column-header a {
    color: var(--text);
}

.mega-column-desc {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.mega-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega-links a,
.mega-links span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.3rem 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.mega-links a:hover {
    color: var(--text);
}

/* Live search suggestions (nav_search.js) */
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    display: none;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-suggestions.is-open {
    display: block;
    animation: dropdown-in var(--motion-enter) var(--ease-out);
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.search-suggestion-item:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.search-suggestion-thumb,
.search-suggestion-thumb-placeholder {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.search-suggestion-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    color: var(--gray-400);
}

.search-suggestion-info {
    flex: 1;
    min-width: 0;
}

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

.search-suggestion-price {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.search-suggestion-empty {
    margin: 0;
    padding: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-align: center;
}

.search-suggestion-footer {
    padding: var(--space-2);
    background: var(--surface-muted);
    font-size: var(--text-sm);
    text-align: center;
}

.search-suggestion-footer a {
    color: var(--text-secondary);
}

/* Cart preview on hover (desktop only) */
.cart-preview-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: var(--z-dropdown);
    width: 320px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(var(--motion-rise) * 0.5));
    transition: var(--popover-closed);
}

/* Bridges the gap so the pointer can travel into the panel */
.cart-preview-li::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
}

.cart-preview-li:hover .cart-preview-dropdown,
.cart-preview-li:focus-within .cart-preview-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: var(--popover-open);
}

.cart-preview-header {
    padding: 0.75rem var(--space-3);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.cart-preview-body {
    max-height: 280px;
    overflow-y: auto;
}

.cart-preview-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}

.cart-preview-item:last-child {
    border-bottom: 0;
}

.cart-preview-img,
.cart-preview-img-placeholder {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    object-fit: cover;
}

.cart-preview-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.cart-preview-info {
    flex: 1;
    min-width: 0;
}

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

.cart-preview-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.cart-preview-price {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.cart-preview-empty,
.cart-preview-loading {
    padding: var(--space-4) var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-align: center;
}

.cart-preview-footer {
    padding: 0.75rem var(--space-3);
    border-top: 1px solid var(--border);
}

.cart-preview-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

@media (max-width: 991.98px) {
    .cart-preview-dropdown {
        display: none;
    }
}

/* ---------------------------------------------------------------------
   Header: slide-in drawer menu (nav_sidebar.js)
   --------------------------------------------------------------------- */
.nav-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: calc(var(--z-drawer) + 1);
    display: flex;
    flex-direction: column;
    width: min(360px, 88vw);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--surface);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--motion-exit) var(--ease),
                visibility 0s linear var(--motion-exit);
}

/* Shadow and visibility only while open, so the closed drawer leaves no
   edge on the page and its links are out of the tab order */
.nav-sidebar.active {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--shadow-lg);
    transition: transform var(--motion-enter) var(--ease-out), visibility 0s;
}

.nav-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    background: rgba(28, 27, 25, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-exit) var(--ease),
                visibility 0s linear var(--motion-exit);
}

.nav-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--motion-enter) var(--ease-out), visibility 0s;
}

.nav-sidebar-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.nav-sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--weight-semibold);
}

.nav-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.nav-sidebar-close:hover {
    background: var(--surface-muted);
}

.nav-sidebar-content {
    position: relative;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
}

.nav-sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    flex-shrink: 0;
    padding: var(--space-3);
    border-top: 1px solid var(--border);
}

.nav-sidebar-footer a:not(.btn) {
    display: flex;
    flex: 1 1 40%;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: var(--text-sm);
}

.nav-sidebar-footer a:not(.btn):hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.sidebar-menu-level {
    display: none;
    padding-block: var(--space-2);
}

.sidebar-menu-level.active {
    display: block;
}

.sidebar-menu-level.slide-in-right { animation: drawer-in-right var(--duration) var(--ease); }
.sidebar-menu-level.slide-in-left { animation: drawer-in-left var(--duration) var(--ease); }
.sidebar-menu-level.slide-out-left { display: block; animation: drawer-out-left var(--duration) var(--ease) forwards; }
.sidebar-menu-level.slide-out-right { display: block; animation: drawer-out-right var(--duration) var(--ease) forwards; }

@keyframes drawer-in-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes drawer-in-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes drawer-out-left { to { opacity: 0; transform: translateX(-24px); } }
@keyframes drawer-out-right { to { opacity: 0; transform: translateX(24px); } }

.sidebar-menu-title {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-menu-link,
.sidebar-back-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 0.75rem var(--space-3);
    border: 0;
    background: none;
    color: var(--text);
    font-size: var(--text-base);
    text-align: left;
    text-decoration: none;
}

.sidebar-menu-link:hover,
.sidebar-back-btn:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.sidebar-menu-link > svg:last-child:not(:first-child) {
    margin-left: auto;
    color: var(--text-muted);
}

.sidebar-back-btn {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
    padding: var(--space-5) 0 var(--space-4);
    background: var(--gray-900);
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.site-footer h2,
.site-footer h5 {
    margin-bottom: var(--space-3);
    color: var(--gray-0);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-footer a {
    color: var(--gray-300);
}

.site-footer a:hover {
    color: var(--gray-0);
}

.footer-logo {
    display: block;
    max-width: 220px;
    max-height: 48px;
    object-fit: contain;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.footer-contact .icon {
    margin-top: 0.2em;
    color: var(--gray-500);
}

.footer-divider {
    margin: var(--space-4) 0 var(--space-3);
    border-color: rgba(255, 255, 255, 0.1);
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--gray-300);
    transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gray-0);
}

/* Same icons on a light surface (contact page) */
.social-icons-light a {
    border-color: var(--border);
    color: var(--text-muted);
}

.social-icons-light a:hover {
    background: var(--surface-muted);
    color: var(--text);
}

/* ---------------------------------------------------------------------
   Home: hero carousel
   --------------------------------------------------------------------- */
.hero-section {
    position: relative;
    height: min(78vh, 720px);
    min-height: 440px;
    overflow: hidden;
    background: var(--gray-900);
}

.carousel {
    position: relative;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms var(--ease), visibility 0s linear 700ms;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 700ms var(--ease), visibility 0s;
}

.carousel-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Darkens the lower part of the photo so the text stays readable */
.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0) 75%);
}

.hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 96px;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3);
}

.hero-text {
    max-width: 560px;
}

/* Each time a slide becomes active its text comes in line by line */
.carousel-slide.active .hero-title,
.carousel-slide.active .hero-subtitle,
.carousel-slide.active .hero-content > .btn {
    animation: fade-up var(--motion-enter) var(--ease-out) backwards;
}

.carousel-slide.active .hero-subtitle { animation-delay: calc(var(--motion-stagger) * 1.2); }
.carousel-slide.active .hero-content > .btn { animation-delay: calc(var(--motion-stagger) * 2.4); }

.hero-title {
    margin-bottom: var(--space-2);
    color: var(--gray-0);
    font-size: var(--text-3xl);
    font-weight: var(--weight-semibold);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.hero-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-md);
}

.carousel-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.carousel-indicators {
    display: flex;
    gap: var(--space-2);
}

.carousel-indicators button {
    width: 32px;
    height: 20px;
    padding: 0;
    border: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)) no-repeat center / 100% 2px;
}

.carousel-indicators button.active {
    background-image: linear-gradient(#fff, #fff);
}

.carousel-arrows {
    display: flex;
    gap: var(--space-2);
}

.carousel-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    transition: background-color var(--duration-fast) var(--ease);
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hero-social {
    position: absolute;
    top: 50%;
    left: var(--space-3);
    z-index: 2;
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    transform: translateY(-50%);
}

.hero-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #fff;
}

.hero-social a:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (min-width: 992px) {
    .hero-social {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    .hero-content {
        bottom: 88px;
    }
}

/* ---------------------------------------------------------------------
   Home: stats, call to action
   --------------------------------------------------------------------- */
.stats-section {
    padding-block: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.stats-section .stat-card {
    padding: var(--space-3) 0;
    text-align: center;
}

.stats-section .stat-number {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
}

.stats-section .stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.cta-section {
    padding-block: var(--space-5);
    background: var(--gray-900);
    color: var(--gray-300);
    text-align: center;
}

.cta-content {
    max-width: 640px;
    margin: 0 auto;
}

.cta-content h2 {
    color: var(--gray-0);
}

.cta-content p {
    margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------
   Product card (listings, home sections, scrollers)
   --------------------------------------------------------------------- */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
}

/* Photo: square, rounded; a slow zoom and a crossfade to the second photo on hover */
.product-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--motion-reveal) var(--ease-out),
                opacity var(--motion-enter) var(--ease-out);
}

.product-card:hover .product-image {
    transform: scale(1.04);
}

.product-image-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.product-card:hover .has-second-image .product-image-hover {
    opacity: 1;
}

/* After a colour thumbnail is chosen the photo stays on that colour */
.product-card.has-swatch-choice .product-image-hover {
    display: none;
}

/* main.js fades the photo out, swaps it, then fades it back in */
.product-image-main.is-swapping {
    opacity: 0;
    transition: transform var(--motion-reveal) var(--ease-out),
                opacity var(--motion-exit) var(--ease);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--gray-300);
    font-size: 2.5rem;
}

/* Labels on the photo: Save X% / Featured, stacked when both apply */
.product-flags {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.product-flag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-sm);
}

.product-flag-sale {
    background: var(--gray-900);
    color: var(--text-inverse);
}

/* Quick view on its own (not inside .product-flags) still sits top left */
.qv-flag {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
}

.quick-view-btn {
    position: absolute;
    left: 50%;
    bottom: var(--space-3);
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity var(--motion-enter) var(--ease-out),
                transform var(--motion-enter) var(--ease-out);
}

.product-card:hover .quick-view-btn,
.quick-view-btn:focus-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Touch screens have no hover: keep a small icon button in the corner */
@media (hover: none) {
    .quick-view-btn {
        left: auto;
        right: var(--space-2);
        bottom: var(--space-2);
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        opacity: 1;
        transform: none;
    }

    .quick-view-label {
        display: none;
    }
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 4px;
    padding: var(--space-3) 2px 0;
}

.product-category {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
}

.product-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    line-height: 1.35;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Grids of product cards: borderless cards need a little more air between rows */
.product-grid {
    --gx: var(--space-3);
    --gy: var(--space-4);
}

@media (min-width: 768px) {
    .product-grid {
        --gx: var(--space-4);
        --gy: var(--space-5);
    }
}

/* Colour thumbnails: tap one to see the card in that colour */
.product-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.product-swatch {
    width: 26px;
    height: 26px;
    padding: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.product-swatch img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.product-swatch:hover {
    border-color: var(--gray-500);
    transform: scale(1.08);
}

.product-swatch.is-active {
    border-color: var(--gray-900);
    box-shadow: 0 0 0 1px var(--gray-900);
}

.product-swatch-more {
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-decoration: none;
}

.product-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-2);
}

.product-price-section {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 2px 0 0;
}

.product-price,
.current-price {
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    color: var(--text);
}

.compare-price,
.product-compare-price {
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-decoration: line-through;
}

/* Horizontal scroller of product cards with arrow buttons */
.horizontal-scroll-wrapper {
    position: relative;
}

.horizontal-scroll-container {
    display: flex;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.scroll-item {
    flex: 0 0 72%;
    scroll-snap-align: start;
}

@media (min-width: 576px) { .scroll-item { flex-basis: calc((100% - 1rem) / 2.2); } }
@media (min-width: 768px) { .scroll-item { flex-basis: calc((100% - 2rem) / 3.2); } }
@media (min-width: 1200px) { .scroll-item { flex-basis: calc((100% - 3rem) / 4.2); } }

.scroll-nav-btn {
    position: absolute;
    top: 40%;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: opacity var(--duration-fast) var(--ease);
}

.scroll-nav-btn svg {
    width: 18px;
    height: 18px;
}

.scroll-nav-btn-prev { left: -20px; }
.scroll-nav-btn-next { right: -20px; }

.scroll-nav-btn.disabled {
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 992px) {
    .scroll-nav-btn {
        display: flex;
    }
}

/* ---------------------------------------------------------------------
   Product listing pages
   --------------------------------------------------------------------- */
.products-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.products-header h1,
.products-header h2 {
    margin: 0;
    font-size: var(--text-xl);
}

.products-count {
    margin-left: var(--space-1);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--weight-normal);
}

.sort-dropdown .dropdown-item.active::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Collection / brand / company banner: text panel + photo */
.collection-banner {
    position: relative;
    display: flex;
    min-height: 280px;
    margin-bottom: var(--space-4);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--gray-900);
}

.collection-banner-left {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 60%;
    align-items: center;
    padding: var(--space-5) var(--space-4);
}

.collection-banner-right {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.collection-banner-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collection-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(28, 27, 25, 0.5), rgba(28, 27, 25, 0));
}

.collection-banner h1 {
    margin-bottom: var(--space-2);
    color: var(--gray-0);
    font-size: var(--text-2xl);
}

.collection-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 767.98px) {
    .collection-banner-left {
        flex-basis: 100%;
        padding: var(--space-4) var(--space-3);
    }

    .collection-banner-right {
        position: absolute;
        inset: 0;
    }

    .collection-banner-overlay {
        background: rgba(28, 27, 25, 0.65);
    }
}

/* Filter modal (product_list_base.html): sections, chips, rows, price */
.filter-button-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--gray-900);
    color: var(--text-inverse);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.modal-title .filter-button-count {
    margin-left: var(--space-1);
    vertical-align: 2px;
}

.filter-form.modal-body {
    padding-top: 0;
    padding-bottom: 0;
}

.filter-section {
    border-bottom: 1px solid var(--border);
}

.filter-section:last-of-type {
    border-bottom: 0;
}

.filter-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.filter-section-title::-webkit-details-marker {
    display: none;
}

/* Chevron that turns as the section opens */
.filter-section-title::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--duration) var(--ease);
}

.filter-section[open] > .filter-section-title::after {
    transform: translateY(1px) rotate(-135deg);
}

.filter-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.filter-section[open] > :not(summary) {
    animation: fade-up var(--motion-enter) var(--ease-out);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
}

.filter-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
    font-size: var(--text-sm);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--duration-fast) var(--ease),
                background-color var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease);
}

.filter-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-chip:hover {
    border-color: var(--gray-600);
}

.filter-chip:has(input:checked) {
    border-color: var(--gray-900);
    background: var(--gray-900);
    color: var(--text-inverse);
}

.filter-chip:has(input:focus-visible) {
    box-shadow: var(--focus-ring);
}

.filter-chip:has(input:checked) .filter-count {
    color: var(--gray-300);
}

.filter-rows {
    display: flex;
    flex-direction: column;
    max-height: 264px;
    margin: 0 calc(var(--space-2) * -1) var(--space-3);
    overflow-y: auto;
    scrollbar-width: thin;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.45rem var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    cursor: pointer;
}

.filter-row:hover {
    background: var(--surface-muted);
}

.filter-row input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--gray-900);
}

.filter-choice-label {
    min-width: 0;
}

.filter-row .filter-choice-label {
    flex: 1;
}

.filter-count {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.filter-price {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
}

.filter-price-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.filter-price-symbol {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: var(--text-sm);
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-price-field .form-control {
    padding-left: 1.75rem;
}

.filter-price-sep {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.filter-footer {
    justify-content: space-between;
}

.filter-footer .btn-primary {
    flex: 1;
    max-width: 240px;
}

/* Quick view modal (templates/includes/quick_view_modal.html, js/quick_view.js) */
.quick-view-modal {
    --qv-size: min(480px, calc((100vw - 2rem) / 2), calc(100dvh - 2rem));
    width: min(960px, calc(100vw - 2rem));
}

.quick-view-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 3;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.quick-view-body {
    min-height: 0;
    overflow-y: auto;
}

.quick-view {
    display: flex;
    min-height: var(--qv-size);
}

.qv-gallery {
    position: relative;
    flex: 0 0 var(--qv-size);
    width: var(--qv-size);
    height: var(--qv-size);
    overflow: hidden;
    background: var(--surface-muted);
    outline-offset: -3px;
    touch-action: pan-y;
}

.qv-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--motion-enter) var(--ease-out);
    user-select: none;
    -webkit-user-drag: none;
}

.qv-slide.is-active {
    opacity: 1;
}

.qv-no-image {
    position: absolute;
    inset: 0;
}

.qv-flag {
    z-index: 2;
}

.qv-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity var(--duration) var(--ease);
}

.qv-arrow-prev { left: var(--space-2); }
.qv-arrow-next { right: var(--space-2); }

.qv-gallery:hover .qv-arrow,
.qv-arrow:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .qv-arrow { opacity: 0.9; }
}

.qv-dots {
    position: absolute;
    bottom: var(--space-2);
    left: 50%;
    z-index: 2;
    display: flex;
    padding: 2px 4px;
    border-radius: var(--radius-full);
    background: rgba(28, 27, 25, 0.28);
    transform: translateX(-50%);
}

/* 24px target, 8px visible dot */
.qv-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
}

.qv-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.5;
    transform: scale(0.85);
    transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.qv-dot.is-active::before {
    opacity: 1;
    transform: scale(1.1);
}

.qv-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    max-height: var(--qv-size);
    padding: var(--space-5) var(--space-4) var(--space-4);
    overflow-y: auto;
}

.qv-title {
    margin: 0;
    padding-right: var(--space-4);
    font-size: var(--text-xl);
}

.qv-info .price-wrapper {
    margin: 0;
}

.qv-info .current-price {
    font-size: var(--text-lg);
}

.qv-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.qv-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.qv-option {
    margin: 0;
    padding: 0;
    border: 0;
}

.qv-option .variant-label {
    padding: 0;
}

.qv-option-chosen {
    font-weight: var(--weight-normal);
    color: var(--text-secondary);
}

.qv-option .variant-value {
    padding: 0.4rem 0.75rem;
}

.qv-stock {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: #a06c0b;
}

.qv-buy {
    display: flex;
    gap: var(--space-2);
}

.qv-buy .quantity-selector {
    flex: 0 0 118px;
}

.qv-add {
    flex: 1;
    min-width: 0;
}

.qv-details-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: auto;
    padding-top: var(--space-2);
    font-size: var(--text-sm);
}

.quick-view-error {
    padding: var(--space-5) var(--space-4);
}

/* Phones and small tablets: one column, the whole sheet scrolls */
@media (max-width: 767.98px) {
    .quick-view-modal {
        --qv-size: 100%;
        width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .quick-view {
        flex-direction: column;
        min-height: 0;
    }

    .qv-gallery {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .qv-info {
        max-height: none;
        overflow: visible;
        padding: var(--space-3);
    }

    .quick-view-body {
        max-height: calc(100dvh - 1rem);
    }
}

/* ---------------------------------------------------------------------
   Product detail
   --------------------------------------------------------------------- */
.product-gallery {
    position: sticky;
    top: 140px;
}

.main-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    margin-bottom: var(--space-2);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
    cursor: zoom-in;
}

.main-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-image-wrapper.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    cursor: default;
}

.thumbnail-grid {
    display: flex;
    gap: var(--space-2);
    padding: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.thumbnail {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main photo with the quick view arrows and dots laid over it */
.gallery-stage {
    position: relative;
    margin-bottom: var(--space-2);
    touch-action: pan-y;
}

.gallery-stage .main-image-wrapper {
    margin-bottom: 0;
}

.gallery-stage:hover .qv-arrow,
.lightbox .qv-arrow {
    opacity: 1;
}

.thumbnail:hover {
    border-color: var(--gray-400);
}

.thumbnail.active {
    border-color: var(--gray-900);
    box-shadow: 0 0 0 1px var(--gray-900);
}

.product-info .product-title {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.price-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    margin: var(--space-2) 0 var(--space-3);
}

.product-info .current-price {
    font-size: var(--text-lg);
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-3);
}

.short-description {
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.stock-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
}

.stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.stock-indicator.stock-in { background: var(--success-text); }
.stock-indicator.stock-low { background: #c98a12; }
.stock-indicator.stock-out { background: var(--danger-text); }

.stock-text {
    font-weight: var(--weight-medium);
}

.variant-section {
    margin: var(--space-3) 0;
}

.variant-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.variant-values {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.variant-value {
    min-width: 44px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--text-sm);
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: border-color var(--duration-fast) var(--ease);
}

.variant-value:hover {
    border-color: var(--gray-600);
}

.variant-value.selected {
    border-color: var(--gray-900);
    background: var(--gray-900);
    color: var(--text-inverse);
}

.variant-value.disabled {
    color: var(--gray-400);
    text-decoration: line-through;
    cursor: not-allowed;
}

.colour-swatch {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    cursor: pointer;
}

.colour-swatch.selected {
    border-color: var(--gray-900);
    box-shadow: 0 0 0 1px var(--gray-900);
}

.colour-swatch.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.colour-swatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.colour-swatch-label {
    margin-top: 3px;
    font-size: var(--text-xs);
    line-height: 1.2;
    text-align: center;
}

.colour-meta-panel {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.colour-meta-panel .meta-item {
    display: inline-block;
    margin-right: var(--space-3);
}

.colour-meta-panel .meta-label {
    color: var(--text);
    font-weight: var(--weight-medium);
}

.quantity-selector {
    display: flex;
    align-items: stretch;
    height: 46px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.quantity-btn {
    width: 40px;
    border: 0;
    background: var(--surface);
    color: var(--text);
    font-size: 1.125rem;
}

.quantity-btn:hover {
    background: var(--surface-muted);
}

.quantity-input {
    flex: 1;
    width: 48px;
    min-width: 0;
    border: 0;
    text-align: center;
    font-weight: var(--weight-medium);
}

.quantity-input:focus {
    outline: none;
}

#sizeQtyTable th {
    font-size: var(--text-xs);
}

#sizeQtyTable td {
    font-size: var(--text-sm);
}

.qty-input-cell input {
    width: 64px;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
}

.share-btn:hover {
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
}

/* Inline status line under the add-to-cart button */
.status-message {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.status-message.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.status-message.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.status-message.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }

/* Lightbox image zoom (product detail) */
#lightboxImg {
    transition: transform var(--duration-slow) var(--ease);
    cursor: zoom-in;
}

#lightboxImg.zoomed {
    transform: scale(1.6);
    transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
    cursor: zoom-out;
}

/* Clear the sticky header when "#reviews" scrolls the tabs into view (same offset as .product-gallery);
   the browser's own jump lands on the panel, so it also leaves room for the tab row */
.product-page .tabs {
    scroll-margin-top: 140px;
}

.product-page .tab-panel {
    scroll-margin-top: 200px;
}

/* Star line on product cards (product_card.html) */
.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0 0 var(--space-1);
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* Reviews (includes/product_reviews.html) */
.review-summary-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
}

.review-summary-link:hover {
    color: var(--text);
}

.review-score {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.review-score-value {
    font-size: 2.5rem;
    font-weight: var(--weight-semibold);
    line-height: 1;
}

.review {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.review:first-child {
    padding-top: 0;
}

.review-title {
    margin: var(--space-2) 0 var(--space-1);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

/* Phones only: price and button once the buy box has scrolled away (product_detail.html) */
.sticky-buy {
    display: none;
}

@media (min-width: 768px) {
    .gallery-stage .qv-dots {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .product-gallery {
        position: static;
    }

    .product-gallery .thumbnail-grid {
        display: none;
    }

    .product-page {
        padding-bottom: 4.5rem;
    }

    .sticky-buy {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: var(--z-sticky);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: var(--surface);
        visibility: hidden;
        transform: translateY(100%);
        transition: transform var(--motion-exit) var(--ease-out), visibility 0s linear var(--motion-exit);
    }

    .sticky-buy.is-visible {
        visibility: visible;
        transform: none;
        transition: transform var(--motion-enter) var(--ease-out);
    }

    .sticky-buy-price {
        font-weight: var(--weight-semibold);
    }
}

/* ---------------------------------------------------------------------
   Cart and checkout
   --------------------------------------------------------------------- */
.cart-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item-img,
.cart-item-img-placeholder {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    background: var(--surface-muted);
    object-fit: cover;
}

.cart-item-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.cart-item-body {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    overflow: hidden;
    font-weight: var(--weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-variant {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.cart-item-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
}

.cart-item-price {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.cart-item-total {
    margin-left: auto;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.qty-stepper {
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.qty-stepper button {
    width: 30px;
    border: 0;
    background: var(--surface);
    color: var(--text);
    line-height: 1;
}

.qty-stepper button:hover {
    background: var(--surface-muted);
}

.qty-stepper input {
    width: 40px;
    border: 0;
    border-inline: 1px solid var(--border);
    font-size: var(--text-sm);
    text-align: center;
}

.qty-stepper input:focus {
    outline: none;
}

.cart-remove-btn {
    padding: 4px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
}

.cart-remove-btn:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.cart-discount-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.cart-discount-tag-remove {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    line-height: 1;
}

/* Address choice cards on checkout */
.address-card {
    display: block;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease);
}

.address-card:hover {
    border-color: var(--gray-400);
}

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

/* Order summary box (cart, checkout, confirmation) */
.summary-box {
    padding: var(--space-4);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------------
   Auth pages (allauth) and info pages
   --------------------------------------------------------------------- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: var(--space-5) var(--page-gutter);
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card .card-body {
    padding: var(--space-4);
}

.auth-card h1 {
    margin-bottom: var(--space-2);
    font-size: var(--text-xl);
}

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

.cta-section .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray-0);
}

/* ---------------------------------------------------------------------
   Product detail: extras
   --------------------------------------------------------------------- */
#mainImage {
    transition: opacity var(--duration-fast) var(--ease);
}

#mainImage.is-changing {
    opacity: 0;
}

.colour-swatch-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

/* Merchant-written HTML (product descriptions, text blocks) */
.rich-text {
    max-width: 75ch;
}

.rich-text img {
    height: auto;
}

.rich-text table {
    width: 100%;
    margin: var(--space-3) 0;
    font-size: var(--text-sm);
}

.rich-text th,
.rich-text td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.rich-text th {
    background: var(--surface-muted);
    color: var(--text-secondary);
}

/* Contact page: icon + label + value rows */
.contact-list li {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.contact-list li:last-child {
    margin-bottom: 0;
}

.contact-list .icon {
    margin-top: 0.2em;
    color: var(--text-muted);
}

.contact-list strong {
    display: block;
    font-size: var(--text-sm);
}

.contact-list span {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* Account management pages (allauth layouts/base.html) */
.account-menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0 0 var(--space-4);
    padding: 0 0 var(--space-2);
    border-bottom: 1px solid var(--border);
    list-style: none;
}

.account-menu a {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.account-menu a:hover {
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
}

.account-content {
    max-width: 640px;
}

