/*
   SCRAPD - DESIGN SYSTEM
   A highly aesthetic, premium, Depop-inspired styling.
*/

:root {
    /* Color Palette - SCRAPD */
    /* New SCRAPD brand tokens (preferred — use these going forward) */
    --color-primary:    #324224;   /* dark olive green */
    --color-accent:     #CE522A;   /* burnt orange / terra cotta */
    --color-accent-2:   #b1431f;   /* darker terra cotta for AA contrast */
    --color-background: #F5F0E4;   /* warm cream */
    --color-text:       #1E1A14;   /* near-black warm */
    --color-muted:      #6F6147;   /* AA-passing muted text */
    --color-shadow:     #E1D9CA;   /* light warm shadow */

    /* Legacy variable names mapped to the new SCRAPD palette
       (kept so existing selectors continue to work without rewrites) */
    --bg-primary: #F5F0E4;        /* was olive — now warm cream */
    --bg-secondary: #FFFFFF;       /* white surface */
    --text-primary: #1E1A14;       /* near-black warm */
    --text-secondary: #6F6147;     /* muted warm brown (AA passing) */

    /* Bold Eclectic Accents */
    --accent-primary: #CE522A;     /* burnt orange / terra cotta */
    --accent-hover: #b1431f;       /* darker terra cotta */
    --nav-bg: #324224;             /* dark olive green nav */
    --btn-beige: #E1D9CA;          /* warm shadow tone */

    --border-color: #1E1A14;       /* near-black warm */
    --border-color-dark: #1E1A14;

    /* Typography - SCRAPD */
    --font-heading: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --font-body: 'Work Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-accent: 'Big Shoulders Display', sans-serif;
    --font-logo: 'Big Shoulders Display', sans-serif;

    /* Elegant Shapes */
    /* Fluid nav height: ~64px on small phones, scales to 160px on desktop */
    --nav-height: clamp(64px, 9vw, 160px);
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;

    /* Refined Shadows */
    --shadow-sm: 0 4px 12px rgba(44, 42, 41, 0.04);
    --shadow-md: 0 8px 24px rgba(44, 42, 41, 0.06);
    --shadow-hover: 0 12px 32px rgba(44, 42, 41, 0.1);

    /* Layout */
    --border-width: 1px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    background-image: none;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-top: var(--nav-height);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    border-bottom: 4px solid var(--accent-primary);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

.nav-center {
    gap: 32px;
}

.nav-right {
    gap: 16px;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease-in-out;
}

.brand-logo {
    height: clamp(40px, 7vw, 140px);
    max-height: calc(var(--nav-height) - 16px);
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.brand-logo-link:hover {
    transform: scale(1.03) rotate(-2deg);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 32px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border-radius: var(--border-radius-sm);
    border: var(--border-width) solid var(--text-primary);
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--text-primary);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: #FFFFFF;
    transition: var(--transition-fast);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-body);
}

.nav-btn:hover {
    color: var(--accent-primary);
}

.nav-btn.active {
    color: var(--accent-primary);
}

.sell-btn {
    background-color: var(--accent-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 0;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.sell-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.login-btn-style {
    background-color: var(--btn-beige);
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    font-weight: bold;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background-color 0.2s;
}
.login-btn-style:hover {
    background-color: var(--color-shadow);
}

/* Layout Core */
main {
    min-height: calc(100vh - var(--nav-height));
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ---------- Hamburger button (hidden on desktop, visible on mobile) ---------- */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.nav-hamburger .hamburger-bar {
    display: block;
    position: absolute;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-hamburger {
    position: relative;
}

.nav-hamburger .hamburger-bar:nth-child(1) { transform: translateY(-7px); }
.nav-hamburger .hamburger-bar:nth-child(2) { transform: translateY(0); }
.nav-hamburger .hamburger-bar:nth-child(3) { transform: translateY(7px); }

.nav-hamburger.is-open .hamburger-bar:nth-child(1) { transform: translateY(0) rotate(45deg); }
.nav-hamburger.is-open .hamburger-bar:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open .hamburger-bar:nth-child(3) { transform: translateY(0) rotate(-45deg); }

/* ---------- Cart icon button (always visible top-right) ---------- */
.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-icon-btn i {
    font-size: 1.4rem;
    color: #fff;
}

.nav-icon-btn:hover i {
    color: var(--accent-primary);
}

.cart-count-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    display: none;
}

.cart-count-badge.has-items { display: inline-block; }

/* ---------- Mobile drawer ---------- */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 1500;
    pointer-events: none;
    visibility: hidden;
}

.mobile-drawer.open {
    pointer-events: auto;
    visibility: visible;
}

.mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 26, 20, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer.open .mobile-drawer-backdrop {
    opacity: 1;
}

.mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(85vw, 340px);
    background: var(--nav-bg);
    color: #fff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.25);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open .mobile-drawer-panel {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.mobile-drawer-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
}

.mobile-drawer-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 4px;
}

.mobile-drawer-close:hover { color: var(--accent-primary); }

.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.drawer-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 24px;
    background: transparent;
    border: 0;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.drawer-link:hover,
.drawer-link:focus-visible {
    background: rgba(255,255,255,0.06);
    color: var(--accent-primary);
    outline: none;
}

.drawer-link-cta {
    margin: 16px 24px;
    padding: 14px 16px;
    width: calc(100% - 48px);
    min-height: 48px;
    background: var(--accent-primary);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: center;
    justify-content: center;
    border-radius: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.drawer-link-cta:hover {
    background: var(--accent-hover);
    color: #fff;
}

body.drawer-open {
    overflow: hidden;
}

/* ---------- Mobile breakpoint: collapse desktop nav, show hamburger ---------- */
@media (max-width: 767px) {
    .mobile-hide {
        display: none;
    }

    .search-bar {
        display: none;
    }

    /* Desktop center links + auth/CTA hide on mobile */
    .nav-center {
        display: none;
    }
    .nav-desktop-only {
        display: none !important;
    }

    .nav-container {
        padding: 0 16px;
        gap: 8px;
    }

    .nav-right {
        gap: 4px;
    }

    .nav-hamburger {
        display: inline-flex;
    }

    /* Logo sizing on mobile — sit comfortably inside the shorter bar */
    .brand-logo {
        height: clamp(32px, 8vw, 48px);
    }
}

@media (min-width: 768px) {
    /* Drawer is mobile-only; hamburger hidden on desktop */
    .nav-hamburger { display: none; }
    .mobile-drawer { display: none; }
}

#app-root {
    padding-top: 32px;
}

/* Views & Layouts */
.view-header {
    margin-top: 0;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.view-header h2 {
    font-size: clamp(2.25rem, 7vw, 5.6rem);
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    margin-top: 0;
    margin-bottom: clamp(20px, 4vw, 32px);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.sustainability-explainer {
    margin: 32px 0 40px;
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 4px;
    border: 3px solid var(--text-primary);
    outline: 2px dashed #4ade80; /* Eco green stitching */
    outline-offset: -8px;
    box-shadow: 8px 8px 0 var(--text-primary);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.auth-view {
    max-width: 400px;
    margin: 40px auto;
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 4px;
    border: 3px solid var(--text-primary);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -8px;
    box-shadow: 8px 8px 0 var(--text-primary);
    position: relative;
    color: var(--text-primary);
}

.filters {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 8px 24px;
    border-radius: 2px;
    /* Ragged fabric cut */
    background: var(--bg-primary);
    border: 2px dashed var(--accent-primary);
    /* Stitched look */
    box-shadow: 3px 3px 0 var(--text-primary);
    /* Solid flat shadow */
    font-size: 0.95rem;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    color: var(--text-primary);
    outline: 2px solid transparent;
}

.chip.active,
.chip:hover {
    background: var(--accent-secondary);
    color: var(--bg-secondary);
    border: 2px dashed var(--accent-tertiary);
    border-radius: 4px;
    box-shadow: 5px 5px 0 var(--text-primary);
    transform: translateY(-2px) rotate(-1deg);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 0;
    padding: 0;
    transition: var(--transition-smooth);
    border: 3px solid var(--border-color);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translate(-2px, -2px) rotate(1deg);
    box-shadow: 8px 8px 0 rgba(0,0,0,1);
}

.product-img-wrapper {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: var(--border-color);
    border-bottom: 3px solid var(--border-color);
    border-radius: 0;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Restored Core Components and Featured Artist */
.sustainability-explainer {
    margin: 32px 0 40px;
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 0;
    border: 3px solid var(--border-color);
    box-shadow: 8px 8px 0 var(--border-color);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.artisan-spotlight {
    position: relative;
    background-size: cover;
    background-position: center;
    background-image: url('assets/featured_patchwork.png');
    border: 3px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 40px;
}

.spotlight-content {
    position: relative;
    padding: 32px;
    color: #FFF;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.1));
}

.artisan-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.spotlight-text {
    flex: 1;
}

.spotlight-text h3 {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.spotlight-label {
    display: inline-block;
    background: var(--accent-primary);
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--border-color);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.08);
}

.spotlight-content {
    position: relative;
    padding: 32px;
    color: #FFFFFF;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.artisan-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-secondary);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.spotlight-text {
    flex: 1;
}

.spotlight-label {
    display: inline-block;
    background: var(--accent-tertiary);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    margin-bottom: 8px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-info {
    padding: 16px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.price {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 700;
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 6px;
}

.brand {
    font-size: 0.8rem;
    color: var(--accent-tertiary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.title {
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

/* Profiles */
.profile-header {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 32px;
    padding: 32px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 3px solid var(--text-primary);
    outline: 2px dashed var(--accent-secondary);
    outline-offset: -8px;
    border-radius: 4px;
    box-shadow: 8px 8px 0 var(--text-primary);
}

.avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.profile-stats h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.bio {
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 400px;
    line-height: 1.6;
    font-size: 1.05rem;
}

.stats-row {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dotted var(--border-color);
}

.stat {
    font-size: 1rem;
}

.stat strong {
    font-weight: 800;
    color: var(--text-primary);
}

.stat span {
    color: var(--text-secondary);
}

.profile-tabs {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    padding-bottom: 12px;
}

.profile-tabs .tab {
    padding: 12px 0;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    font-size: 1.1rem;
}

.profile-tabs .tab.active {
    color: var(--text-primary);
}

.profile-tabs .tab.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 10%;
    width: 80%;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-primary);
}

/* Cart View Styles */
.cart-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .cart-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .cart-items-section {
        flex: 1.5;
    }

    .cart-summary-section {
        flex: 1;
        position: sticky;
        top: 100px;
    }
}

.cart-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
    outline: 2px dashed var(--accent-tertiary);
    outline-offset: -6px;
    border-radius: 4px;
    margin-bottom: 24px;
    box-shadow: 6px 6px 0 var(--text-primary);
    transition: var(--transition-smooth);
}

.cart-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--accent-primary);
}

.cart-item-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-brand {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 8px;
}

.cart-item-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    cursor: pointer;
}

.cart-item-title:hover {
    color: var(--accent-primary);
}

.cart-item-size {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: auto;
}

.cart-item-price {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.remove-btn {
    align-self: flex-start;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    margin-top: 16px;
    transition: var(--transition-fast);
}

.remove-btn:hover {
    color: var(--accent-hover);
    /* Darker terra cotta for remove action hover */
}

/* Sell & Checkout Views */
.sell-form,
.checkout-view {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 4px;
    border: 3px solid var(--text-primary);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -8px;
    box-shadow: 8px 8px 0 var(--text-primary);
}

.checkout-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 768px) {
    .checkout-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .checkout-form-section {
        flex: 1.5;
    }

    .checkout-summary-section {
        flex: 1;
        position: sticky;
        top: 100px;
    }
}

.checkout-box {
    margin-bottom: 24px;
}

.checkout-box h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dotted var(--border-color);
}

.summary-box {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 4px;
    border: 2px dashed var(--text-primary);
    box-shadow: 4px 4px 0 var(--accent-secondary);
}

.summary-item-layout {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.summary-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.summary-item-details {
    flex: 1;
}

.summary-brand {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.summary-title {
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.summary-size {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-divider {
    border: none;
    border-top: 1px dotted var(--border-color);
    margin: 16px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.total-row {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 16px;
}

.checkout-btn {
    margin-top: 24px;
    border-radius: 2px;
    background: var(--text-primary);
    color: var(--bg-secondary);
    border: 2px solid var(--text-primary);
    outline: 2px dashed var(--accent-tertiary);
    outline-offset: -4px;
    font-size: 1.25rem;
    box-shadow: 4px 4px 0 var(--accent-primary);
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: var(--transition-smooth);
}

.checkout-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--accent-primary);
    background: var(--accent-secondary);
}

.trust-badges {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 16px;
}

.trust-badges p {
    margin-bottom: 4px;
}

.trust-badges i {
    color: var(--accent-secondary);
    margin-right: 4px;
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.split {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: rgba(253, 251, 247, 0.5);
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--text-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px rgba(163, 130, 118, 0.2);
}

.photo-upload {
    border: 2px dashed rgba(163, 130, 118, 0.4);
    /* subtle terracotta */
    padding: 48px;
    text-align: center;
    border-radius: 40px 15px 40px 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(253, 251, 247, 0.4);
}

.photo-upload:hover {
    border-color: var(--accent-primary);
    background: rgba(212, 197, 185, 0.2);
    /* warm sand */
    border-radius: 15px 40px 15px 40px;
}

.photo-upload i {
    font-size: 2.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.photo-upload h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.photo-upload p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hash-pill {
    background: rgba(140, 154, 134, 0.15);
    /* Soft Sage background */
    border: 1px solid var(--accent-secondary);
    padding: 6px 16px;
    border-radius: 10px 25px 10px 25px;
    /* Unique organic shape */
    font-size: 0.85rem;
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 2px 2px 0 rgba(140, 154, 134, 0.4);
    transition: var(--transition-smooth);
}

.hash-pill:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    border-radius: 25px 10px 25px 10px;
    /* Toggle shape */
    box-shadow: 3px 4px 0 rgba(140, 154, 134, 0.6);
    transform: translateY(-2px);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--text-primary);
    color: var(--bg-secondary);
    font-weight: 600;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.25rem;
    border: 1px solid var(--text-primary);
    border-radius: 30px 10px 30px 10px;
    transition: var(--transition-smooth);
    margin-top: 8px;
    box-shadow: 2px 3px 0 rgba(44, 42, 41, 0.2);
    cursor: pointer;
}

.submit-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 4px 5px 0 rgba(44, 42, 41, 0.3);
    border-radius: 10px 30px 10px 30px;
}

/* Search Categories */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.pill {
    padding: 12px 28px;
    background: rgba(212, 197, 185, 0.2);
    /* Soft sand background */
    border: 1px solid var(--accent-tertiary);
    border-radius: 30px 10px 30px 10px;
    font-weight: 600;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 2px 3px 0 rgba(212, 197, 185, 0.5);
    backdrop-filter: blur(2px);
}

.pill:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 10px 30px 10px 30px;
    transform: translateY(-3px);
    box-shadow: 4px 5px 0 rgba(212, 197, 185, 0.6);
}

.search-hero input {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: var(--bg-secondary);
    transition: var(--transition-fast);
}

.search-hero input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

/* Edgy Image Graphics Removed */

.search-hero {
    position: relative;
    padding: 80px 40px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background-image: url('assets/search_banner.png');
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artisan-spotlight {
    position: relative;
    width: 100%;
    height: 480px;
    margin-top: 24px;
    margin-bottom: 48px;
    border: var(--border-width) solid var(--text-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background-image: url('./assets/artisan_spotlight.png');
    background-size: cover;
    background-position: center;
    background-color: var(--text-primary);
    display: flex;
    align-items: flex-end;
    box-shadow: 4px 4px 0 var(--text-primary);
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
        gap: 16px;
    }

    .stats-row {
        justify-content: center;
    }

    .sell-form {
        padding: 24px;
    }

    .photo-upload {
        padding: 32px 16px;
    }

    .product-detail-layout {
        flex-direction: column;
        gap: 24px;
    }

    .product-detail-info {
        max-width: 100%;
    }
}

/* Product Detail View */
.back-btn {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.back-btn:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

.product-detail-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.product-detail-img {
    flex: 1;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: var(--shadow-md);
}

.product-detail-img img {
    width: 100%;
    height: auto;
    display: block;
}

.product-detail-info {
    flex: 1;
    max-width: 450px;
    padding-top: 16px;
}

.seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.seller-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.seller-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
}

.product-detail-info h2 {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.product-detail-info .price {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.brand-size {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.product-detail-info hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 32px 0;
}

.product-detail-info .description {
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 40px;
}

.buy-btn {
    background: var(--accent-primary);
    margin-top: 0;
}

.buy-btn:hover {
    background: var(--text-primary);
    color: var(--bg-secondary);
}

.message-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.message-btn:hover {
    background: var(--bg-primary);
}

/* New Elegant CSS Badges */
.css-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    padding: 6px 14px;
    border-radius: 20px 4px 20px 4px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    z-index: 10;
    border: 1px solid var(--text-primary);
}

.staff-pick-badge {
    background: var(--text-primary);
}

.trending-badge {
    background: var(--accent-primary);
    border-color: var(--text-primary);
}

/* Offer Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 42, 41, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    width: 90%;
    max-width: 500px;
    padding: 32px;
    border-radius: 30px 10px 30px 10px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-style: italic;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

/* Messages & Seller Offer View */
.messages-view {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(253, 251, 247, 0.7);
    border-radius: 30px 10px 30px 10px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 24px;
    background: rgba(253, 251, 247, 0.9);
    border-bottom: 1px dashed var(--border-color);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 16px;
    border: 2px solid var(--accent-tertiary);
}

.chat-header-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.chat-header-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    font-family: var(--font-heading);
}

.chat-history {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 70%;
    padding: 16px;
    position: relative;
    box-shadow: 2px 2px 0 rgba(44, 42, 41, 0.1);
}

.chat-bubble p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.chat-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px 20px 20px 5px;
    /* Organic leaf chat */
}

.chat-bubble.sent {
    align-self: flex-end;
    background: rgba(140, 154, 134, 0.2);
    /* Soft sage */
    border: 1px solid var(--accent-secondary);
    border-radius: 20px 20px 5px 20px;
}

.chat-input-area {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-family: var(--font-body);
}

.chat-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(163, 130, 118, 0.1);
}

.icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: scale(1.05);
}

.send-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.send-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: rgba(253, 251, 247, 0.7);
    border: 1px dashed var(--border-color-dark);
    border-radius: 40px 15px 40px 15px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
    margin: 24px auto;
    max-width: 600px;
    color: var(--text-primary);
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 42, 41, 0.85); /* rgba(--bg-primary, 0.85) roughly */
    backdrop-filter: blur(5px);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-md);
}

.narrative-modal h2 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.narrative-modal .modal-body {
    font-family: var(--font-body);
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 12px;
}

.narrative-modal .narrative-intro {
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.narrative-modal h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.narrative-modal ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 25px;
}

.narrative-modal ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.narrative-modal ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.narrative-modal .narrative-outro {
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: var(--transition-fast);
}

.btn-cancel:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-confirm {
    padding: 10px 20px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-confirm:hover {
    background: var(--accent-primary);
}

/* =============================================================
   M9 — Mobile responsiveness pass
   Touch targets, fluid grid, footer stack, layout overflow guards
   ============================================================= */

/* Ensure tappable controls clear the 44px minimum on touch devices */
@media (max-width: 767px) {
    .chip,
    .pill,
    .nav-btn,
    .login-btn-style,
    .sell-btn,
    .btn-cancel,
    .btn-confirm,
    .checkout-btn,
    .submit-btn,
    .icon-btn,
    .send-btn,
    .remove-btn {
        min-height: 44px;
    }

    /* Chips: keep visual identity, ensure tap area */
    .chip {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    /* Form controls comfortable on touch */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
        min-height: 44px;
    }

    /* Two-up product grid on phones (was wide single column) */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Tighter card chrome on small viewports */
    .product-card { border-width: 2px; }
    .product-info { padding: 12px; }
    .title { font-size: 0.9rem; }
    .price { font-size: 1rem; }

    /* View shell: edge breathing room, kill brutal shadows that overflow */
    main {
        padding: 16px 12px 32px;
    }

    /* Auth/sell/checkout cards: don't let brutalist shadow create horizontal scroll */
    .auth-view,
    .sell-form,
    .checkout-view,
    .profile-header,
    .sustainability-explainer,
    .cart-item,
    .summary-box {
        box-shadow: 4px 4px 0 var(--text-primary);
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    .auth-view {
        margin: 16px auto;
        padding: 24px 20px;
    }

    .sell-form,
    .checkout-view {
        padding: 24px 16px;
    }

    .profile-header {
        padding: 20px 16px;
    }

    /* Section headings tighter on mobile */
    .view-header {
        margin-bottom: 16px;
    }

    /* Filters scroll-row instead of wrapping into a wall */
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .filters::-webkit-scrollbar { display: none; }

    /* Spotlight stack vertically */
    .spotlight-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px;
    }
    .artisan-avatar {
        width: 72px;
        height: 72px;
    }
    .spotlight-text h3 { font-size: 1.4rem; }
    .artisan-spotlight { height: auto; min-height: 320px; }

    /* Search hero compresses */
    .search-hero {
        padding: 40px 20px;
    }

    /* Cart item stacks */
    .cart-item {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    .cart-item-img {
        width: 100%;
        height: 180px;
    }

    /* Product detail layout already collapses; tidy the back-btn */
    .back-btn { font-size: 0.95rem; }

    /* Footer columns stack */
    footer > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Form rows stack */
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    .form-row .split { width: 100%; }
}

/* Extra-small phones (≤360px) need a touch more breathing room */
@media (max-width: 360px) {
    .nav-container { padding: 0 12px; }
    .product-grid { gap: 8px; }
    .product-info { padding: 10px; }
    .view-header h2 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
}

/* Global guard: prevent unintentional horizontal scroll from rogue children */
html, body { max-width: 100%; }
img, video { max-width: 100%; height: auto; }

/* =============================================================
   SCRAPD HOMEPAGE REDESIGN (Demo build)
   New header (Etsy/Depop hybrid) + redesigned views.home sections.
   All colors pulled from existing CSS variables — no new tokens.
   ============================================================= */

/* ---------- Header: search bar + sub-nav ---------- */
/* Two-row header (search + sub-nav rail) is taller than the legacy single bar.
   Override body padding so the first section clears the fixed nav. */
body { padding-top: 132px; }

.scrapd-navbar {
    flex-direction: column;
    height: auto;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
}

.scrapd-nav-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    gap: 24px;
    align-items: center;
}

.nav-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search {
    position: relative;
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
}

.global-search-icon {
    position: absolute;
    left: 18px;
    color: var(--color-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.global-search-input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border: 2px solid var(--color-text);
    background: var(--bg-secondary);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--color-text);
    transition: var(--transition-fast);
}

.global-search-input::placeholder {
    color: var(--color-muted);
    font-style: italic;
}

.global-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 4px 4px 0 var(--color-accent);
}

.subnav-rail {
    width: 100%;
    background: var(--color-background);
    border-top: 2px solid var(--color-text);
    border-bottom: 4px solid var(--color-accent);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.subnav-rail::-webkit-scrollbar { display: none; }

.subnav-rail-inner {
    display: flex;
    gap: 6px;
    padding: 10px 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: max-content;
    min-width: 100%;
}

.subnav-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--color-text);
    background: transparent;
    border: 2px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
    transition: var(--transition-fast);
    text-decoration: none;
}
.subnav-chip:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.subnav-chip-soft {
    color: var(--color-primary);
    border: 2px dashed var(--color-primary);
}
.subnav-chip-soft:hover {
    background: var(--color-primary);
    color: var(--color-background);
    border-style: solid;
}

/* Mobile-only utility */
.mobile-only { display: none; }

/* Mobile expanding search panel */
.mobile-search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-background);
    border-bottom: 4px solid var(--color-accent);
    padding: 14px 16px;
    z-index: 1100;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    display: flex;
}
.mobile-search-panel.open {
    transform: translateY(0);
}
.mobile-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}
.mobile-search-form i {
    position: absolute;
    left: 16px;
    color: var(--color-muted);
}
.mobile-search-bar-input {
    flex: 1;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--color-text);
    background: var(--bg-secondary);
    border-radius: 999px;
    font-size: 16px;
    font-family: var(--font-body);
}
.mobile-search-bar-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.mobile-search-close {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.4rem;
    padding: 8px 12px;
    cursor: pointer;
}

/* ---------- Hero ---------- */
.scrapd-hero {
    position: relative;
    margin: -32px -24px 48px;
    padding: clamp(64px, 10vw, 140px) 24px;
    overflow: hidden;
    border-bottom: 4px solid var(--color-text);
    color: var(--color-background);
    isolation: isolate;
}
.scrapd-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transform: scale(1.05);
    filter: contrast(1.05) saturate(1.1);
}
.scrapd-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(50, 66, 36, 0.88) 0%, rgba(30, 26, 20, 0.78) 60%, rgba(206, 82, 42, 0.55) 100%);
    z-index: -1;
}
.scrapd-hero-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}
.scrapd-hero-eyebrow {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-background);
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--color-background);
    box-shadow: 4px 4px 0 var(--color-text);
    margin-bottom: 28px;
    transform: rotate(-1deg);
}
.hero-headline {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
    color: var(--color-background);
    text-shadow: 4px 4px 0 rgba(0,0,0,0.35);
}
.hero-sub {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.55;
    color: rgba(245, 240, 228, 0.95);
    margin: 0 auto 36px;
    max-width: 620px;
}
.hero-cta-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-cta-primary {
    width: auto !important;
    padding: 16px 32px !important;
    font-size: 1rem !important;
}
.hero-cta-secondary {
    width: auto !important;
    padding: 16px 32px !important;
    font-size: 1rem !important;
    background: transparent !important;
    color: var(--color-background) !important;
    border: 2px solid var(--color-background) !important;
}
.hero-cta-secondary:hover {
    background: var(--color-background) !important;
    color: var(--color-text) !important;
}

/* ---------- Trust strip ---------- */
.trust-strip {
    background: var(--color-shadow);
    border: 2px dashed var(--color-primary);
    margin: 0 0 64px;
    padding: 20px 24px;
    box-shadow: 6px 6px 0 var(--color-text);
}
.trust-strip-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 32px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.4;
}
.trust-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-background);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.trust-copy strong {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    margin-right: 4px;
    letter-spacing: 0.01em;
}

/* ---------- Generic home section header ---------- */
.home-section {
    margin-bottom: 64px;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px dashed var(--color-text);
}
.section-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--color-text);
}
.section-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}
.section-link:hover {
    border-bottom-color: var(--color-accent);
}

/* ---------- Category rail (Depop-style) ---------- */
.cat-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    scrollbar-width: thin;
}
.cat-rail::-webkit-scrollbar { height: 6px; }
.cat-rail::-webkit-scrollbar-thumb { background: var(--color-muted); border-radius: 4px; }

.cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 4/5;
    padding: 18px 18px 22px;
    border: 3px solid var(--color-text);
    box-shadow: 6px 6px 0 var(--color-text);
    text-decoration: none;
    scroll-snap-align: start;
    transition: var(--transition-smooth);
    overflow: hidden;
}
.cat-tile:hover {
    transform: translate(-3px, -3px) rotate(-1deg);
    box-shadow: 10px 10px 0 var(--color-text);
}
.cat-tile-eyebrow {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.7;
}
.cat-tile-name {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-top: auto;
}
.cat-tile-count {
    font-family: var(--font-body);
    font-size: 0.8rem;
    margin-top: 8px;
    opacity: 0.8;
}
.cat-tile-arrow {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 1.5rem;
    font-weight: 900;
    transition: transform 0.25s ease;
}
.cat-tile:hover .cat-tile-arrow {
    transform: translateX(4px);
}

/* ---------- Product rail (horizontal scroll) ---------- */
.product-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 240px);
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
    scrollbar-width: thin;
}
.product-rail::-webkit-scrollbar { height: 6px; }
.product-rail::-webkit-scrollbar-thumb { background: var(--color-muted); border-radius: 4px; }
.product-rail-card {
    scroll-snap-align: start;
}

.empty-rail {
    border: 3px dashed var(--color-primary);
    background: var(--color-shadow);
    padding: 48px 24px;
    text-align: center;
}
.empty-rail-inner {
    max-width: 520px;
    margin: 0 auto;
}
.empty-rail-icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 12px;
    display: inline-block;
}
.empty-rail h4 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.6rem;
    margin: 8px 0 12px;
    letter-spacing: -0.01em;
    color: var(--color-text);
}
.empty-rail p {
    color: var(--color-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ---------- Creator spotlight ---------- */
.creator-spotlight {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    border: 3px solid var(--color-text);
    box-shadow: 8px 8px 0 var(--color-text);
    background: var(--bg-secondary);
    overflow: hidden;
}
.creator-spotlight-photo {
    background-size: cover;
    background-position: center;
    background-color: var(--color-primary);
    min-height: 360px;
    border-right: 3px solid var(--color-text);
}
.creator-spotlight-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-background);
    font-size: 5rem;
    background: var(--color-primary);
}
.creator-spotlight-body {
    padding: 36px 36px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-secondary);
}
.creator-spotlight-eyebrow {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-background);
    padding: 4px 10px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid var(--color-text);
    margin-bottom: 16px;
    align-self: flex-start;
}
.creator-spotlight-name {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--color-text);
}
.creator-spotlight-handle {
    color: var(--color-muted);
    font-size: 0.95rem;
    margin: 0 0 18px;
}
.creator-spotlight-story {
    color: var(--color-text);
    line-height: 1.65;
    margin: 0 0 28px;
    font-size: 1rem;
}
.creator-spotlight-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Creator CTA section (sellers conversion block) ---------- */
.creator-cta-section {
    margin: 0 -24px 64px;
    padding: 72px 24px;
    background: var(--color-primary);
    color: var(--color-background);
    border-top: 4px solid var(--color-accent);
    border-bottom: 4px solid var(--color-accent);
    position: relative;
    overflow: hidden;
}
.creator-cta-section::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(245, 240, 228, 0.25);
    pointer-events: none;
}
.creator-cta-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}
.creator-cta-eyebrow {
    display: inline-block;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.creator-cta-headline {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 auto 20px;
    max-width: 800px;
    color: var(--color-background);
}
.creator-cta-sub {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.6;
    color: rgba(245, 240, 228, 0.85);
    max-width: 640px;
    margin: 0 auto 48px;
}
.creator-cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
    text-align: left;
}
.creator-cta-card {
    background: rgba(245, 240, 228, 0.06);
    border: 2px solid rgba(245, 240, 228, 0.25);
    padding: 28px 24px;
    transition: var(--transition-smooth);
}
.creator-cta-card:hover {
    background: rgba(245, 240, 228, 0.12);
    border-color: var(--color-accent);
    transform: translateY(-3px);
}
.creator-cta-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-background);
    margin-bottom: 18px;
    font-size: 1.1rem;
}
.creator-cta-card h3 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.4rem;
    margin: 0 0 10px;
    color: var(--color-background);
    letter-spacing: -0.01em;
}
.creator-cta-card p {
    color: rgba(245, 240, 228, 0.8);
    line-height: 1.55;
    font-size: 0.95rem;
    margin: 0;
}
.creator-cta-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.creator-cta-button {
    width: auto !important;
    padding: 18px 36px !important;
    font-size: 1.05rem !important;
    background: var(--color-accent) !important;
    color: var(--color-background) !important;
    border: 2px solid var(--color-background) !important;
}
.creator-cta-button:hover {
    background: var(--color-background) !important;
    color: var(--color-primary) !important;
    border-color: var(--color-background) !important;
}
.creator-cta-foot-note {
    color: rgba(245, 240, 228, 0.65);
    font-size: 0.85rem;
    font-style: italic;
}

/* ---------- Giving Back card ---------- */
.giving-back-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    background: var(--color-background);
    border: 2px dashed var(--color-accent);
    padding: 28px 32px;
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition-smooth);
}
.giving-back-card:hover {
    background: var(--color-shadow);
    transform: translateY(-2px);
    border-color: var(--color-primary);
}
.giving-back-card-mark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-background);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.giving-back-eyebrow {
    display: block;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}
.giving-back-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    line-height: 1.1;
    margin: 0 0 8px;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.giving-back-copy {
    color: var(--color-muted);
    line-height: 1.5;
    font-size: 0.95rem;
    margin: 0 0 8px;
}
.giving-back-link {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---------- Final CTA split ---------- */
.final-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0 -24px 0;
    border-top: 4px solid var(--color-text);
}
.final-cta-side {
    padding: 56px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.final-cta-shop {
    background: var(--color-shadow);
    color: var(--color-text);
    border-right: 2px dashed var(--color-text);
}
.final-cta-sell {
    background: var(--color-primary);
    color: var(--color-background);
}
.final-cta-side h3 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.final-cta-shop h3 { color: var(--color-text); }
.final-cta-sell h3 { color: var(--color-background); }
.final-cta-side p {
    margin: 0 0 8px;
    font-size: 0.95rem;
}
.final-cta-shop p { color: var(--color-muted); }
.final-cta-sell p { color: rgba(245, 240, 228, 0.8); }
.final-cta-sell-btn {
    background: transparent !important;
    color: var(--color-background) !important;
    border: 2px solid var(--color-background) !important;
}
.final-cta-sell-btn:hover {
    background: var(--color-background) !important;
    color: var(--color-primary) !important;
}

/* =============================================================
   Responsive overrides — homepage redesign
   ============================================================= */
@media (max-width: 900px) {
    .creator-spotlight {
        grid-template-columns: 1fr;
    }
    .creator-spotlight-photo {
        min-height: 240px;
        border-right: none;
        border-bottom: 3px solid var(--color-text);
    }
    .creator-spotlight-body {
        padding: 28px 24px;
    }
}

@media (max-width: 767px) {
    body { padding-top: 108px; }
    .scrapd-nav-container {
        padding: 10px 12px;
        gap: 12px;
    }
    .nav-search-wrap { display: none; }
    .mobile-only { display: inline-flex; }
    .nav-desktop-only { display: none !important; }

    .subnav-rail-inner {
        padding: 8px 12px;
    }
    .subnav-chip {
        font-size: 0.85rem;
        padding: 5px 12px;
    }

    .scrapd-hero {
        margin: -16px -12px 36px;
        padding: 56px 20px;
    }
    .hero-headline {
        font-size: clamp(2.4rem, 12vw, 3.6rem);
    }

    .trust-strip {
        margin: 0 0 48px;
        padding: 16px 18px;
        box-shadow: 4px 4px 0 var(--color-text);
    }
    .trust-strip-inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .home-section { margin-bottom: 48px; }
    .section-title { font-size: 1.6rem; }

    .cat-rail {
        grid-auto-columns: 65%;
        gap: 12px;
    }
    .cat-tile {
        padding: 14px;
        box-shadow: 4px 4px 0 var(--color-text);
    }

    .product-rail {
        grid-auto-columns: 70%;
        gap: 12px;
    }

    .creator-cta-section {
        margin: 0 -12px 48px;
        padding: 48px 20px;
    }
    .creator-cta-section::before { inset: 8px; }
    .creator-cta-headline { font-size: 1.85rem; }
    .creator-cta-grid { gap: 16px; margin-bottom: 32px; }

    .giving-back-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px 20px;
    }
    .giving-back-card-mark { margin: 0 auto; }

    .final-cta {
        grid-template-columns: 1fr;
        margin: 0 -12px;
    }
    .final-cta-shop {
        border-right: none;
        border-bottom: 2px dashed var(--color-text);
    }
    .final-cta-side { padding: 40px 24px; }
}

/* =====================================================================
   ACCESSIBILITY + UX PATCH (audit pass — header keyboard a11y, focus
   rings, active states, skip-link, reduced-motion). Appended last so
   these rules win specificity battles with earlier nav declarations.
   ===================================================================== */

/* Visually-hidden utility (a11y standard) */
.sr-only {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0,0,0,0) !important;
    white-space: nowrap !important; border: 0 !important;
}

/* Skip-to-content link — pinned top-left, only visible on keyboard focus */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 10001;
    padding: 12px 20px;
    background: var(--color-text);
    color: var(--color-background);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--color-accent);
    transition: top 0.18s ease-out;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 12px;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* High-contrast focus ring on every interactive element in the header
   AND in body content. Uses :focus-visible so mouse clicks don't fire
   the ring (only keyboard focus + programmatic focus). */
.scrapd-navbar a:focus-visible,
.scrapd-navbar button:focus-visible,
.subnav-rail a:focus-visible,
.subnav-rail button:focus-visible,
.mobile-drawer a:focus-visible,
.mobile-drawer button:focus-visible,
main a:focus-visible,
main button:focus-visible,
main input:focus-visible,
main select:focus-visible,
main textarea:focus-visible,
.skip-to-content:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Brand logo — a clearer focus state since it sits on dark olive */
.brand-logo-link:focus-visible {
    outline: 3px solid var(--color-background);
    outline-offset: 3px;
}

/* Subnav chip — active page state (set via aria-current="page" by app.js).
   Solid terra fill — high-contrast with the cream sub-nav background. */
.subnav-chip[aria-current="page"],
.subnav-chip.active {
    background: var(--color-accent);
    color: var(--color-background);
    border-color: var(--color-accent);
    box-shadow: 2px 2px 0 var(--color-text);
}
.subnav-chip[aria-current="page"]:hover,
.subnav-chip.active:hover {
    color: var(--color-background);
    background: #b9461f; /* darker terra on hover */
    border-color: #b9461f;
}

/* Sell-on-SCRAPD CTA — clearer pressed state for kbd & touch */
.sell-btn:active,
.sell-btn:focus-visible {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--color-text);
}
.sell-btn:hover {
    background: #b9461f;
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--color-text);
}

/* Login button + cart icon — consistent hover lift */
.login-btn-style:hover {
    background: var(--color-accent);
    color: var(--color-background);
    border-color: var(--color-accent);
}
.nav-icon-btn:hover {
    background: rgba(255,255,255,0.08);
}
.nav-icon-btn:active {
    transform: scale(0.94);
}

/* Cart count badge — boost contrast against olive nav */
.cart-count-badge {
    background: var(--color-accent);
    color: var(--color-background);
    font-weight: 700;
}

/* Mobile drawer link active state */
.drawer-link[aria-current="page"] {
    color: var(--color-accent);
    border-left: 4px solid var(--color-accent);
    padding-left: 16px;
}

/* Make sure the main landmark is keyboard-focusable from the skip link */
main#app-root:focus {
    outline: none;
}

/* Respect users who set reduced-motion in their OS — kill animation
   on heavy elements, tone down transitions, no scrolling. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* Forced-colors mode (Windows High Contrast) — make sure accent is
   represented by SystemColor borders so the design still parses. */
@media (forced-colors: active) {
    .subnav-chip[aria-current="page"],
    .subnav-chip.active {
        forced-color-adjust: none;
        background: SelectedItem;
        color: SelectedItemText;
        border-color: SelectedItem;
    }
}

/* Hover state for all category tiles + product rail cards (UX consistency) */
.cat-tile:focus-visible,
.product-rail-card:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* =====================================================================
   HEADER COLOR FIX: logo blends into the dark-olive nav bg. Switch the
   nav surface to warm cream so the olive+terra wordmark reads cleanly,
   recolor all nav text/icons to olive, keep terra CTAs popping. Etsy /
   Depop style: light surface, dark text, single bold accent CTA.
   This block is appended LAST so it wins specificity. Override-only —
   no structural changes to markup or other components.
   ===================================================================== */
.scrapd-navbar {
    background: var(--color-background);
    border-bottom: 4px solid var(--color-accent);
    box-shadow: 0 2px 0 rgba(50, 66, 36, 0.06); /* subtle separation from page */
}

/* Search pill — keep cream fill, but bump the border so it doesn't
   disappear into the cream nav surface. */
.global-search-input {
    background: #ffffff;
    border-color: var(--color-text);
}
.global-search-input:focus {
    background: #ffffff;
    border-color: var(--color-accent);
}

/* Log In button: was cream-pill on dark olive. On cream nav, swap to a
   ghost button with olive border + olive text so it reads as a secondary
   action next to the loud terra "SELL ON SCRAPD" CTA. */
.login-btn-style {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    box-shadow: 3px 3px 0 var(--color-primary);
}
.login-btn-style:hover {
    background: var(--color-primary);
    color: var(--color-background);
    border-color: var(--color-primary);
    box-shadow: 4px 4px 0 var(--color-text);
}

/* Cart icon: white-on-dark → olive-on-cream */
.scrapd-navbar .nav-icon-btn {
    color: var(--color-primary);
}
.scrapd-navbar .nav-icon-btn i {
    color: var(--color-primary);
}
.scrapd-navbar .nav-icon-btn:hover i {
    color: var(--color-accent);
}
.scrapd-navbar .nav-icon-btn:hover {
    background: rgba(50, 66, 36, 0.08);
}

/* Hamburger bars: white → dark olive */
.scrapd-navbar .hamburger-bar {
    background: var(--color-primary);
}

/* Hidden mobile profile button label (when shown) */
.scrapd-navbar .nav-btn {
    color: var(--color-primary);
}
.scrapd-navbar .nav-btn.active {
    color: var(--color-accent);
}

/* Brand-logo focus ring: was sized for dark bg → resize for cream */
.brand-logo-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* Sub-nav: previously sat on a cream strip with a dark border on top.
   Now both nav and sub-nav are cream — separate them with a soft hairline
   in muted brown so the rail still feels like its own surface. */
.subnav-rail {
    background: #FAF6EE; /* very subtly warmer than the body */
    border-top: 1px solid rgba(140, 123, 94, 0.25);
    border-bottom: 4px solid var(--color-accent);
}

/* =====================================================================
   Filter-chip active state was using undefined --accent-secondary /
   --accent-tertiary CSS variables, so .chip.active fell back to white
   text on transparent bg = unreadable. Lock it to the brand palette
   with high-contrast cream-on-terra fill.
   ===================================================================== */
.chip.active,
.chip:hover {
    background: var(--color-accent);
    color: #ffffff;
    border: 2px dashed var(--color-text);
    border-radius: 4px;
    box-shadow: 5px 5px 0 var(--color-text);
    transform: translateY(-2px) rotate(-1deg);
}
.chip.active *,
.chip:hover * {
    color: #ffffff;
}

/* =====================================================================
   FULL-BLEED HERO: main has max-width:1200px + 24px side padding so the
   hero was capped + framed in cream margins. Use the "viewport break-out"
   trick so the hero stretches the full viewport width regardless of
   parent constraints. Also kills the top gap so the hero sits flush
   against the bottom of the sub-nav rail.
   ===================================================================== */
.scrapd-hero {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -32px;          /* eat the #app-root padding-top */
    width: 100vw;
    max-width: 100vw;
    padding-left: 24px;
    padding-right: 24px;
}
/* Same break-out treatment for the other full-bleed marketing sections
   the design agent added so they all match instead of half full / half
   constrained. */
.creator-cta-section,
.final-cta {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
}

/* =====================================================================
   FIX: page titles on category / search / shop / product / etc routes
   were hiding under the fixed sub-nav rail. Original body padding-top
   of 132px was too tight once the cream-nav border + sub-nav border
   stack was fully laid out. Bumping desktop to 168px / mobile to 140px
   gives every non-hero view's <h2> clean breathing room.
   ===================================================================== */
body { padding-top: 168px; }

@media (max-width: 767px) {
    body { padding-top: 140px; }
}

/* Homepage hero must compensate so it still bleeds flush against the
   bottom of the sub-nav (no cream gap). */
.scrapd-hero { margin-top: -32px; }

/* Make sure category / sub-page <h2>'s have visible breathing room
   above and below — they were getting clipped right at the nav border. */
#app-root .view-header { padding-top: 8px; }
#app-root .view-header h2 { margin-top: 0; }

/* =====================================================================
   FILTER CHIPS — ensure the active state is high-contrast no matter
   what other rules are doing. !important the color so it always wins
   over any later utility classes from the views.
   ===================================================================== */
.chip.active,
.chip[aria-current="page"] {
    background: var(--color-accent) !important;
    color: #ffffff !important;
    border: 2px dashed var(--color-text) !important;
    box-shadow: 5px 5px 0 var(--color-text);
    transform: translateY(-2px) rotate(-1deg);
}
.chip.active *,
.chip[aria-current="page"] * {
    color: #ffffff !important;
}
.chip.active i,
.chip[aria-current="page"] i {
    color: #ffffff !important;
}
