/* CampMarket storefront — cream, navy, campus green, logo accents */
:root {
    --cream: #FAFAF5;
    --navy: #1E1B4B;
    --text-secondary: #6B7280;
    --orange: #EA580C;
    --logo-blue: #2EC4FF;
    --logo-gold: #F5C400;
    --logo-red: #E31C23;
    --radius-card: 16px;
    --radius-button: 12px;
    --store: #16A34A;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; width: 100%; }

body.storefront {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--navy);
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

body.storefront > main {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.sf-stripe {
    height: 3px;
    background: linear-gradient(90deg, var(--logo-blue), var(--logo-gold), var(--logo-red));
    opacity: 0.18;
}

.sf-header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: rgba(250, 250, 245, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.7rem 0;
    min-height: 60px;
}

.sf-brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.sf-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--store);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}
.sf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sf-brand strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}
.sf-brand small { display: block; color: var(--text-secondary); font-size: 0.72rem; font-weight: 500; }

.sf-nav { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.sf-nav a, .sf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 650;
    min-height: 40px;
}
.sf-btn-primary { background: var(--store); color: #fff; border: none; cursor: pointer; }
.sf-btn-outline { border: 1px solid rgba(0, 0, 0, 0.08); background: #fff; color: var(--navy); }

.sf-banner {
    width: 100%;
    min-height: 180px;
    aspect-ratio: 16 / 9;
    max-height: 240px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: linear-gradient(135deg, var(--store), color-mix(in srgb, var(--store) 65%, #111));
    background-size: cover;
    background-position: center;
    position: relative;
}
.sf-banner.has-image { min-height: 190px; }
.sf-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.12));
}
.sf-banner-copy { position: relative; z-index: 1; padding: 1.6rem 0 1.85rem; }
.sf-banner h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.6px; }
.sf-banner p { margin-top: 0.4rem; opacity: 0.94; max-width: 560px; font-size: 0.95rem; }
.sf-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.store-wrap { padding: 1.5rem 0 4.5rem; flex: 1; }
.store-card {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.store-muted { color: var(--text-secondary); font-size: 0.875rem; }
.store-price { font-weight: 800; color: var(--orange); }
.store-lead { margin-bottom: 1.15rem; max-width: 62ch; }

.store-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.store-toolbar h2 { font-size: 1.2rem; font-weight: 800; }
.store-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    width: 100%;
    min-width: 0;
}
.store-search input {
    border: 0;
    background: transparent;
    width: 100%;
    font: inherit;
    outline: none;
    min-height: 36px;
}

.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
}
.filters::-webkit-scrollbar { display: none; }
.filters a {
    white-space: nowrap;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.85rem;
    font-weight: 650;
    background: #fff;
    color: var(--text-secondary);
}
.filters a.active { background: var(--store); color: #fff; border-color: var(--store); }

.store-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}
.product-card {
    background: #fff;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 27, 75, 0.08); }
.product-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--store) 12%, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--store);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.sf-tags { position: absolute; top: 0.5rem; left: 0.5rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.sf-tag { font-size: 0.66rem; font-weight: 800; padding: 0.16rem 0.45rem; border-radius: 6px; background: rgba(255, 255, 255, 0.95); color: var(--navy); }
.sf-tag.sale { background: #E31C23; color: #fff; }
.sf-tag.best { background: #fff; color: #0F172A; border: 1px solid rgba(0, 0, 0, 0.08); }
.store-price s { font-size: 0.78em; font-weight: 500; color: var(--text-secondary); margin-left: 0.3rem; }
.product-body { padding: 0.85rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.product-body h3 { font-size: 0.92rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 480px) {
    .product-body { padding: 0.65rem 0.7rem 0.8rem; }
    .product-meta { flex-direction: column; align-items: flex-start; }
    .product-actions .btn { padding: 0.55rem 0.6rem; font-size: 0.8rem; min-height: 40px; }
}
.product-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.product-chip {
    font-size: 0.68rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--store) 12%, #fff);
    color: var(--store);
    font-weight: 700;
    white-space: nowrap;
}
.product-actions { margin-top: auto; display: flex; flex-direction: column; gap: 0.4rem; }

.btn, button.sf-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.05rem;
    border-radius: var(--radius-button);
    font-weight: 750;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    min-height: 44px;
}
.btn-primary { background: var(--store); color: #fff; }
.btn-outline { border: 1px solid rgba(0, 0, 0, 0.08); background: #fff; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--store); font-weight: 700; min-height: 0; padding: 0.2rem 0; }

.errorlist { color: #DC2626; font-size: 0.8rem; list-style: none; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--cream);
    font: inherit;
}
.store-alert.info { background: #DCFCE7; color: #15803D; padding: 0.85rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.store-alert.warn { background: #FEF3C7; color: #92400E; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.88rem; }

.sf-footer {
    width: 100%;
    background: var(--navy);
    color: rgba(255, 255, 255, 0.7);
    padding: 1.4rem 0 calc(1.1rem + env(safe-area-inset-bottom));
    margin-top: auto;
    flex-shrink: 0;
}
.sf-footer a { color: #86EFAC; }
.sf-footer-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}
.sf-footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.85rem; }
.sf-footer-links a { color: rgba(255, 255, 255, 0.75); overflow-wrap: anywhere; }
.sf-footer-links a:hover { color: #86EFAC; }
.sf-footer-bottom {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Gallery catalog */
.theme-gallery .sf-banner { min-height: 220px; max-height: 300px; }
.gallery-intro {
    background: #fff;
    border-radius: 20px;
    padding: 1.25rem 1.3rem;
    box-shadow: 0 10px 30px rgba(30, 27, 75, 0.06);
    margin-top: -2.1rem;
    position: relative;
    z-index: 2;
}
.gallery-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.gallery-item {
    display: grid;
    grid-template-columns: minmax(140px, 240px) 1fr;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 24px rgba(30, 27, 75, 0.05);
}
.gallery-photo {
    min-height: 180px;
    background: color-mix(in srgb, var(--store) 12%, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--store);
}
.gallery-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 180px; }
.gallery-copy { padding: 1.05rem 1.15rem; display: flex; flex-direction: column; }
.gallery-copy h3 { font-size: 1.1rem; font-weight: 800; margin: 0.2rem 0 0.35rem; }

/* Product detail */
.item-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.5rem;
    align-items: start;
}
.item-photo {
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--store);
}
.item-photo img { width: 100%; height: 100%; object-fit: cover; max-height: 560px; }
.item-panel { background: #fff; border-radius: 20px; padding: 1.4rem 1.45rem; border: 1px solid rgba(0, 0, 0, 0.04); }
.item-panel h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin: 0.35rem 0 0.7rem; }
.item-panel .store-price { font-size: 1.45rem; }
.item-desc { margin: 1rem 0 1.25rem; color: var(--text-secondary); }

.sf-mobile-cta {
    display: none;
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 0.65rem max(1rem, env(safe-area-inset-left)) calc(0.65rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
    background: rgba(250, 250, 245, 0.96);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.empty-state { text-align: center; padding: 3rem 1rem; grid-column: 1 / -1; }

@media (max-width: 800px) {
    .item-layout { grid-template-columns: 1fr; }
    .gallery-item { grid-template-columns: 1fr; }
    .gallery-copy { padding: 0.9rem 1rem 1.1rem; }
    .sf-mobile-cta { display: block; }
    .sf-nav .sf-hide-mobile { display: none; }
    .sf-brand small { display: none; }
    .store-lead { overflow-wrap: anywhere; }
}

@media (min-width: 640px) {
    .product-photo { aspect-ratio: 1 / 1; }
    .store-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
    .store-search { width: auto; min-width: 220px; max-width: 320px; }
    .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sf-footer-inner { flex-direction: row; align-items: flex-end; }
    .sf-banner {
        aspect-ratio: 1920 / 600;
        min-height: 240px;
        max-height: 360px;
    }
    .sf-banner.has-image { min-height: 260px; }
}

@media (min-width: 960px) {
    .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sf-banner { min-height: 280px; max-height: 420px; }
    .sf-banner.has-image { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
    .product-card:hover { transform: none; }
}
