/* Responsive lead text for homepage */
.home-lead-text {
    font-size: clamp(1rem, 2vw, 1.5rem) !important;
}
.navbar .nav-link{color:var(--text-primary);}
.navbar .nav-link:hover{color:var(--link-accent);}
.navbar .site-title{font-weight:600}
/* Page background and base text color: let schemes control the page background */
/* Fallbacks provided so the site remains readable if a scheme omits tokens */
body{
    background: var(--background, #ffffff) !important;
    color: var(--text-primary, #111111) !important;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

/* Navbar user dropdown badge overlay (placed after the toggle in the DOM) */
.dropdown.position-relative {
    /* ensure positioned ancestor for absolute badge */
    position: relative;
}
.nav-dropdown-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 1050; /* above dropdown toggle but below any global toasts */
    font-size: 0.65rem;
    line-height: 1;
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    transform: translate(30%, -30%);
    display: inline-block;
}

/* Slightly reduce the badge on very small screens so it doesn't obscure text */
@media (max-width: 420px) {
    .nav-dropdown-badge { top: 4px; right: 6px; font-size: 0.6rem; padding: 0.18rem 0.36rem; }
}

/* Ensure any 'muted' token maps to the theme's text-accent token so
    muted text follows the active color scheme consistently. The schemes
    may define --text-muted; override it here to point at --text-accent.
*/
body{ --text-muted: var(--text-accent); }

/* Also provide a direct utility class so templates using .text-muted
    immediately get the theme's accent color. */
.text-muted{ color: var(--text-accent) !important; }

/* Ensure the main site container and its inner container inherit the page background
   and allow surface elements (cards/pills) to use --card-surface as intended. */
.site-container,
.site-container .container,
main,
.content{
    background: transparent; /* keep content canvas transparent so body controls background */
}
/* Ensure scheme colors override Bootstrap utility classes (like .text-white) */
/* Bootstrap's .text-white uses !important; we replicate specificity and use !important
    so theme variables control the visible colors inside our header and content. */
.nav-surface .nav-link,
.nav-left .nav-link,
.nav-right .nav-link,
.navbar .nav-link,
.nav-right .dropdown-toggle,
.cart-icon,
.nav-surface,
.site-container,
.site-container a{
    color: var(--text-primary) !important;
}
.nav-surface .nav-link:hover,
.navbar .nav-link:hover,
.site-container a:hover{
    color: var(--link-accent) !important;
}
.btn-outline-light{border-color:rgba(255,255,255,0.6);color:white}
.btn-outline-light:hover{color:var(--accent)}

/* Nav row (flex-based) and centered logo */
.navbar{position:fixed;top:0;left:0;right:0;padding-top:0.25rem;padding-bottom:0.25rem;margin-top:20px;z-index:1100}

/* Hero section styles (site homepage) */

.hero {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 100vw;
    aspect-ratio: 16/7.5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    z-index: 1;
}

.hero::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25));
    z-index:0;
}
/* Utility: allow long emails/phones to wrap inside cards */
.break-word{overflow-wrap:anywhere;word-break:break-word}
.hero .hero-content{
    position: relative;
    z-index: 1;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}


/* Logo sizing and crop */
.logo-link{display:inline-block;width:112px;height:112px;margin-top: -20px;hidden;border-radius:999px;border:4px solid rgba(255,255,255,0.14);background:var(--background);box-sizing:content-box;position:relative}
.logo-img{width:100%;height:100%;object-fit:cover;object-position:50% 22%;display:block}

/* Mini-nav spacing */
.left-mini-nav .nav-link, .right-mini-nav .nav-link{padding-left:.5rem;padding-right:.5rem}

/* Mobile collapsed menu visual */
.bg-contrast{background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.04)}

/* Responsive logo sizes */
@media (max-width: 991.98px){
    .logo-link{margin-top:-30px}
    
}

@media (max-width: 767.98px){
    .logo-link{margin-top:-36px}
    
}

/* Flex-based nav row */
.nav-row{display:flex;align-items:center;justify-content:space-between}
.nav-left,.nav-right{flex:1}
.nav-center{flex:0 0 auto;text-align:center}

/* ensure left/right mini-navs render horizontally */
.nav-left .navbar-nav{flex-direction:row;align-items:center}
.nav-left .navbar-nav .nav-item{margin-right:.5rem}
/* right-side auth links */
.nav-right{display:flex;align-items:center;justify-content:flex-end;position:relative}
.nav-right .navbar-nav{flex-direction:row;align-items:center}
.nav-right .navbar-nav .nav-item{margin-left:.4rem}

/* Nav surface (pill) */

.nav-surface{background:var(--card-surface);padding:4px 30px;border-radius:999px;display:inline-flex;align-items:center;gap:34px;box-shadow:0 6px 18px rgba(0,0,0,0.08);position:relative;min-width:440px}

    body{padding-top:1rem}
    .site-container{padding-top:3.75rem}
/* Small-screen navbar spacing: keep side padding internal (nav-surface)
   and keep bottom spacing external on the navbar so the centered logo
   doesn't overlap navigation items. User requested less side padding and
   more bottom spacing. */
@media (max-width: 767.98px){
    /* remove left/right padding from the fixed navbar itself */
    /* keep nav-surface as the internal padded pill; further reduce horizontal
       padding so it fits better on narrow screens */
    .nav-surface{
        padding-left: 6px;
        padding-right: 6px;
        gap: 40px;
        min-width: unset; /* allow it to shrink rather than forcing overflow */
    }

    /* ensure the site content still accounts for the fixed nav height.
       Add top padding to the body so the fixed navbar doesn't overlap
       page content on small screens. */
    body{padding-top:3rem}
    .site-container{padding-top:3.75rem}

    /* Reduce spacing between left-side nav items (Store / Contact) */
    .nav-left .navbar-nav .nav-item{
        margin-right: .2rem !important; /* was .5rem */
    }

    /* Increase gap between basket and user dropdown on the right so the
       centered logo appears visually centered between left and right groups. */
    .nav-right > div:first-child{
        margin-right: 1.3rem !important;
        margin-left: .2rem /* increases gap after cart */
    }
}

/* Make room for the logo overlap */
.site-container{padding-top:3.75rem}

/* place logo absolutely so it visually overlaps but doesn't increase nav height */
.nav-center{position:relative}
.nav-center .logo-link{position:absolute;left:50%;transform:translateX(-50%);top:-30px}

@media (max-width: 991.98px){
    .nav-center .logo-link{top:-24px}
}

@media (max-width: 767.98px){
    .nav-center .logo-link{top:-18px}
    .dropdown-toggle{margin-right: 10px;}
    .account-label{display:none}
    .dropdown-toggle .fa-icon{margin-right:0}
    .dropdown-toggle{padding-left:8px;padding-right:8px}
}

/* On small screens show only the user icon for the account dropdown */
@media (max-width: 767.98px){
}
@media (max-width: 575.98px) {
    .p-3{padding: 0 !important;}
}
/* Note: keep nav-surface min-width consistent across sizes so it doesn't shrink */

/* Ensure dropdowns inside the right nav align to the right edge */
.nav-right .dropdown-menu{right:0;left:auto;transform-origin:top right;z-index:3000}
/* Use theme variables for dropdown background and items */
.nav-right .dropdown-menu,
.dropdown-menu{
    background: var(--background) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(0,0,0,0.06);
}
.dropdown-menu .dropdown-item{color:var(--text-primary) !important}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus{
    background: color-mix(in srgb, var(--link-accent) 18%, transparent) !important;
    color:var(--text-primary) !important;
}

/* Account dropdown will use the shared .button-primary utility for styling */

/* prevent nav links wrapping inside the pill */
.nav-surface .nav-left .nav-link,
.nav-surface .nav-right .nav-link { white-space:nowrap }

/* Keep theme and buttons styling */
.nav-content .nav-link{color:var(--text-primary);}
.nav-content .nav-link:hover{color:var(--link-accent)}
.nav-surface .navbar-toggler{border-color:rgba(255,255,255,0.08)}
.nav-surface .btn-light{background:white;color:var(--link-accent)}

/* cart icon next to user */
.cart-icon svg{display:block;width:22px;height:22px}
.cart-icon{display:inline-flex;align-items:center;justify-content:center;padding:6px;border-radius:6px}
.cart-icon:hover{background:rgba(255,255,255,0.06);text-decoration:none}
/* Small numeric badge shown when basket has items */
.cart-badge{
    position:absolute;
    top:2px;
    right:2px;
    transform: translate(30%,-30%);
    background: var(--accent, #dc3545);
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.65rem;
    line-height: 1;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    pointer-events: none;
}



/* Debug center guides removed */

/* Font Awesome icon sizing helpers */
.fa-icon{font-size:18px;line-height:1;vertical-align:middle}
.cart-icon .fa-icon{font-size:20px}

/* Form controls inside cards should match the card surface and use theme tokens */
.card .form-control,
.card input[type="text"],
.card input[type="password"],
.card input[type="email"],
.card select.form-control,
.card textarea.form-control{
    background-color: var(--card-surface, #fff) !important;
    background-image: none !important;
    background-clip: padding-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    color: var(--text-primary, #111) !important;
    border: 1px solid var(--text-primary, rgba(0,0,0,0.08)) !important;
    box-shadow: none !important;
    border-radius: .6rem !important; /* rounded inputs */
    padding: .5rem .75rem !important;
}

/* Cross-template helpers: keep the price input / pound sign and the
   featured toggle alignment consistent across create/edit/list pages.
   These were previously duplicated inside templates; defining them here
   ensures any manual tweaks (left margin, scale) apply everywhere. */
.price-with-pound { position: relative; display: block; width: 100%; }
.price-with-pound .pound { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-primary); pointer-events: none; opacity: 0.95; font-weight: 500; z-index: 3; font-size: 0.95rem; }
.price-with-pound .price-input, .price-with-pound input { padding-left: 52px !important; background: transparent; color: var(--text-primary); border: 1px solid var(--text-primary); border-radius: .375rem; min-width: 0; box-sizing: border-box; position: relative; z-index: 1; font-size: 0.95rem; width:100% !important; }
.price-with-pound .pound { z-index:3 !important; left:14px !important; }

/* Reusable featured toggle column helper used in listing create/edit pages */
.featured-toggle-col { min-width: 75px; min-height: 52px; padding:6px 6px 4px 6px; box-sizing:border-box; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; }
.featured-toggle-col .form-label { font-size:0.95rem; margin-bottom:0.25rem; line-height:1; }
.featured-toggle-col .form-switch { display: inline-block; margin-top: 0.2rem; padding-left: 0.5em; }
.featured-toggle-col .form-check-input, .featured-toggle-col .form-switch input.form-check-input { transform: scale(1.18); transform-origin: left center; margin-left: 0.12rem; }

/* Small fixed-width price box used in store list cards */
.price-box { display:inline-block; width:66px; text-align:center; }

/* Visually hide the scrollbar on listing notes textareas but keep scrolling
   functionality and keyboard focus. Targets both rendered form widgets (by
   name) and any element using .notes-textarea if added later. */
textarea[name="release_notes"], textarea.notes-textarea {
    overflow-y: auto; /* keep vertical scrolling enabled */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding-right: 6px; /* ensure text doesn't get clipped where scrollbars would be */
}
/* WebKit-based browsers: hide the scrollbar track/thumb but preserve scrolling */
textarea[name="release_notes"]::-webkit-scrollbar,
textarea.notes-textarea::-webkit-scrollbar {
    width: 0; height: 0; display: none;
}


/* Ensure selects inside cards inherit theme colors even when the widget
   isn't rendered with the .form-control class (some Django widgets omit it) */
.card select{
    background-color: var(--card-surface, #fff) !important;
    color: var(--text-primary, #111) !important;
    border: 1px solid var(--text-primary, rgba(0,0,0,0.08)) !important;
    padding: .45rem .7rem !important;
    border-radius: .6rem !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.card select option{
    color: var(--text-primary, #111) !important;
}

/* Ensure the entire card surface follows the active color scheme so cards
   (including manage landing/search cards) match themed surfaces. */
.card{
    background: var(--card-surface, #fff) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: .8rem !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.card .card-body{background: transparent !important;}

/* If a themed primary-style button is placed next to the input, ensure it
   visually matches the card surface and doesn't appear as a separate white
   block. Small adjustments for input-group usage. */
.input-group .button-primary{
    margin-left: .5rem;
    border-radius: .6rem !important;
    padding-left: .65rem !important;
    padding-right: .65rem !important;
}

/* Make list-group items inside cards follow the card surface and text colors */
.card .list-group-item{
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
}
.card .list-group-item:hover{
    background: color-mix(in srgb, var(--link-accent) 12%, transparent) !important;
}

/* Labels inside cards should match text color */
.card .form-label,
.card label{color:var(--text-primary) !important}

/* Autofill overrides (Chrome) - force background and text color to match scheme */
.card input:-webkit-autofill,
.card input:-webkit-autofill:focus,
.card input:-webkit-autofill:hover{
    -webkit-text-fill-color: var(--text-primary, #111) !important;
    box-shadow: 0 0 0px 1000px var(--card-surface, #fff) inset !important;
}

.card .form-control:focus,
.card input:focus,
.card textarea:focus,
.card select:focus{
    border-color: var(--link-accent) !important;
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--link-accent) 20%, transparent) !important;
    outline: none !important;
}

/* Slightly dim placeholder text to match muted tokens if available */
.card ::placeholder{color:var(--text-muted, rgba(0,0,0,0.45))}

/* Themed button utility (.button-primary) is used instead of a specific .card .btn-primary rule */

/* Reusable primary button utility that follows the active theme.
   Apply `.button-primary` to any <button> or <a> to get the themed primary style. */
.button-primary{
    background: var(--background) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--text-primary) !important;
    padding: .45rem .85rem !important;
    border-radius: .6rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.button-primary:hover,
.button-primary:focus{
    background: var(--text-primary) !important;
    color: var(--background) !important;
    border-color: var(--background) !important;
    text-decoration: none !important;
}

/* Themed form controls: ensure store filters and manage inputs (price/stock)
   follow the active color scheme. Applies to normal and small inputs. */
.form-control,
.form-select,
.form-control-sm,
input[type="number"],
textarea.form-control{
    background: var(--card-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent) !important;
    box-shadow: none !important;
}
.form-control::placeholder,
.form-select::placeholder{
    color: var(--text-accent) !important;
}
.form-control:focus,
.form-select:focus{
    border-color: var(--link-accent) !important;
    box-shadow: 0 0 0 0.12rem color-mix(in srgb, var(--link-accent) 18%, transparent) !important;
    outline: none !important;
}

/* small numeric inputs sometimes use spinner controls; ensure the visible part
   still matches the theme */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{
    opacity: 0.6;
}

/* Utility classes to map markup to theme tokens used in templates */
.bg-surface {
    background: var(--card-surface) !important;
    color: var(--text-primary) !important;
}
.text-primary {
    color: var(--text-primary) !important;
}
/* Accent surface helpers that follow the active color scheme */
.bg-accent {
    background: var(--link-accent) !important;
    color: var(--background) !important;
}
.text-flag-shipped { color: var(--link-accent) !important; font-weight:600 }

/* Dashboard / table theming: ensure tables follow the active scheme */
.table-responsive{
    /* Use the themed card surface for table containers so dashboard
       tables sit on the site's surface color. Keeps text colors from
       changing (handled by .table rules) while ensuring the table
       background matches the active scheme. */
    background: var(--card-surface, #ffffff) !important;
    padding: .6rem !important; /* provide a small inner gutter */
    border-radius: .6rem !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04) !important;
}
.table{
    background: transparent !important;
    color: var(--text-primary) !important;
}
.table th, .table td{
    color: var(--text-primary) !important;
    /* Use the link-accent token for clearer separation between rows/columns */
    border-color: color-mix(in srgb, var(--link-accent) 18%, transparent) !important;
        border-style: solid !important;
        border-width: 1.5px !important; /* slightly thicker than default */
}

/* Ensure table cells don't render with a white background (Bootstrap defaults).
   Use transparent so the surrounding .table-responsive surface shows through. */
.table th, .table td, .table thead, .table tbody, .table thead th, .table tbody td, .table tr{
    background: transparent !important;
}
.table thead th{
    /* Stronger accent for the header divider */
    border-bottom-color: var(--link-accent) !important;
        border-bottom: 3px solid var(--link-accent) !important;
    
}

/* Small chevron toggle used in the orders table next to the order number */
.toggle-details{
    color: var(--link-accent) !important;
    background: transparent !important;
    border: none !important;
    padding: 0.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: .45rem !important;
    min-width: 30px !important;
    min-height: 30px !important;
    box-sizing: border-box !important;
}
.toggle-details:hover,
.toggle-details:focus{
    background: color-mix(in srgb, var(--link-accent) 16%, transparent) !important;
    color: var(--background) !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
}
.toggle-details:focus-visible{
    box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--link-accent) 22%, transparent) !important;
}
.toggle-details svg.chev{
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    transition: transform .18s ease, color .12s ease;
    color: var(--link-accent) !important;
}
.toggle-details[aria-expanded="true"] svg.chev{
    transform: rotate(180deg);
    color: var(--background) !important;
}

/* Small-screen: stack the order number and chevron so the chevron appears
   beneath the number instead of to its right. This improves touch targets
   on narrow devices and keeps layout tidy. */
@media (max-width: 575.98px) {
    /* More specific small-screen rule to prevent Bootstrap overrides */
    .table.table-sm td > .toggle-details,
    .table-responsive .table.table-sm td > .toggle-details {
        display: block !important;
        margin-left: 0 !important; /* override ms-2 */
        margin-top: 0.35rem !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }
    /* Ensure the number and button align left in the cell */
    .table td > span {
        display: inline-block;
    }
}

/* Spacing for the shipped checkbox to give a little breathing room from the table edge */
/* Use a more specific selector and !important so layout frameworks won't override */
/* .table.table-sm td .form-check-input.row-shipped,
.table-responsive .table.table-sm td .form-check-input.row-shipped{
    margin-right: 0.6rem !important;
} */

/* On small screens, nudge the shipped checkbox upward so it visually aligns with
   the paid badge and other cells (improves vertical alignment when rows wrap). */
@media (max-width: 575.98px) {
    .table.table-sm td .form-check-input.row-shipped,
    .table-responsive .table.table-sm td .form-check-input.row-shipped{        
        margin-top: -0.35rem !important; /* lift a little to align with badge */
        vertical-align: middle !important;
    }
}

/* Last-resort override: sometimes other resets or later-loaded stylesheets
   set margins on inputs/buttons with broader selectors. To guarantee the
   shipped checkbox keeps the intended spacing on narrow screens we add a
   highly-specific selector placed at the end of the stylesheet. Keep
   the values consistent with the small-screen rules above. */
@media (max-width: 575.98px) {
    body .table.table-sm td > .form-check-input.row-shipped,
    body .table.table-sm td .form-check-input.row-shipped,
    body .table-responsive .table.table-sm td > .form-check-input.row-shipped,
    body .table-responsive .table.table-sm td .form-check-input.row-shipped {        
        margin-top: -3rem !important;
        vertical-align: middle !important;
    }
}

/* Themed outline secondary button fallback so list actions use site tokens */
.btn-outline-secondary{
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent) !important;
}
.btn-outline-secondary:hover{
    background: color-mix(in srgb, var(--link-accent) 14%, transparent) !important;
    color: var(--text-primary) !important;
}

/* Small variant for button-primary used in tables */
.button-primary.btn-sm{padding:.25rem .5rem;font-size:.85rem}
.list-group-item.bg-surface {
    background: var(--card-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255,255,255,0.04) !important;
}

/* Discogs/search result card styling that follows scheme tokens */
.search-card{
    background: var(--card-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border, rgba(0,0,0,0.06));
}
.search-thumb{height:200px;object-fit:cover;object-position:center top}
.search-meta{color:var(--text-primary) !important}

/* Highlight marker inserted for manual cleanup of Discogs notes */
.remove-highlight{
    background: color-mix(in srgb, var(--link-accent) 30%, transparent);
    padding: 0.05rem 0.35rem;
    border-radius: 0.35rem;
    color: var(--text-primary) !important;
    font-weight: 600;
}

/* Full-screen image viewer styles */
.image-viewer{position:fixed;inset:0;z-index:12000;display:flex;align-items:center;justify-content:center;pointer-events:none}
.image-viewer .iv-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.75);pointer-events:auto}
.image-viewer .iv-inner{position:relative;max-width:100vw;pointer-events:auto;display:flex;align-items:stretch;justify-content:center;padding:8px 6px;height:100vh;box-sizing:border-box}
.image-viewer .iv-stage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:100%}
.image-viewer .iv-img-wrap{
    position:relative;
    width:100%;
    max-width: calc(100vw - 40px);
    /* allow the wrapper to use remaining vertical space inside iv-stage */
    flex: 1 1 auto;
    min-height: 40vh;
    display:flex; /* allow centering via flex */
    align-items:center;
    justify-content:center;
    overflow:hidden;
    box-sizing:border-box;
}
.image-viewer .iv-img{
    /* Image should scale to fill the wrapper while preserving aspect ratio */
    position:relative;
    display:block;
    margin:0 auto;
    width:auto; height:auto;
    max-width:90vw;
    /* Prefer filling the wrapper height exactly so the image uses available vertical space */
    height:100%;
    max-height:none;
    object-fit:contain;
    border-radius:6px;
    box-shadow:0 12px 40px rgba(0,0,0,0.6);
    background:var(--card-surface);
}

/* Make the viewer navigation and close buttons match the site's primary
   button styling and be a bit larger for easier tapping. */
.image-viewer .iv-prev,
.image-viewer .iv-next,
.image-viewer .iv-close{
    background: var(--background) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--text-primary) !important;
    padding: .6rem 1rem !important;
    border-radius: .6rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-size: 1.6rem !important;
    line-height: 1 !important;
    min-width: 50px !important;
    height: 50px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.image-viewer .iv-prev:hover,
.image-viewer .iv-next:hover,
.image-viewer .iv-close:hover,
.image-viewer .iv-prev:focus,
.image-viewer .iv-next:focus,
.image-viewer .iv-close:focus{
    background: var(--text-primary) !important;
    color: var(--background) !important;
    border-color: var(--background) !important;
    outline: none !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

/* Slightly offset the close button so it visually aligns with larger size */
.image-viewer .iv-inner .iv-close{ position:absolute; right:14px; top:14px; z-index:13001; padding:.5rem .7rem; height:50px; min-width:50px }

/* increase counter size for readability */
.image-viewer .iv-counter{ font-size: 1.05rem !important; font-weight:600; color: var(--text-muted) !important; padding: 0 .25rem }

/* temporary reset animation class used when snapping back to center */
.image-viewer .iv-img.iv-resetting{ transition: transform .22s cubic-bezier(.2,.9,.2,1) !important; }

    /* keep will-change for smoother animations */
    .image-viewer .iv-img{ will-change: transform; }
.image-viewer.d-none{display:none}

/* position close button at the top-right of the viewer inner area */
.image-viewer.d-none{display:none}

/* ensure controls are visible and not clipped */
.image-viewer .iv-controls{z-index:13000;flex:0 0 auto;margin-top:12px}

/* When zoomed, make cursor indicate draggable area */
.image-viewer .iv-img-wrap.zoom-active{cursor:grab}
.image-viewer .iv-img-wrap.zoom-active:active{cursor:grabbing}

/* When zoomed, make cursor indicate draggable area */
.image-viewer .iv-img-wrap.zoom-active{cursor:grab}
.image-viewer .iv-img-wrap.zoom-active:active{cursor:grabbing}

/* Site toasts (client-side) */
#site-toasts.site-toasts{
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 14000;
    pointer-events: none; /* allow clicks through when empty */
}
.site-toast{
    pointer-events: auto;
    min-width: 220px;
    max-width: 420px;
    background: var(--card-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--text-primary) !important;
    padding: .6rem .75rem;
    border-radius: .65rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.16);
    display: flex;
    gap: .6rem;
    align-items: center;
    font-size: .95rem;
    line-height: 1.2;
}
.site-toast .toast-body{flex:1}
.site-toast .toast-close{background:transparent;border:none;color:var(--text-primary);font-size:1.05rem;padding:.2rem .4rem;border-radius:.45rem}
.site-toast.error{background: color-mix(in srgb, #dc3545 6%, var(--card-surface)) !important; border-color: color-mix(in srgb, #dc3545 14%, transparent) !important}
.site-toast.info{background: color-mix(in srgb, var(--link-accent) 6%, var(--card-surface)) !important; border-color: color-mix(in srgb, var(--link-accent) 14%, transparent) !important}

/* entrance animation */
.site-toast{-webkit-transform: translateY(6px) scale(.99); transform: translateY(6px) scale(.99); opacity:0; animation: toast-in .18s ease forwards}
@keyframes toast-in{ to { transform: translateY(0) scale(1); opacity:1 } }


/* Responsive adjustments for basket list on small screens
   - Stack the thumbnail + info and move controls (price/remove) under them
   - Keep desktop layout unchanged. */
@media (max-width: 767.98px) {
    .basket-list .list-group-item{
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .6rem !important;
    }

    /* Top row: thumbnail + info should sit side-by-side and fill width */
    .basket-list .b-item-main{
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: .75rem !important;
        width: 100%;
    }

    /* Make controls full width and appear below the main info */
    .basket-list .basket-controls{
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: .35rem !important;
        text-align: left !important; /* price on left, remove on right looks better on small screens */
        gap: .5rem;
    }

    /* Slightly smaller thumb on very small screens */
    .basket-list .basket-thumb img{ width:56px !important; height:56px !important; object-fit:cover !important; }

    /* Ensure the price stays readable and does not wrap awkwardly */
    .basket-list .basket-controls .fw-semibold{ font-size: 1rem !important; }

    /* Reduce the top margin for the remove button so it sits neatly in the controls row */
    .basket-list .basket-controls .btn{ margin-top: 0 !important; }
}







