:root {
    --bg: #ffffff;
    --ink: #111111;
    --ink-soft: #737373;
    --border: #e5e5e5;
    --surface: #f7f7f7;
    --blue: #2563eb;
    --blue-dk: #1d4ed8;
    --green: #16a34a;
    --red: #dc2626;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --gray-dark: #1f2937;
    --gray-medium: #6b7280;
    --border-color: #e5e5e5;
    --surface-hover: #f3f4f6;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    background: var(--bg);
    color: var(--ink);
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ── INTERACTION HARDWARE ACCELERATION GUARD ── */
/* 
   We only promote the layers to the GPU during active 
   user dragging and teardown immediately upon completion.
*/
.is-dragging {
    /* STABILITY: will-change disabled to ensure zero unintended GPU layer creation */
    /* will-change: transform !important; */
}

/* ── HEADER ── */
.bs-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 130;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: padding 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 720px) {
    .bs-header {
        padding: 0 40px;
    }
}

.bs-logo {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bs-logo-name {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0em;
    color: var(--ink);
    line-height: 1;
}

.bs-logo-tag {
    font-size: 10px;
    font-weight: 400;
    color: var(--ink-soft);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
}

.bs-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bs-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    -webkit-appearance: none;
    transition: background 0.15s;
}

.bs-icon-btn:hover {
    background: var(--surface);
}

.bs-icon-btn:active {
    background: var(--border);
}

.bs-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--ink);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#cartBadge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--blue);
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-body);
    line-height: 1;
}

/* ── BOTTOM NAV ── */
.bs-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 200;
}

body.hide-bottom-nav .bs-nav {
    display: none !important;
}

body.hide-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom) !important;
}

@media (min-width: 720px) {
    .bs-nav {
        display: none !important;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.bs-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    border-top: 2px solid transparent;
    padding-top: 2px;
    text-decoration: none;
    -webkit-appearance: none;
    transition: color 0.15s;
}

.bs-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bs-nav-item.active {
    color: var(--blue);
    border-top-color: var(--blue);
}

.bs-nav-item:active {
    opacity: 0.5;
}

/* ── PANELS ── */
.bs-panel {
    display: none;
}

.bs-panel.active {
    display: block;
    /* STABILITY: panelIn animation disabled — GPU layer promotion suspected in tile corruption */
    /* animation: panelIn 0.2s ease; */
}

/* STABILITY: panelIn keyframe preserved but disabled above
@keyframes panelIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
} */

/* ── STORY TAB / LANDING PAGE ── */
.story-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 92% 12%, rgba(37, 99, 235, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sidesrays-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.sidesrays-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.story-hero-grid {
    position: relative;
    padding-top: 0 30px;
    z-index: 2;
    display: grid;
    grid-template-columns: 3fr 2fr;
    align-items: stretch;
    width: 100%;
}

.hero-text-col {
    padding: 64px 32px 64px 40px;
    display: flex;
    flex-direction: column;
    justify-content: start;
}

.hero-trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.stacked-avatars {
    display: flex;
    align-items: center;
}

.stacked-avatars img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #f1f5f9;
    object-fit: cover;
    margin-left: -16px;
    transition: transform 0.2s ease, z-index 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stacked-avatars img:first-child {
    margin-left: 0;
}

.stacked-avatars img:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.trust-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.4;
}

@media (min-width: 720px) and (max-width: 1199px) {
    .hero-text-col {
        padding: 40px 16px 40px 24px;
    }
}

.hero-carousel-col {
    position: relative;
    height: 80%;
    background: transparent;
    overflow: hidden;
}

.hero-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.65s cubic-bezier(0.77, 0, 0.175, 1);
}

.hero-carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.hero-carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    /* STABILITY: heroFloat animation disabled — continuous transform causes raster tile churn */
    /* animation: heroFloat 4s ease-in-out infinite; */
    user-select: none;
    -webkit-user-drag: none;
}

/* STABILITY: animation-delays disabled with heroFloat
.hero-carousel-slide:nth-child(2) img { animation-delay: -1.2s; }
.hero-carousel-slide:nth-child(3) img { animation-delay: -2.4s; }
.hero-carousel-slide:nth-child(4) img { animation-delay: -3.6s; } */

/* STABILITY: heroFloat keyframe preserved but disabled above
@keyframes heroFloat {
    0%, 100% { transform: translateY(0px) scale(1.00); }
    50%       { transform: translateY(-12px) scale(1.02); }
} */

.hero-carousel-dots {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.25);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.hero-dot.active {
    background: var(--blue);
    transform: scale(1.3);
}

@media (max-width: 719px) {
    .story-hero {
        min-height: auto;
        height: auto;
    }

    .story-hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .hero-text-col {
        order: 1;
        padding: 32px 20px 24px;
        max-width: 100%;
    }

    .hero-carousel-col {
        order: 2;
        height: 320px;
    }
}

.story-eyebrow {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 14px;
}

.story-headline {
    font-family: var(--font-head);
    font-size: clamp(28px, 7vw, 42px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.04em;
    color: var(--ink);
    margin-bottom: 16px;
    max-width: 680px;
}

.story-headline span {
    color: var(--blue);
}

.story-body {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--ink-soft);
    margin-bottom: 10px;
    max-width: 640px;
}

.story-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.story-cta,
.story-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 7px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    text-decoration: none;
    margin-top: 0 !important;
}

.story-cta {
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
}

.story-cta-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
}

.story-cta svg,
.story-cta-secondary svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.story-cta:hover {
    background: var(--blue-dk);
    border-color: var(--blue-dk);
}

.story-cta-secondary:hover {
    background: var(--surface);
}

.story-cta:active,
.story-cta-secondary:active {
    transform: scale(0.98);
}

.story-trust-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.story-trust-item {
    padding: 16px 10px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.story-trust-item:last-child {
    border-right: none;
}

.story-trust-value {
    display: block;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 5px;
}

.story-trust-label {
    display: block;
    font-size: 10px;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
}

.story-section {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border);
}

.story-section.alt {
    background: var(--surface);
}

/* ── ABOUT HIGHLIGHT CARDS ── */
.about-highlight-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.about-card-value {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    color: var(--blue);
    letter-spacing: -0.02em;
    line-height: 1;
}

.about-card-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .about-highlight-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .about-card {
        padding: 12px 10px;
    }

    .about-card-value {
        font-size: 15px;
    }

    .about-card-label {
        font-size: 10px;
    }
}

/* ── ABOUT GRID ── */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
}

@media (max-width: 719px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.section-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 14px;
}

.section-heading {
    font-family: var(--font-head);
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 12px;
    max-width: 620px;
}

.section-copy {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--ink-soft);
    max-width: 680px;
}

/* How We Operate Section Layout */
#storyProcess {
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

@media (min-width: 720px) {
    #storyProcess {
        padding-left: 32px;
        padding-right: 32px;
        padding-top: 64px;
        padding-bottom: 64px;
    }
}

#storyProcess::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(17, 17, 17, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 17, 17, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

.process-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 720px) {
    .process-layout {
        grid-template-columns: 1.15fr 1.85fr;
        gap: 32px;
        align-items: stretch;
    }
}

.process-header-box {
    background: var(--bg);
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 480px) {
    .process-grid {
        grid-template-columns: 1fr;
    }
}

.process-card {
    position: relative;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 165px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.process-card.dark {
    background: #1f1f1f;
    border-color: #1f1f1f;
    color: #ffffff;
}

.process-card.dark .process-title {
    color: #ffffff;
}

.process-card.dark .process-desc {
    color: rgba(255, 255, 255, 0.65);
}

.process-card.dark .process-step {
    color: var(--blue);
    opacity: 0.12;
}

.process-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.process-card.dark:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.process-step {
    position: absolute;
    top: -15px;
    right: 15px;
    font-size: 110px;
    font-family: var(--font-head);
    font-weight: 800;
    color: var(--blue);
    opacity: 0.07;
    line-height: 1;
    z-index: 1;
    user-select: none;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.process-card:hover .process-step {
    transform: scale(1.15) translateY(-5px);
}

.process-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.25;
}

.process-desc {
    position: relative;
    z-index: 2;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 300;
    color: var(--ink-soft);
    line-height: 1.6;
}

.delivery-callout {
    margin-top: 22px;
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 12px;
    background: #eff6ff;
}

.delivery-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delivery-icon svg {
    width: 19px;
    height: 19px;
    stroke: var(--blue);
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.delivery-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.delivery-copy {
    font-size: 12px;
    font-weight: 300;
    color: var(--ink-soft);
    line-height: 1.65;
}

/* BENTO GRID (Why Kolva) */
.pillars-section {
    padding: 40px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
}

.bento-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.bento-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    min-height: 140px;
    border-radius: 12px;
}

.bento-image-wrap img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 8px;
}

.bento-text {
    margin-top: auto;
}

.bento-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.bento-desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
}

@media (min-width: 720px) {
    .pillars-section {
        padding-left: max(32px, calc((100vw - 880px) / 2));
        padding-right: max(32px, calc((100vw - 880px) / 2));
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .bento-grid {
        grid-template-columns: repeat(5, 1fr);
        grid-auto-rows: 1fr;
        gap: 24px;
    }

    .bento-card:nth-child(1) {
        grid-column: span 3;
    }

    .bento-card:nth-child(2) {
        grid-column: span 2;
    }

    .bento-card:nth-child(3) {
        grid-column: span 2;
    }

    .bento-card:nth-child(4) {
        grid-column: span 3;
    }

    .bento-card {
        padding: 32px;
    }

    .bento-image-wrap {
        min-height: 180px;
    }

    .bento-image-wrap img {
        max-height: 200px;
    }

    .bento-card-selected .bento-image-wrap,
    .bento-card-easy .bento-image-wrap {
        display: block;
        width: 100%;
    }

    .bento-card-selected .bento-image-wrap img,
    .bento-card-easy .bento-image-wrap img {
        width: 90%;
        max-width: 90%;
        height: 220px;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
}

.testimonial-grid {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.whatsapp-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #e5ddd5;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
}

.whatsapp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #075e54;
    color: #fff;
}

.whatsapp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #128c7e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.whatsapp-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.whatsapp-meta {
    font-size: 10px;
    opacity: 0.78;
    margin-top: 2px;
}

.whatsapp-body {
    padding: 16px 14px 18px;
    background:
        linear-gradient(rgba(229, 221, 213, 0.94), rgba(229, 221, 213, 0.94)),
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1px);
    background-size: auto, 22px 22px;
}

.chat-bubble {
    max-width: 88%;
    padding: 10px 12px 18px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink);
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.chat-bubble.customer {
    background: #fff;
    border-top-left-radius: 2px;
}

.chat-bubble.business {
    background: #dcf8c6;
    border-top-right-radius: 2px;
    margin-left: auto;
    margin-top: 8px;
}

.chat-time {
    position: absolute;
    right: 9px;
    bottom: 5px;
    font-size: 9px;
    color: #888;
}

.story-quote {
    padding: 40px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--ink);
}

.story-quote-inner {
    display: flex;
    flex-direction: column;
    gap: 36px;
    align-items: center;
}

.story-quote-text {
    flex: 1;
    min-width: 0;
}

.story-quote blockquote {
    font-family: var(--font-head);
    font-size: clamp(20px, 4.8vw, 30px);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #fff;
    border-left: 3px solid var(--blue);
    padding-left: 20px;
}

.story-quote p {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.65;
}

/* ── STACK COMPONENT ── */
.story-stack-wrap {
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    align-self: center;
}

.stack-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 600px;
    user-select: none;
}

.stack-card-rotate {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.stack-card-rotate:active {
    cursor: grabbing;
}

/* 
   REFACTORED: 
   Removed permanent `will-change: transform`. GPU promotion is handled
   dynamically via `.is-dragging` class in JS touch/mouse handlers.
*/
.stack-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.stack-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
}

.stack-card.sending-back {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

@media (min-width: 720px) {

    .story-section:not(#storyProcess),
    .story-quote {
        padding-left: max(32px, calc((100vw - 880px) / 2));
        padding-right: max(32px, calc((100vw - 880px) / 2));
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .story-quote-inner {
        flex-direction: row;
        align-items: center;
        gap: 56px;
    }

    .story-stack-wrap {
        width: 260px;
        height: 260px;
        flex-shrink: 0;
    }

    .testimonial-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .story-hero,
    .story-section,
    .pillars-section,
    .story-quote {
        padding-left: max(32px, calc((100vw - 880px) / 2));
        padding-right: max(32px, calc((100vw - 880px) / 2));
    }

    .process-grid,
    .testimonial-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .testimonial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── SHOP TAB ── */
.shop-topbar {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    max-height: 72px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.24s ease,
        padding 0.32s ease,
        border-color 0.32s ease;
}

body.shop-scrolled .shop-topbar {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
}

.shop-topbar-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.shop-topbar-count {
    font-size: 12px;
    color: var(--ink-soft);
    font-weight: 400;
}

/* 
   REFACTORED:
   Removed permanent `will-change: transform` to protect hardware systems
   from pre-allocating layers when inactive.
*/
.shop-filters {
    position: sticky;
    top: calc(var(--header-h, 56px) + max(0px, env(safe-area-inset-top)));
    z-index: 110;
    padding: 6px 20px 10px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.shop-scrolled .shop-filters {
    transform: translateY(-56px);
}

.shop-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.shop-search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    stroke: var(--ink-soft);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.shop-search {
    width: 100%;
    min-height: 44px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-appearance: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.shop-search:focus {
    outline: none;
    border-color: var(--ink);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

@media (min-width: 720px) {
    .category-bar {
        justify-content: center;
    }
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.category-chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.category-chip:active {
    transform: scale(0.98);
}

.filter-empty {
    display: none;
    padding: 52px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.filter-empty.visible {
    display: block;
}

.filter-empty h3 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.filter-empty p {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
}

#panel-shop {
    background: #f5f5f5;
    min-height: 100vh;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 24px 16px 16px 16px;
    min-height: 400px;
    align-items: stretch;
}

@media (min-width: 540px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        padding: 24px 20px 24px;
    }
}

@media (min-width: 720px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        padding: 20px 24px 28px;
        max-width: 960px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        max-width: 1200px;
    }
}

/* 
   REFACTORED:
   Optimized Large Grid Layouts via content-visibility.
   Skips rendering overhead and VRAM overhead for cards outside view boundaries.
*/
.p-card,
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: none;
    border: 1px solid var(--border);
    /* STABILITY: transitions removed — GPU layer promotion on transform is prime corruption suspect */
    /* transition: transform 0.2s ease, box-shadow 0.2s ease; */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    /* STABILITY: content-visibility removed — known Android Chrome <108 GPU tile dropout trigger */
    /* content-visibility: auto; */
    /* contain-intrinsic-size: auto 340px; */
}

@media (hover: hover) {

    .p-card:hover,
    .product-card:hover {
        border-color: #cbd5e1;
    }

    .p-card:hover .p-img,
    .product-card:hover .product-img {
        transform: scale(1.03);
    }
}

.p-card:active,
.product-card:active {
    /* STABILITY: scale transform disabled — forces compositor layer, suspected corruption trigger */
    /* transform: scale(0.985); */
}

.p-img-wrap,
.product-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #cbd5e1;
    background-image: url('/static/logo.png');
    background-size: 64px;
    background-repeat: no-repeat;
    background-position: center;
    overflow: hidden;
    min-height: 0;
}

.p-img,
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* STABILITY: image scale transition disabled — triggers GPU compositing layer per card */
    /* transition: transform 0.35s ease; */
}

.p-status {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.p-status.available {
    color: var(--green);
}

.p-status.available::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.p-status.sold {
    color: var(--ink-soft);
}

.p-status.sold::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-soft);
    flex-shrink: 0;
}

.p-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    justify-content: space-between;
}

.p-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.35;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.p-price {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.p-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.p-add-btn {
    flex: 1;
    padding: 9px 0;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-appearance: none;
    transition: background 0.15s;
    min-height: 34px;
}

.p-add-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.p-add-btn:hover:not([disabled]):not(.loading):not(.success) {
    background: #2a2a2a;
}

.p-add-btn:active:not([disabled]):not(.loading) {
    transform: scale(0.97);
}

.p-add-btn.success {
    background: var(--green);
    pointer-events: none;
}

.p-add-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.p-add-btn[disabled] {
    background: var(--surface);
    color: var(--ink-soft);
    cursor: not-allowed;
    border: 1px solid var(--border);
}

/* ── Scarcity Indicator ───────────────────────────────────── */
.p-scarcity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px;
}

.p-scarcity-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 99px;
    overflow: hidden;
}

.p-scarcity-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #ef4444);
    border-radius: 99px;
    transition: width 0.6s ease;
    animation: scarcity-pulse 2s ease-in-out infinite;
}

@keyframes scarcity-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.p-scarcity-label {
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    white-space: nowrap;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.p-share-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    transition: background 0.15s, border-color 0.15s;
    color: var(--ink-soft);
}

.p-share-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.p-share-btn:hover {
    background: var(--surface);
    border-color: var(--ink-soft);
}

.p-share-btn:active {
    background: var(--border);
    transform: scale(0.95);
}

.p-card-links {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.p-mini-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.15s, border-color 0.15s;
}

.p-mini-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.p-mini-btn:hover {
    background: rgba(37, 99, 235, 0.06);
    border-color: var(--blue);
    color: var(--blue);
}

.p-mini-btn:active {
    background: rgba(17, 17, 17, 0.1);
    transform: scale(0.98);
}

.p-review-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--ink-soft);
}

.p-stars {
    color: #f59e0b;
}

.p-review-count {
    font-size: 11px;
    color: var(--ink-soft);
}

.share-toast {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 9px 16px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9998;
}

.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.spin {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.shop-empty {
    padding: 60px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.shop-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--border);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin: 0 auto 16px;
    display: block;
}

.shop-empty h3 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.shop-empty p {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
}

/* ── CART DRAWER ── */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
}

.cart-overlay.open {
    display: block;
}

.cart-scrim {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    animation: scrimIn 0.2s ease;
}

@keyframes scrimIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cart-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-radius: 14px 14px 0 0;
    border-top: 1px solid var(--border);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: sheetUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

@keyframes sheetUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cart-pill {
    width: 32px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.cart-hd {
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-hd-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cart-hd-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    transition: background 0.15s;
}

.cart-hd-close:hover {
    background: var(--surface);
}

.cart-hd-close:active {
    background: var(--border);
}

.cart-hd-close svg {
    width: 13px;
    height: 13px;
    stroke: var(--ink);
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.cart-bd {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 0;
    gap: 10px;
}

.cart-empty-state svg {
    width: 40px;
    height: 40px;
    stroke: var(--border);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-empty-state p {
    font-size: 14px;
    color: var(--ink-soft);
}

.cart-row {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-row-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface);
    flex-shrink: 0;
}

.cart-row-info {
    flex: 1;
    min-width: 0;
}

.cart-row-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-row-price {
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 10px;
}

.cart-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: none;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-appearance: none;
    transition: background 0.1s;
}

.cart-qty-btn:active {
    background: var(--surface);
}

.cart-qty-val {
    font-size: 13px;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}

.cart-del-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--ink-soft);
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.cart-del-btn:hover {
    color: var(--red);
    background: #fef2f2;
}

.cart-del-btn:active {
    color: var(--red);
}

.cart-del-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-ft {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cart-total-lbl {
    font-size: 13px;
    color: var(--ink-soft);
}

.cart-total-amt {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    -webkit-appearance: none;
    transition: background 0.15s;
}

.cart-checkout-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-checkout-btn:hover {
    background: var(--blue-dk);
}

.cart-checkout-btn:active {
    background: var(--blue-dk);
    transform: scale(0.99);
}

.cart-keep-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink-soft);
    cursor: pointer;
    -webkit-appearance: none;
}

/* CONNECTIVITY */
.conn-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}

.conn-bar.visible {
    transform: translateY(0);
}

.conn-bar.offline {
    background: var(--red);
    color: #fff;
}

.conn-bar.online {
    background: var(--green);
    color: #fff;
}

/* ── INTERACTION ANIMATION MODES ── */
.header-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    margin-right: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    -webkit-appearance: none;
}

.header-back-btn:hover {
    background: var(--surface);
}

.header-back-btn:active {
    background: var(--border);
}

.header-search-bar {
    position: relative;
    flex: 1;
    max-width: 340px;
    height: 38px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    margin: 0 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 719px) {
    .header-search-bar {
        margin: 0 8px;
        max-width: 220px;
    }

    .header-search-bar input::placeholder {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-search-bar {
        max-width: 190px;
    }

    .bs-logo-tag {
        display: none;
    }

    .header-search-bar input::placeholder {
        font-size: 12px;
    }
}

.desktop-nav-icons {
    display: none;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.desktop-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    color: var(--ink-soft);
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.15s, color 0.15s;
    -webkit-appearance: none;
}

.desktop-nav-link.active {
    color: var(--blue);
}

.desktop-nav-link:hover {
    background: var(--surface);
}

.desktop-nav-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 720px) {
    .desktop-nav-icons {
        display: flex;
    }
}

/* SEARCH OVERLAY */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 120;
}

.search-overlay.open {
    display: block;
}

.search-scrim {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    animation: scrimIn 0.2s ease;
}

.search-modal {
    position: absolute;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: #ffffff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: panelIn 0.2s ease;
    padding-bottom: 80px;
}

@media (min-width: 720px) {
    .search-modal {
        top: 64px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 600px;
        height: auto;
        max-height: calc(100vh - 100px);
        border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        border: 1px solid var(--border);
        padding-bottom: 20px;
        animation: dropDown 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.header-search-bar .search-icon {
    flex-shrink: 0;
    margin-right: 8px;
    pointer-events: none;
}

.header-search-bar input {
    flex: 1;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    width: 100%;
}

.header-search-bar input::placeholder {
    color: var(--ink-soft);
}

.header-search-bar .search-clear-btn {
    border: none;
    background: none;
    color: var(--ink-soft);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-appearance: none;
}

.header-search-bar:focus-within {
    border-color: var(--border);
    background: #ffffff;
}

body.search-mode-active .header-back-btn {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

body.search-mode-active #headerLogo {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
    margin-right: 0;
    overflow: hidden;
}

body.search-mode-active #headerRight {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    overflow: hidden;
}

body.search-mode-active .header-search-bar {
    max-width: 100%;
    margin: 0;
}

#headerLogo,
#headerRight {
    transition: width 0.3s ease, opacity 0.25s ease, transform 0.3s ease, margin 0.3s ease;
}

.search-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 720px) {
    .search-recommendations-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.rec-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .rec-card:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 20px rgba(0, 0, 0, 0.06);
    }

    .rec-card:hover .rec-img {
        transform: scale(1.03);
    }
}

.rec-card:active {
    transform: scale(0.98);
}

.rec-img-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #f0f0f0;
    overflow: hidden;
}

.rec-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.rec-body {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    text-align: center;
}

.rec-name {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-row {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 0.15s ease;
    gap: 4px;
}

.history-row:hover {
    background: #f0f0f0;
}

.history-term-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.history-term-btn svg {
    display: none;
}

.history-delete-btn {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.15s ease;
    -webkit-appearance: none;
}

.history-delete-btn:hover {
    color: var(--red);
}

.support-link-item {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.support-link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08);
}

.support-link-item:active {
    transform: scale(0.985);
}

/* ── Live Search Grouped Results ─────────────────────────────────────────── */
.live-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s ease;
    margin-bottom: 4px;
}
.live-search-row:hover,
.live-search-row:focus {
    background: #f8fafc;
    outline: none;
}
.live-search-img-wrap {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f1f5f9;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.live-search-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.live-search-vendor-logo {
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
}
.live-search-info {
    flex: 1;
    min-width: 0;
}
.live-search-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── CATEGORY RAIL ───────────────────────────────────────────────────────────── */
.cat-rail {
    position: sticky;
    top: var(--header-h, 60px);
    z-index: 190;
    background: var(--bg, #fff);
    border-bottom: 1px solid var(--border, #e8e8e8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cat-rail-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 16px;
    /* Fade edges left and right */
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}

.cat-rail-inner::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body, inherit);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid transparent;
}

.cat-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cat-chip.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

/* ── SUPPORT FAB ─────────────────────────────────────────────────────────────── */
.support-fab {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(15,23,42,0.22);
    z-index: 197;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, background 0.2s;
}

.support-fab:hover {
    background: #1e293b;
    box-shadow: 0 8px 24px rgba(15,23,42,0.28);
    transform: translateY(-2px);
}

.support-fab.active {
    background: #334155;
    transform: scale(0.92);
}

@media (min-width: 720px) {
    .support-fab {
        bottom: 24px;
    }
}

/* ── SUPPORT FAB BACKDROP ───────────────────────────────────────────────────── */
.support-fab-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 196;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.support-fab-backdrop.open {
    display: block;
    animation: sfmFadeIn 0.18s ease;
}

/* ── SUPPORT FAB MINI-MODAL ─────────────────────────────────────────────────── */
.support-fab-modal {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom) + 72px);
    right: 16px;
    width: 280px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(15,23,42,0.18), 0 2px 8px rgba(15,23,42,0.08);
    z-index: 198;
    opacity: 0;
    transform: scale(0.88) translateY(16px);
    pointer-events: none;
    transform-origin: bottom right;
    transition: opacity 0.2s cubic-bezier(0.34,1.56,0.64,1), transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.support-fab-modal.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

@media (min-width: 720px) {
    .support-fab-modal {
        bottom: 88px;
    }
}

.support-fab-modal-inner {
    padding: 20px;
}

.sfm-header {
    position: relative;
    margin-bottom: 16px;
}

.sfm-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
}

.sfm-sub {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.sfm-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.sfm-close:hover {
    background: #e2e8f0;
}

.sfm-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sfm-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.15s, transform 0.12s;
    cursor: pointer;
}

.sfm-option:hover {
    transform: translateX(2px);
}

.sfm-option > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sfm-opt-label {
    font-size: 13px;
    font-weight: 700;
}

.sfm-opt-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.65;
}

.sfm-arrow {
    flex-shrink: 0;
    opacity: 0.4;
}

.sfm-whatsapp {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sfm-whatsapp:hover {
    background: #dcfce7;
}

.sfm-email {
    background: #f8faff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.sfm-email:hover {
    background: #eff6ff;
}

@keyframes sfmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── CATEGORY RAIL ── */
.cat-rail {
    position: sticky;
    top: 64px; /* below the header */
    z-index: 100;
    background: var(--bg, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
    padding: 10px 0;
    margin-bottom: 16px;
}

.cat-rail-inner {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.cat-rail-inner::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body, inherit);
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.cat-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cat-chip:active {
    transform: scale(0.97);
}

.cat-chip.active {
    background: #0f172a;
    color: #ffffff;
}
