/* Web fonts: Doran for Persian/Arabic glyphs and Urdu Typesetting for Latin glyphs.
   Place these files in artworks/static/artworks/fonts/:
   - Doran.ttf
   - UrduTypesetting.ttf
   Both fonts are loaded by the browser; visitors do not need to install them. */
@font-face {
    font-family: "SomaGalleryFont";
    src: url("../fonts/UrduTypesetting.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0000-024F, U+1E00-1EFF;
}
@font-face {
    font-family: "SomaGalleryFont";
    src: url("../fonts/Doran.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* =========================================================
   ART GALLERY — MOTION SYSTEM
   Subtle luxury motion: scroll reveals, parallax, cursor glow,
   card tilt, magnetic controls and page transitions.
========================================================= */

:root {
    --motion-wine: var(--wine);
    --motion-ease: cubic-bezier(.22, .61, .36, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

body.motion-page {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .75s var(--motion-ease), transform .75s var(--motion-ease);
}

body.motion-page.motion-loaded {
    opacity: 1;
    transform: none;
}

/* Scroll progress */
.motion-scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    z-index: 9999;
    pointer-events: none;
    transform-origin: right center;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--wine-dark), #a53a3c, var(--wine));
    box-shadow: 0 0 12px rgba(127, 20, 22, .28);
}

/* Cursor glow */
.motion-cursor-glow,
.motion-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transform: translate3d(-50%, -50%, 0);
    will-change: transform;
}

.motion-cursor-glow {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(127, 20, 22, .10) 0%, rgba(127, 20, 22, .035) 34%, rgba(127, 20, 22, 0) 72%);
    filter: blur(2px);
    transition: opacity .35s ease;
}

.motion-cursor-ring {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(127, 20, 22, .28);
    border-radius: 50%;
    mix-blend-mode: multiply;
    transition: width .25s ease, height .25s ease, border-color .25s ease, opacity .25s ease;
}

body.motion-cursor-active .motion-cursor-glow,
body.motion-cursor-active .motion-cursor-ring {
    opacity: 1;
}

body.motion-cursor-hover .motion-cursor-ring {
    width: 48px;
    height: 48px;
    border-color: rgba(127, 20, 22, .5);
}

/* Scroll reveal */
.motion-reveal {
    opacity: 0;
    transform: translateY(42px);
    transition: opacity .9s var(--motion-ease), transform .9s var(--motion-ease);
    transition-delay: var(--motion-delay, 0ms);
    will-change: opacity, transform;
}

.motion-reveal.motion-visible {
    opacity: 1;
    transform: none;
}

.motion-reveal.motion-from-right {
    transform: translateX(48px);
}

.motion-reveal.motion-from-left {
    transform: translateX(-48px);
}

.motion-reveal.motion-from-scale {
    transform: scale(.94);
}

.motion-reveal.motion-visible.motion-from-right,
.motion-reveal.motion-visible.motion-from-left,
.motion-reveal.motion-visible.motion-from-scale {
    transform: none;
}

/* Section headers get a little more editorial motion */
.section-header.motion-reveal .section-kicker,
.section-header.motion-reveal .section-title,
.section-header.motion-reveal .section-description {
    transition: opacity .75s var(--motion-ease), transform .75s var(--motion-ease);
}

/* Artwork / collection cards */
.artwork-card,
.collection-card,
.process-item,
.artist-visual,
.artist-content {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --lift: 0px;
}

.motion-tilt {
    transform: perspective(1100px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--lift));
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform .55s var(--motion-ease), box-shadow .55s var(--motion-ease);
}

.motion-tilt.motion-tilt-active {
    --lift: -7px;
    transition: transform .08s linear, box-shadow .2s ease;
}

.artwork-card.motion-tilt-active,
.collection-card.motion-tilt-active {
    box-shadow: 0 24px 60px rgba(31, 23, 18, .12);
}

/* Images breathe slightly on hover */
.artwork-card .artwork-image,
.collection-card img,
.artist-image,
.artwork-detail-image,
.gallery-main img {
    overflow: hidden;
}

.artwork-card .artwork-image img,
.collection-card img,
.artist-image img,
.gallery-main img {
    transition: transform 1.1s var(--motion-ease), filter .7s ease;
}

.artwork-card:hover .artwork-image img,
.collection-card:hover img,
.artist-visual:hover .artist-image img,
.gallery-main:hover img {
    transform: scale(1.035);
}

/* Floating hero layers */
.hero.motion-hero {
    isolation: isolate;
}

.hero.motion-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 18% 30%, rgba(255,255,255,.08), transparent 32%);
    opacity: .7;
}

.hero.motion-hero .hero-content,
.hero.motion-hero .hero-number {
    position: relative;
    z-index: 1;
}

.motion-parallax {
    will-change: transform;
}

/* Header motion */
.global-header {
    transition: background .45s ease, color .35s ease, border-color .45s ease, box-shadow .45s ease, transform .45s var(--motion-ease);
}

.global-header.is-scrolled {
    background: rgba(255, 255, 255, .90);
    color: var(--text);
    border-bottom-color: rgba(232, 226, 219, .9);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.global-header-home.is-scrolled {
    position: fixed;
    background: rgba(255, 255, 255, .90);
    color: var(--text);
    border-bottom-color: rgba(232, 226, 219, .9);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .06);
}

.global-header-home.is-scrolled .global-brand-sub,
.global-header-home.is-scrolled .global-nav a,
.global-header-home.is-scrolled .global-action,
.global-header-home.is-scrolled .global-cart {
    color: var(--text);
}

.global-header-home.is-scrolled .global-brand-dot {
    color: var(--wine);
}

.global-header-home.is-scrolled .global-register {
    background: var(--wine);
    color: #fff;
}

.global-header-home.is-scrolled .global-cart {
    border-color: #ddd6cf;
    color: var(--text);
}

.global-header-home.is-scrolled .global-cart-count {
    background: var(--wine);
    color: #fff;
}

/* Buttons subtly respond to hover */
.btn-primary,
.btn-outline,
.global-register,
.global-cart,
.view-artwork,
.global-action {
    will-change: transform;
}

.motion-magnetic {
    transition: transform .3s var(--motion-ease), background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* Prevent animation from becoming too much on small screens */
@media (max-width: 760px) {
    .motion-cursor-glow,
    .motion-cursor-ring {
        display: none;
    }

    .motion-reveal {
        transform: translateY(24px);
    }

    .motion-reveal.motion-from-right,
    .motion-reveal.motion-from-left {
        transform: translateY(24px);
    }

    .motion-tilt,
    .motion-tilt.motion-tilt-active {
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    body.motion-page {
        opacity: 1;
        transform: none;
    }

    .motion-reveal {
        opacity: 1;
        transform: none !important;
    }

    .motion-cursor-glow,
    .motion-cursor-ring,
    .motion-scroll-progress {
        display: none;
    }
}


/* AJAX cart feedback */
.site-toast {
    position:fixed; right:22px; bottom:22px; z-index:10000;
    display:flex; align-items:center; gap:10px; max-width:min(380px, calc(100vw - 32px));
    padding:13px 16px; border:1px solid var(--border); border-radius:14px;
    background:var(--white); color:var(--text); box-shadow:0 18px 55px rgba(20,15,10,.16);
    opacity:0; transform:translateY(18px) scale(.97); pointer-events:none;
    transition:opacity .3s ease, transform .3s var(--motion-ease); font-size:12px;
}
.site-toast.is-visible { opacity:1; transform:none; }
.site-toast-icon { width:24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--wine); color:#fff; font-weight:800; }
.cart-count-pop { animation:cartCountPop .45s var(--motion-ease); }
@keyframes cartCountPop { 50% { transform:scale(1.28); } }
.js-cart-action.is-loading, .js-cart-add.is-loading { opacity:.55; pointer-events:none; }
.js-cart-add.cart-added { box-shadow:0 0 0 7px color-mix(in srgb, var(--wine) 13%, transparent); }
.cart-item-removing { opacity:0; transform:translateX(35px) scale(.97) !important; transition:opacity .25s ease, transform .25s ease !important; }

@media (max-width:600px) { .site-toast { right:12px; bottom:12px; left:12px; max-width:none; } }

.quantity-value.is-changing {
    animation: quantityValuePop .28s cubic-bezier(.22,.61,.36,1);
}
.quantity-btn.is-disabled {
    opacity: .3;
    pointer-events: none;
}
@keyframes quantityValuePop {
    0% { transform: translateY(4px) scale(.82); opacity: .45; }
    55% { transform: translateY(0) scale(1.12); opacity: 1; }
    100% { transform: translateY(0) scale(1); }
}

/* =========================
   PRODUCT CARD COMMERCE UX
========================= */
.artwork-card { position: relative; }
.card-purchase-tools {
    position: static;
    margin: 0 20px 20px;
    z-index: 8;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 7px;
    pointer-events: none;
}
.card-add-button,
.card-inline-quantity,
.card-view-cart {
    pointer-events: auto;
}
.card-add-button {
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    color: var(--wine);
    border: 1px solid rgba(127,20,22,.18);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
    backdrop-filter: blur(10px);
}
.card-add-button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,.16); }
.card-view-cart {
    min-height: 42px;
    padding: 0 17px;
    border-radius: 999px;
    background: var(--wine);
    color: #fff;
    border: 1px solid var(--wine);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .25s ease, background .25s ease, opacity .25s ease;
}
.card-view-cart:hover { background: var(--wine-dark); color:#fff; transform:translateY(-2px); }

.artwork-wishlist {
    position: absolute;
    top: 13px;
    left: 13px;
    z-index: 9;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: var(--wine);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    transition: transform .22s ease, background .22s ease, color .22s ease;
    backdrop-filter: blur(10px);
}
.artwork-wishlist:hover { transform: scale(1.08); }
.artwork-wishlist.is-active { background: var(--wine); color: #fff; }
.card-inline-quantity {
    min-height: 34px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(127,20,22,.16);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(10px);
}
.card-inline-quantity .inline-quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wine);
    font-size: 18px;
    transition: background .2s ease, transform .2s ease;
}
.card-inline-quantity .inline-quantity-btn:hover { background: #f5e9e9; transform: scale(1.05); }
.card-inline-quantity .inline-quantity-value { min-width: 24px; width: 24px; text-align: center; font-weight: 800; font-size: 13px; color: var(--text); line-height: 28px; opacity: 1; display: inline-flex; align-items: center; justify-content: center; }
.card-purchase-tools .is-hidden { display: none !important; }
.artwork-wishlist.is-loading { opacity: .55; pointer-events: none; }

@media (max-width: 700px) {
    .card-purchase-tools { margin: 0 9px 9px; }
    .card-add-button { min-height: 38px; padding: 0 15px; font-size: 11px; }
    .card-inline-quantity { min-height: 38px; }
    .card-inline-quantity .inline-quantity-btn { width: 27px; height: 27px; }
    .artwork-wishlist { width: 36px; height: 36px; top: 9px; left: 9px; }
}

/* Final inline cart control polish */
.card-purchase-tools { margin: 0 20px 20px; }
.card-inline-quantity { min-width: 94px; height: 36px; min-height: 36px; padding: 3px; color: var(--text); }
.card-view-cart.is-hidden { display:none !important; }
.card-inline-quantity .inline-quantity-value { width: 24px; min-width: 24px; color: var(--text) !important; background: transparent; opacity: 1 !important; visibility: visible !important; display: inline-flex !important; align-items: center; justify-content: center; line-height: 28px; }
.card-inline-quantity .inline-quantity-btn { width: 28px; height: 28px; color: var(--text); font-size: 17px; }
.card-inline-quantity .inline-quantity-btn:hover { color: var(--wine); background: #f5e9e9; }

.artwork-card-link { display:block; color:inherit; text-decoration:none; }
.artwork-card-link:hover { color:inherit; }


/* Final interaction animations */
@keyframes quantityPop {
    0% { transform: scale(.72); opacity: .35; }
    55% { transform: scale(1.16); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes cartPulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.025); }
    100% { transform: scale(1); }
}
@keyframes wishlistPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.28) rotate(-8deg); }
    65% { transform: scale(.9) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}
.quantity-pop { animation: quantityPop .38s cubic-bezier(.2,.8,.2,1); }
.cart-action-add, .cart-action-increase, .cart-action-decrease, .cart-action-remove { animation: cartPulse .42s ease; }
.wishlist-pop { animation: wishlistPop .28s ease-out; }

/* Quick View belongs to the image, never the purchase row */
.artwork-card .artwork-image { position: relative; overflow: hidden; }
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, calc(-50% + 10px)) !important;
    z-index: 20 !important;
    opacity: 0 !important;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(20,16,14,.82);
    color: #fff;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(0,0,0,.24);
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
}
    opacity: 1 !important;
    pointer-events: auto;
    transform: translate(-50%, -50%) !important;
}
@media (max-width: 700px) {
}

/* Scroll-typed product description */
.scroll-type-description .scroll-type-char {
    opacity: .12;
    filter: blur(1.2px);
    transition: opacity .08s linear, filter .12s linear;
}
.scroll-type-description .scroll-type-char.is-typed {
    opacity: 1;
    filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
    .quantity-pop, .cart-action-add, .cart-action-increase, .cart-action-decrease, .cart-action-remove, .wishlist-pop { animation: none !important; }
    .scroll-type-description .scroll-type-char { opacity: 1; filter: none; transition: none; }
}


/* V10: wishlist is outside the product link and stays independently clickable */
.artwork-card { position: relative; }
.artwork-card > .artwork-wishlist {
    position: absolute !important;
    top: 13px !important;
    left: 13px !important;
    z-index: 30 !important;
}
@media (max-width: 700px) {
    .artwork-card > .artwork-wishlist {
        top: 9px !important;
        left: 9px !important;
    }
}


/* V16: cohesive subtle-glass controls across the storefront */
:where(button, .btn, .btn-primary, .btn-outline, .global-register, .global-cart,
       .global-action, .card-add-button, .card-view-cart, .inline-quantity-btn,
       .quantity-btn, .js-cart-add, .js-cart-action, .checkout-button,
       input[type="submit"], input[type="button"], .form-actions a) {
    border-radius: 15px;
}
:where(.btn-primary, .global-register, .card-add-button, .card-view-cart,
       .js-cart-add, .checkout-button, input[type="submit"]) {
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: 0 5px 18px rgba(45,20,20,.10), inset 0 1px 0 rgba(255,255,255,.16);
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
:where(.btn-outline, .global-action, .global-cart, .card-inline-quantity,
       .inline-quantity-btn, .quantity-btn) {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
:where(.btn-outline) {
    background: color-mix(in srgb, var(--white, #fff) 0%, transparent);
    border-color: color-mix(in srgb, var(--border, #ddd) 78%, transparent);
}
/* V17: restore the previous transparent treatment for header text links */
.global-header .global-action { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
:where(.btn-primary, .global-register, .card-add-button, .card-view-cart,
       .js-cart-add, .checkout-button, input[type="submit"]):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(45,20,20,.15), inset 0 1px 0 rgba(255,255,255,.2);
}

/* V16: keep purchase controls fully inside narrow artwork cards */
.artwork-card { min-width: 0; }
.artwork-card .card-purchase-tools {
    box-sizing: border-box;
    width: auto;
    max-width: calc(100% - 24px);
    min-width: 0;
    margin: 10px 12px 15px !important;
    gap: 6px;
    flex-wrap: nowrap;
}
.artwork-card .card-add-button,
.artwork-card .card-view-cart {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding-inline: clamp(7px, 1.1vw, 14px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(10px, .78vw, 12px);
    border-radius: 13px;
}
.artwork-card .card-inline-quantity {
    flex: 0 0 auto;
    min-width: 0;
    gap: 0;
    border-radius: 13px;
}
.artwork-card .card-inline-quantity .inline-quantity-btn {
    flex: 0 0 25px;
    width: 25px;
    height: 27px;
}
.artwork-card .card-inline-quantity .inline-quantity-value {
    flex: 0 0 20px;
    min-width: 20px;
    width: 20px;
}
.artwork-card .card-view-cart { flex: 0 1 auto; }

/* V16: uploaded footer artwork should read as a proper image, not a tiny logo */
.global-footer-image,
.global-footer-brand img,
.footer-brand img.global-footer-image {
    display: block;
    width: min(100%, 320px) !important;
    max-width: 100% !important;
    height: 170px !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center;
    border-radius: 16px;
    margin: 0 0 20px !important;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
@media (max-width: 760px) {
    .artwork-card .card-purchase-tools {
        max-width: calc(100% - 16px);
        margin: 9px 8px 12px !important;
        gap: 5px;
    }
    .artwork-card .card-add-button,
    .artwork-card .card-view-cart {
        min-height: 36px;
        padding-inline: 6px;
        font-size: 10px;
        letter-spacing: -.1px;
    }
    .global-footer-image,
    .global-footer-brand img,
    .footer-brand img.global-footer-image {
        width: min(100%, 280px) !important;
        height: 145px !important;
    }
}
@media (max-width: 360px) {
    .artwork-card .card-purchase-tools { gap: 4px; }
    .artwork-card .card-add-button,
    .artwork-card .card-view-cart { font-size: 9px; padding-inline: 4px; }
}


/* V18: refined light-mode section contrast, modern controls and full-cover footer artwork */
html:not([data-theme="dark"]) .dark-section {
    background: #eee8df !important;
    color: #282321 !important;
    border-top: 1px solid rgba(83, 58, 48, .06);
    border-bottom: 1px solid rgba(83, 58, 48, .06);
}
html:not([data-theme="dark"]) .dark-section .section-description { color: #716761 !important; }
html:not([data-theme="dark"]) .dark-section .section-kicker { color: #7f1416 !important; }
html:not([data-theme="dark"]) .dark-section .section-title { color: #282321 !important; }
html:not([data-theme="dark"]) .dark-section .artwork-card {
    background: #fbf8f3 !important;
    border-color: #ddd4ca !important;
    box-shadow: 0 8px 24px rgba(58, 39, 29, .055);
}
html:not([data-theme="dark"]) .dark-section .artwork-category,
html:not([data-theme="dark"]) .dark-section .artwork-meta { color: #82776f !important; }
html:not([data-theme="dark"]) .dark-section .artwork-title,
html:not([data-theme="dark"]) .dark-section .artwork-price { color: #282321 !important; }
html:not([data-theme="dark"]) .dark-section .artwork-bottom { border-color: #e5ddd4 !important; }

/* Modern, consistent icon-like controls without changing their behavior */
.artwork-wishlist,
.js-wishlist-card,
.js-wishlist-detail,
.js-wishlist-toggle {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.58) !important;
    box-shadow: 0 5px 18px rgba(28,20,16,.12), inset 0 1px 0 rgba(255,255,255,.35);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.artwork-wishlist:hover,
.js-wishlist-card:hover,
.js-wishlist-detail:hover,
.js-wishlist-toggle:hover { transform: translateY(-1px) scale(1.04); }
.artwork-wishlist.is-active,
.js-wishlist-card.is-active,
.js-wishlist-detail.is-active,
.js-wishlist-toggle.is-active { color: #a21e28 !important; }
.inline-quantity-btn,
.inline-quantity .js-inline-decrease,
.inline-quantity .js-inline-increase {
    border-radius: 11px !important;
    border: 1px solid var(--border, rgba(127,20,22,.16)) !important;
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.inline-quantity-btn:hover,
.inline-quantity .js-inline-decrease:hover,
.inline-quantity .js-inline-increase:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127,20,22,.12);
}
.cart-count, .cart-number, .cart-count-badge, [data-cart-count] {
    font-variant-numeric: tabular-nums;
    border-radius: 999px !important;
    min-width: 22px;
    padding-inline: 6px;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(127,20,22,.2);
}

.global-footer.has-footer-background {
    position: relative;
    isolation: isolate;
    background-color: #171312 !important;
    background-image: linear-gradient(90deg, rgba(18,14,13,.88), rgba(18,14,13,.72)), var(--footer-image) !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.global-footer.has-footer-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(18,14,13,.16), rgba(18,14,13,.5));
    pointer-events: none;
}
.global-footer.has-footer-background .global-footer-brand img { display: none !important; }
.global-footer.has-footer-background .global-footer-inner,
.global-footer.has-footer-background .global-footer-bottom { position: relative; z-index: 1; }
@media (max-width: 700px) {
    .global-footer.has-footer-background {
        background-position: center !important;
        background-image: linear-gradient(rgba(18,14,13,.78), rgba(18,14,13,.84)), var(--footer-image) !important;
    }
}


/* V19: decisive visual fixes — theme-aware section, true footer background, refined wordmark/icons */
html[data-theme="light"] .dark-section,
html:not([data-theme="dark"]) .dark-section {
    background: #e9e1d7 !important;
    color: #282321 !important;
    border-top: 1px solid #d8cbbd !important;
    border-bottom: 1px solid #d8cbbd !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(100,70,50,.035) !important;
}
html[data-theme="light"] .dark-section .artwork-card,
html:not([data-theme="dark"]) .dark-section .artwork-card {
    background: #fffdf9 !important;
    border-color: #d8cbbd !important;
}
html[data-theme="dark"] .dark-section {
    background: #100e0d !important;
    color: #f3eee8 !important;
    border-block: 1px solid #292321 !important;
}

/* Use the uploaded footer image as the actual full-width footer background on both templates. */
.global-footer.has-footer-background,
.footer.has-footer-background {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    background-color: #171312 !important;
    background-image: linear-gradient(90deg, rgba(18,14,13,.86), rgba(18,14,13,.70)), var(--footer-image) !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}
.global-footer.has-footer-background::before,
.footer.has-footer-background::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    background: linear-gradient(180deg, rgba(18,14,13,.12), rgba(18,14,13,.48)) !important;
    pointer-events: none !important;
}
.global-footer.has-footer-background .global-footer-brand img,
.footer.has-footer-background .footer-brand img.global-footer-image {
    display: none !important;
}
.global-footer.has-footer-background .global-footer-inner,
.global-footer.has-footer-background .global-footer-bottom,
.footer.has-footer-background .container {
    position: relative !important;
    z-index: 1 !important;
}
.global-footer.has-footer-background h3,
.global-footer.has-footer-background h4,
.global-footer.has-footer-background p,
.global-footer.has-footer-background a,
.global-footer.has-footer-background span,
.footer.has-footer-background h3,
.footer.has-footer-background h4,
.footer.has-footer-background p,
.footer.has-footer-background a,
.footer.has-footer-background span { color: #f6f0e9 !important; }

/* Gallery wordmark: editorial typography that adapts to light/dark theme. */
.global-brand-main {
    font-family: "SomaGalleryFont", "Urdu Typesetting", serif !important;
    font-size: clamp(17px, 1.45vw, 23px) !important;
    font-weight: 600 !important;
    letter-spacing: .105em !important;
    line-height: 1.15 !important;
    text-transform: uppercase !important;
    color: var(--text, #292929) !important;
    text-shadow: none !important;
    transition: color .25s ease, letter-spacing .25s ease !important;
}
.global-brand:hover .global-brand-main { letter-spacing: .13em !important; }
html[data-theme="dark"] .global-brand-main { color: #f4eee6 !important; }
.global-header-home:not(.is-scrolled) .global-brand-main { color: #fffaf3 !important; }
html[data-theme="light"] .global-header:not(.global-header-home) .global-brand-main,
html[data-theme="light"] .global-header-home.is-scrolled .global-brand-main { color: #282321 !important; }

/* Refined icon controls: clean circular surfaces, crisp strokes and less emoji-like appearance. */
.artwork-wishlist,
.js-wishlist-card,
.js-wishlist-detail,
.js-wishlist-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 39px !important;
    height: 39px !important;
    border-radius: 50% !important;
    background: rgba(255,252,247,.82) !important;
    color: #5c4a45 !important;
    font-family: Arial, sans-serif !important;
    font-size: 23px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
    backdrop-filter: blur(14px) saturate(1.25) !important;
    border: 1px solid rgba(255,255,255,.78) !important;
    box-shadow: 0 4px 16px rgba(25,17,12,.13), inset 0 1px 0 rgba(255,255,255,.7) !important;
}
.artwork-wishlist.is-active,
.js-wishlist-card.is-active,
.js-wishlist-detail.is-active,
.js-wishlist-toggle.is-active { color: #9d2530 !important; background: rgba(255,246,244,.94) !important; }
html[data-theme="dark"] .artwork-wishlist,
html[data-theme="dark"] .js-wishlist-card,
html[data-theme="dark"] .js-wishlist-detail,
html[data-theme="dark"] .js-wishlist-toggle {
    color: #f4ece5 !important;
    background: rgba(36,31,28,.86) !important;
    border-color: rgba(255,255,255,.16) !important;
}
.inline-quantity-btn,
.card-inline-quantity .inline-quantity-btn {
    border-radius: 10px !important;
    font-family: Arial, sans-serif !important;
    font-size: 19px !important;
    font-weight: 400 !important;
    background: color-mix(in srgb, var(--white, #fff) 78%, transparent) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 7px rgba(40,25,20,.07) !important;
}
.global-search-icon { font-size: 22px !important; font-weight: 300 !important; }
.global-cart-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 23px !important;
    height: 23px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    background: var(--wine, #7f1416) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.28) !important;
}
@media (max-width: 600px) {
    .global-brand-main { font-size: 15px !important; letter-spacing: .07em !important; }
    .artwork-wishlist, .js-wishlist-card { width: 35px !important; height: 35px !important; font-size: 21px !important; }
    .footer.has-footer-background, .global-footer.has-footer-background { background-position: center !important; }
}
