:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #eef3f8;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #08284a;
    --primary-dark: #061f38;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow: 0 10px 30px rgba(8, 40, 74, 0.08);
    --radius: 18px;
    --header-bg: #08284a;
    --header-height: 132px;
    --bottom-nav-inner: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --bottom-nav-height: calc(var(--bottom-nav-inner) + var(--safe-bottom));
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    touch-action: manipulation;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button, input, select {
    font: inherit;
}

.app-shell {
    min-height: 100dvh;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + 12px);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #90b2d6;
    border-bottom: 1px solid rgba(8, 40, 74, 0.12);
    padding: 12px 16px 14px;
}

.mobile-mini-header {
    display: none;
}

@media (max-width: 560px) {
    .mobile-mini-header {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: -12px -16px 10px;
        padding: 6px 12px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--primary);
        background: rgba(255, 255, 255, 0.35);
        border-bottom: 1px solid rgba(8, 40, 74, 0.1);
    }
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    height: 40px;
    width: auto;
    max-width: 148px;
    object-fit: contain;
}

.brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header .brand-text {
    color: var(--primary);
}

.app-header .icon-btn {
    border-color: rgba(8, 40, 74, 0.15);
    background: rgba(255, 255, 255, 0.55);
    color: var(--primary);
}

.app-header .icon-btn:hover,
.app-header .icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(8, 40, 74, 0.25);
}

.mobile-menu-btn {
    color: var(--primary);
}

.mobile-menu[hidden] {
    display: none !important;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 120;
    pointer-events: none;
}

.mobile-menu.is-open {
    pointer-events: auto;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.mobile-menu.is-open .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100%;
    background: #fff;
    box-shadow: -12px 0 40px rgba(8, 40, 74, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.24s ease;
}

.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.mobile-menu-head h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary);
}

.mobile-menu-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-close svg {
    width: 18px;
    height: 18px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    overflow-y: auto;
}

.mobile-menu-link,
.mobile-menu-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}

.mobile-menu-link:hover,
.mobile-menu-link.is-active,
.mobile-menu-group summary:hover {
    background: #eef3f8;
    color: var(--primary);
}

.mobile-menu-link--hot {
    color: #dc2626;
}

.mobile-menu-group summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-group summary::after {
    content: '+';
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.mobile-menu-group[open] summary::after {
    content: '−';
}

.mobile-menu-sub {
    display: grid;
    gap: 2px;
    padding: 0 8px 8px 18px;
}

.mobile-menu-sublink {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
}

.mobile-menu-sublink:hover {
    background: #f8fafc;
    color: var(--primary);
}

body.mobile-menu-open {
    overflow: hidden;
}

html[dir="rtl"] .mobile-menu-panel {
    right: auto;
    left: 0;
    box-shadow: 12px 0 40px rgba(8, 40, 74, 0.18);
    transform: translateX(-105%);
}

html[dir="rtl"] .mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

@media (min-width: 900px) {
    .mobile-menu,
    .mobile-menu-btn {
        display: none !important;
    }
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.search-form {
    position: relative;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 10px;
    box-shadow: var(--shadow);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex: 0 0 auto;
}

.search-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    min-width: 0;
}

.search-scan-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: #e8eef4;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-scan-btn svg {
    width: 20px;
    height: 20px;
}

.search-scan-btn:hover,
.search-scan-btn:focus-visible {
    background: #d4e0ec;
}

.search-submit {
    border: 0;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 60;
}

.suggestion-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
    border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--surface-2);
}

.suggestion-item img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: #f8fafc;
}

.suggestion-meta {
    min-width: 0;
}

.suggestion-meta strong,
.suggestion-meta span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta span {
    color: var(--muted);
    font-size: 0.85rem;
}

.suggestion-show-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    border-top: 1px solid var(--border);
}

.suggestion-show-all:hover,
.suggestion-show-all:focus-visible,
.suggestion-show-all.active {
    background: #e8eef5;
    color: var(--primary-dark);
}

.suggestion-show-all svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.app-main {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-header .mobile-lang-switch {
    background: rgba(255, 255, 255, 0.45);
}

.app-header .mobile-lang-pill {
    color: var(--primary);
}

.app-header .signout-btn {
    border-color: rgba(8, 40, 74, 0.15);
    background: rgba(255, 255, 255, 0.55);
    color: var(--primary);
}

.app-header .signout-btn:hover,
.app-header .signout-btn:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(8, 40, 74, 0.25);
    color: var(--primary);
}

.mobile-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.mobile-lang-pill {
    min-width: 38px;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.mobile-lang-pill.is-active {
    background: #fff;
    color: var(--primary);
}

.signout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.signout-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.signout-btn:hover,
.signout-btn:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.login-page {
    min-height: 100vh;
    background: #f3f4f6;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

.login-hero {
    display: none;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.22));
    z-index: 1;
}

.login-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    width: min(100%, 460px);
    background: var(--surface);
    border-radius: 28px;
    padding: 36px 32px 28px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.login-subtitle {
    margin: 0;
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.login-error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.9rem;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field {
    display: grid;
    gap: 10px;
}

.login-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.login-field input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 15px 16px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.18);
}

.password-wrap {
    position: relative;
    display: block;
}

.password-wrap input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

.login-submit {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #d1d5db;
    cursor: not-allowed;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-submit.is-ready {
    background: #111827;
    cursor: pointer;
}

.login-submit.is-ready:hover {
    background: #000;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #6b7280;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
}

.login-link {
    color: #2563eb;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

.login-divider {
    position: relative;
    margin: 28px 0 20px;
    text-align: center;
}

.login-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0 14px;
    background: #fff;
    color: #9ca3af;
    font-size: 0.9rem;
}

.social-login {
    display: grid;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.store-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.store-social-link {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.store-social-link svg {
    width: 17px;
    height: 17px;
    display: block;
}

.store-social-link:hover,
.store-social-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(8, 40, 74, 0.12);
}

.store-social-link--youtube:hover,
.store-social-link--youtube:focus-visible {
    color: #fff;
    background: #ff0000;
    border-color: #ff0000;
}

.store-social-link--linkedin:hover,
.store-social-link--linkedin:focus-visible {
    color: #fff;
    background: #0a66c2;
    border-color: #0a66c2;
}

.store-social-link--x:hover,
.store-social-link--x:focus-visible {
    color: #fff;
    background: #000;
    border-color: #000;
}

.store-social-link--facebook:hover,
.store-social-link--facebook:focus-visible {
    color: #fff;
    background: #1877f2;
    border-color: #1877f2;
}

.store-social-link--instagram:hover,
.store-social-link--instagram:focus-visible {
    color: #fff;
    background: linear-gradient(135deg, #f58529, #dd2a7b 45%, #8134af 70%, #515bd4);
    border-color: #dd2a7b;
}

.login-footer {
    margin: 24px 0 0;
    text-align: center;
    color: #9ca3af;
    font-size: 0.92rem;
}

@media (max-width: 899px) {
    body.page-products .products-content,
    body.page-clearance .products-content,
    body.page-business-types .business-types-page,
    body.page-business-type .business-type-page {
        padding-bottom: 4px;
    }

    .products-pagination,
    .clearance-pagination,
    .pagination {
        margin-bottom: 4px;
    }

    .app-main > :last-child {
        margin-bottom: 0;
    }
}

@media (min-width: 900px) {
    .login-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
    }

    .login-hero {
        display: block;
        min-height: 100vh;
    }

    .login-panel {
        padding: 40px 48px;
        background: #f3f4f6;
    }

    .login-card {
        width: min(100%, 500px);
        padding: 42px 40px 34px;
    }
}

@media (min-width: 1200px) {
    .login-layout {
        grid-template-columns: 1.2fr 0.8fr;
    }

    .login-panel {
        padding: 48px 64px;
    }
}

.partner-banner-wrapper {
    width: calc(100% + 32px);
    margin: -4px -16px 16px;
    height: 300px;
    overflow: hidden;
    background: #f9fafb;
    border-radius: 0;
}

.partner-banner-frame {
    border: none;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.partner-banner-frame.is-loaded {
    opacity: 1;
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.section {
    margin-bottom: 24px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h1,
.section-head h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary);
}

.link-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
}

.section-meta,
.muted,
.tiny {
    color: var(--muted);
}

.tiny {
    font-size: 0.78rem;
    margin: 4px 0 0;
}

.category-filmstrip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scroll-snap-type: x mandatory;
}

.category-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.category-chip:hover,
.category-chip:focus-visible {
    background: var(--surface-2);
    border-color: #b8c9d9;
    color: var(--primary);
}

.category-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.product-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 220px);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
}

.product-scroll .product-card {
    scroll-snap-align: start;
}

.category-card,
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.category-card:hover,
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    flex: 1;
}

.product-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 10px 10px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    min-width: 0;
}

.card-action-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.card-action-btn:hover,
.card-action-btn:focus-visible {
    border-color: #c7d2fe;
    color: var(--primary-dark);
}

.card-action-website {
    color: var(--primary);
}

.copy-barcode-btn.is-copied {
    color: var(--success);
    border-color: #bbf7d0;
}

.category-card img,
.product-card-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f8fafc;
}

.category-card-body,
.product-card-body {
    padding: 12px;
}

.category-card-body h3,
.product-card-body h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    line-height: 1.3;
}

.category-card-body span {
    color: var(--muted);
    font-size: 0.82rem;
}

.product-card-media {
    position: relative;
}

.product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #111827;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
}

.badge-new {
    background: var(--primary);
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-pill.large {
    padding: 8px 12px;
    font-size: 0.82rem;
}

.stock-pill.in {
    background: #dcfce7;
    color: #15803d;
}

.stock-pill.out {
    background: #fee2e2;
    color: #dc2626;
}

.product-card-media,
.home-product-media,
.new-arrival-media {
    position: relative;
}

.product-card-media.is-out-of-stock img,
.home-product-media.is-out-of-stock img,
.new-arrival-media.is-out-of-stock img {
    filter: grayscale(0.25);
}

.product-stock-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(220, 38, 38, 0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    pointer-events: none;
}

.cart-widget-message,
.cart-status-message,
.checkout-status-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #166534;
    font-size: 0.88rem;
}

.cart-widget-message.is-error,
.cart-status-message.is-error,
.checkout-status-message.is-error {
    background: #fef2f2;
    color: #b91c1c;
}

.stock-in {
    background: #dcfce7;
    color: var(--success);
}

.stock-low {
    background: #fef3c7;
    color: var(--warning);
}

.stock-out {
    background: #fee2e2;
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.88rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary,
.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.filter-bar {
    display: grid;
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    align-items: end;
}

.filter-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.filter-open-btn svg {
    width: 18px;
    height: 18px;
}

.filter-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    line-height: 20px;
    text-align: center;
}

.products-layout {
    display: grid;
    gap: 18px;
    align-items: start;
}

.products-main {
    min-width: 0;
}

.products-filter-sidebar {
    position: relative;
    z-index: 30;
}

.products-filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 79;
}

.products-filter-backdrop[hidden] {
    display: none !important;
}

.products-filter-sidebar-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
}

.products-filter-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.products-filter-sidebar-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.products-filter-sidebar-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.products-filter-sidebar-close svg {
    width: 16px;
    height: 16px;
}

.products-filter-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.products-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #f8fafc;
}

.products-filter-search-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    min-width: 0;
    font-size: 0.84rem;
}

.products-filter-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 6px;
}

.products-filter-section {
    border-bottom: 1px solid var(--border);
}

.products-filter-section:last-child {
    border-bottom: none;
}

.products-filter-section summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}

.products-filter-section summary::-webkit-details-marker {
    display: none;
}

.products-filter-section summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.products-filter-section[open] summary::after {
    content: '−';
    background: #eef4fb;
    border-color: #d7e5f4;
}

.filter-option-list,
.filter-brand-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 140px;
    overflow-y: auto;
    padding: 0 2px 8px;
}

.filter-option-item,
.filter-brand-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 8px;
    cursor: pointer;
}

.filter-option-item:hover,
.filter-brand-item:hover {
    background: #f8fafc;
}

.filter-option-item[hidden],
.filter-brand-item[hidden] {
    display: none !important;
}

.filter-option-item input,
.filter-brand-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.filter-option-name,
.filter-brand-name {
    font-size: 0.86rem;
    font-weight: 500;
    min-width: 0;
}

.filter-option-name small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.filter-brand-count {
    font-size: 0.72rem;
    color: var(--muted);
    background: #eef2ff;
    padding: 2px 7px;
    border-radius: 999px;
}

.filter-brand-empty {
    margin: 0 0 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.products-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.filter-field {
    display: grid;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}

.filter-field select {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.breadcrumb a {
    color: var(--primary);
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.product-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-detail {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.product-gallery,
.product-info,
.product-description {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.product-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    text-decoration: none;
    color: inherit;
}

.product-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 4px;
}

.product-brand {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
}

.brand-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.brand-search-wrap .search-icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex: 0 0 auto;
}

.brand-search-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    min-width: 0;
    font-size: 0.95rem;
}

.brand-search-clear {
    border: 0;
    background: var(--surface-2);
    color: var(--primary);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.brands-page .section-head h1 {
    font-size: 1.2rem;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

.brand-card[hidden] {
    display: none;
}

.brand-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
}

.brand-card:active,
.brand-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.brand-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 118px;
    padding: 12px;
    background: #fff;
}

.brand-card-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 76px;
    object-fit: contain;
}

.brand-card-body {
    padding: 8px 6px 10px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

.brand-card-body h3 {
    margin: 0 0 4px;
    font-size: 0.7rem;
    line-height: 1.25;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.brand-count {
    display: inline-block;
    font-size: 0.62rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 6px;
}

.brand-page-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-page-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 6px;
}

.brand-page-head h1 {
    margin: 0 0 4px;
}

.product-title {
    margin: 0 0 14px;
    font-size: clamp(1.15rem, 3.5vw, 1.45rem);
    line-height: 1.35;
    word-break: break-word;
}

.price-block {
    min-width: 0;
}

.product-gallery-main img {
    width: 100%;
    max-height: 420px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 16px;
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 4px;
}

.thumb-btn {
    border: 2px solid transparent;
    background: transparent;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.thumb-btn.active {
    border-color: var(--primary);
}

.thumb-btn img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
}

.price-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.price-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.price-value {
    font-size: 1.35rem;
    line-height: 1.2;
}

.price-muted {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.2;
}

.stock-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--surface-2);
    margin-bottom: 16px;
}

.stock-panel-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-detail {
    margin: 0;
    color: var(--muted);
}

.stock-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    color: var(--muted);
    font-size: 0.88rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.meta-item {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px 14px;
    min-width: 0;
}

.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.meta-value {
    display: block;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.meta-item-barcode {
    grid-column: 1 / -1;
    text-align: center;
}

.meta-item-barcode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    text-align: left;
}

.meta-item-barcode .barcode-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 12px;
    overflow-x: auto;
}

.meta-item-barcode .barcode-visual svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.meta-item-barcode .barcode-value {
    display: block;
    margin-top: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    word-break: break-all;
}

.barcode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.barcode-actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
}

.barcode-type {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

.product-description h2,
.description-panel h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.description-content {
    line-height: 1.6;
    color: #334155;
    word-break: break-word;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    min-height: var(--bottom-nav-inner);
    padding: 0 0 var(--safe-bottom);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(8, 40, 74, 0.08);
}

.bottom-nav-item,
.bottom-nav-item--btn {
    position: relative;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: var(--bottom-nav-inner);
    padding: 6px 2px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, background 0.2s ease;
}

.bottom-nav-item:active,
.bottom-nav-item--btn:active {
    background: rgba(8, 40, 74, 0.05);
}

.bottom-nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    line-height: 0;
}

.bottom-nav-item svg,
.bottom-nav-item--btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

.bottom-nav-label {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-nav-item.active,
.bottom-nav-item--btn.active {
    color: var(--primary);
    background: rgba(8, 40, 74, 0.06);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.bottom-nav-item.active .bottom-nav-label {
    font-weight: 700;
}

.bottom-nav-badge,
.bottom-nav-badge[data-cart-count] {
    position: absolute;
    top: -2px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid #fff;
}

.bottom-nav-badge[hidden],
.bottom-nav-badge[data-cart-count][hidden] {
    display: none;
}

/* Mobile scrollable footer (above fixed tab bar) */
.mobile-footer {
    margin-top: 8px;
    padding: 24px 16px 20px;
    background: linear-gradient(180deg, #eef3f8 0%, #e8eef5 100%);
    border-top: 1px solid var(--border);
}

.mobile-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-footer-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
}

.mobile-footer-brand strong {
    display: block;
    font-size: 0.92rem;
    color: var(--primary);
}

.mobile-footer-brand p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.mobile-footer-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-footer-links::-webkit-scrollbar {
    display: none;
}

.mobile-footer-links a {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 0;
    white-space: nowrap;
}

.mobile-footer .store-social {
    margin: 4px 0 16px;
}

.mobile-footer-meta {
    display: grid;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(8, 40, 74, 0.1);
}

.mobile-footer-phone {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--primary);
}

.mobile-footer-copy {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.45;
}

.install-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--bottom-nav-height) + 12px);
    background: #0f172a;
    color: #fff;
    border-radius: 18px;
    padding: 14px 16px;
    display: grid;
    gap: 12px;
    box-shadow: var(--shadow);
    z-index: 45;
}

.install-banner[hidden] {
    display: none !important;
}

/* ── Scanner modal ── */
.camera-modal[hidden] { display: none !important; }

.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.95);
}

.camera-modal-content {
    width: min(100%, 550px);
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    max-height: 92vh;
    overflow-y: auto;
}

.camera-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 4px solid #007bff;
}

.camera-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #333;
}

.camera-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: #ff4757;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}

.camera-close-btn:hover { transform: scale(1.12); background: #ff3742; }
.camera-close-btn svg { width: 18px; height: 18px; }

.scanner-container {
    position: relative;
    height: 360px;
    border-radius: 15px;
    overflow: hidden;
    border: 4px solid #007bff;
    background: #000;
}

@media (max-height: 700px) {
    .scanner-container { height: 260px; }
}

#qr-reader { height: 100% !important; width: 100% !important; border-radius: 15px; }
#qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 15px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* iPhone focus overlay */
.iphone-focus-overlay {
    position: absolute;
    left: 50%; top: 50%;
    width: 280px; height: 180px;
    transform: translate(-50%, -50%);
    border-radius: 15px;
    border: 4px solid #00ff00;
    background: rgba(0,255,0,0.04);
    box-shadow: 0 0 25px rgba(0,255,0,0.55);
    pointer-events: none;
    z-index: 5;
    animation: focusPulse 1.2s infinite;
}

.focus-corner {
    position: absolute;
    width: 28px; height: 28px;
}
.focus-corner.top-left    { top:-4px; left:-4px;   border-top:4px solid #0f0; border-left:4px solid #0f0;   border-top-left-radius:15px; }
.focus-corner.top-right   { top:-4px; right:-4px;  border-top:4px solid #0f0; border-right:4px solid #0f0;  border-top-right-radius:15px; }
.focus-corner.bottom-left { bottom:-4px; left:-4px; border-bottom:4px solid #0f0; border-left:4px solid #0f0; border-bottom-left-radius:15px; }
.focus-corner.bottom-right{ bottom:-4px; right:-4px;border-bottom:4px solid #0f0; border-right:4px solid #0f0;border-bottom-right-radius:15px; }

.focus-instructions {
    position: absolute;
    left: 50%; bottom: 8px;
    transform: translateX(-50%);
    border-radius: 20px;
    border: 2px solid #0f0;
    background: rgba(0,0,0,0.82);
    padding: 6px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0f0;
    white-space: nowrap;
}

/* Scanner controls overlay */
.scanner-controls {
    position: absolute;
    top: 12px; right: 12px;
    display: flex;
    gap: 8px;
    z-index: 6;
}

.scanner-control-btn {
    width: 40px; height: 40px;
    border: 2px solid #0f0;
    border-radius: 999px;
    background: rgba(0,0,0,0.78);
    color: #0f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.scanner-control-btn:hover {
    transform: scale(1.1);
    background: rgba(0,255,0,0.18);
}

.scanner-control-btn svg { width: 18px; height: 18px; }

/* Scanning status bar */
.scanning-status {
    margin-top: 14px;
    border-radius: 12px;
    border: 2px solid rgba(0,123,255,0.3);
    background: rgba(0,123,255,0.08);
    padding: 11px 14px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.scanning-status.ready {
    color: #16a34a;
    background: rgba(22,163,74,0.08);
    border-color: rgba(22,163,74,0.3);
    animation: statusPulse 1.2s ease-in-out infinite;
}

.scanner-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid #e5e7eb;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Scan result */
.scan-result {
    margin-top: 16px;
    border-radius: 14px;
    border: 3px solid #16a34a;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    padding: 16px;
    font-weight: 700;
    color: #14532d;
    animation: successPop 0.5s ease-out;
}

.scan-result code {
    background: #f0fdf4;
    border-radius: 6px;
    padding: 2px 8px;
    color: #007bff;
    font-weight: 700;
}

/* ── Keyframes ── */
@keyframes focusPulse {
    0%,100% { box-shadow: 0 0 25px rgba(0,255,0,0.55); transform: translate(-50%,-50%) scale(1); }
    50%      { box-shadow: 0 0 40px rgba(0,255,0,0.8);  transform: translate(-50%,-50%) scale(1.02); }
}
@keyframes statusPulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.01); }
}
@keyframes successPop {
    0%   { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1);    opacity: 1; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.install-banner p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
}

.install-banner-actions {
    display: flex;
    gap: 8px;
}

@media (min-width: 480px) {
    .brand-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .brand-card-logo {
        height: 128px;
    }

    .brand-card-logo img {
        max-height: 84px;
    }

    .brand-card-body h3 {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .brand-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }

    .product-detail {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
        align-items: start;
    }

    .meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-panel {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .filter-bar {
        grid-template-columns: auto repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .brand-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .app-main {
        padding: 24px;
    }
}

@media (display-mode: standalone) {
    .install-banner {
        display: none !important;
    }
}
