/* =======================================================================
   ZOL — Shop App (slugged)
   Themes itself via CSS custom properties set from the shop API payload.
   ======================================================================= */

:root {
    /* These get overwritten in JS once shop loads */
    --shop-primary:    #143823;
    --shop-secondary:  #1E5234;
    --shop-on-primary: #FBF8EF;
}

.page-shop {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
    overflow-x: hidden;
}

/* Views — show one at a time -------------------------------------------- */
.view {
    width: 100%;
}

/* Critical: hidden views must NEVER render. This wins over .view-center,
   .shop-landing, .shop-form-view etc. that use display: flex */
.view[hidden] {
    display: none !important;
}

.view-center {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
}

.muted        { color: rgba(14, 31, 20, 0.65); }
.muted-small  { color: rgba(14, 31, 20, 0.55); font-size: 13px; }

/* Loading spinner ------------------------------------------------------- */
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(20, 56, 35, 0.15);
    border-top-color: var(--forest);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 16px;
}

/* Blocker / not-found cards -------------------------------------------- */
.blocker-card {
    max-width: 460px;
    text-align: center;
}
.blocker-card h2 {
    font-size: 26px;
    color: var(--forest);
    margin-bottom: 12px;
}
.blocker-card p {
    color: rgba(14, 31, 20, 0.7);
    margin-bottom: 18px;
}
.blocker-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--accent);
}

/* Shop landing (themed) ------------------------------------------------- */
.shop-landing {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, var(--shop-primary) 0%, var(--shop-secondary) 100%);
    color: var(--shop-on-primary);
    display: flex;
    flex-direction: column;
}

.shop-header {
    padding: 20px 24px;
    position: relative;
    z-index: 2;
}
.shop-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--page-max);
    margin: 0 auto;
}

.shop-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.shop-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--shop-on-primary);
}
.shop-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-logo span {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: currentColor;
}
.shop-logo-sm {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}
.shop-logo-sm span { font-size: 16px; }

.shop-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.shop-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: currentColor;
    letter-spacing: -0.01em;
}
.shop-tag {
    font-size: 11px;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Hero on landing ------------------------------------------------------- */
.shop-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
}
.shop-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.shop-hero-inner {
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}
.shop-hero h1 {
    font-size: clamp(38px, 7vw, 56px);
    line-height: 1.05;
    color: var(--shop-on-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.shop-hero-sub {
    color: rgba(255, 255, 255, 0.8);
    font-size: 17px;
    margin-bottom: 36px;
    line-height: 1.55;
}
.shop-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}
.shop-actions .btn {
    width: 100%;
}
/* Override primary button on dark themed background */
.shop-hero .btn-primary {
    background: var(--shop-on-primary);
    color: var(--shop-primary);
    border-color: var(--shop-on-primary);
}
.shop-hero .btn-primary:hover {
    background: rgba(255, 255, 255, 0.92);
}
.shop-hero .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--shop-on-primary);
    border-color: rgba(255, 255, 255, 0.25);
}
.shop-hero .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
}

.shop-staff-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}
.shop-staff-note a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.shop-staff-note a:hover {
    color: var(--shop-on-primary);
}

/* Form views (login, register) ----------------------------------------- */
.shop-form-view {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--paper);
}
.shop-form-card {
    background: #ffffff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lift);
    position: relative;
}
.btn-back {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--forest);
    cursor: pointer;
    transition: background-color 120ms ease;
}
.btn-back:hover {
    background: rgba(14, 31, 20, 0.05);
}

.shop-form-head {
    text-align: center;
    margin-bottom: 28px;
}
.shop-form-head .shop-logo {
    margin: 0 auto 14px;
    background: var(--shop-primary);
    color: var(--shop-on-primary);
    border-color: transparent;
}
.shop-form-head h2 {
    font-size: 26px;
    color: var(--forest);
    margin-bottom: 6px;
}

.form-bare .field { margin-bottom: 16px; }
.form-bare .alert { margin-bottom: 16px; }

.form-foot {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(14, 31, 20, 0.65);
}
.form-foot a {
    color: var(--shop-primary);
    font-weight: 500;
}

/* Home (post-login) ----------------------------------------------------- */
.shop-home {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
}
.shop-home .shop-header {
    background: var(--shop-primary);
    color: var(--shop-on-primary);
    padding: 16px 24px;
}
.shop-home .shop-header .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--shop-on-primary);
    border-color: rgba(255, 255, 255, 0.2);
}
.shop-home .shop-header .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.home-content {
    padding: 32px 24px 48px;
}
.home-card {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}
.home-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}
.home-greeting {
    font-size: clamp(28px, 4vw, 36px);
    color: var(--forest);
    margin-bottom: 12px;
    line-height: 1.1;
}
.home-message {
    color: rgba(14, 31, 20, 0.7);
    margin-bottom: 24px;
}
.home-meta {
    background: var(--paper);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.home-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--paper-3);
}
.home-meta-row:last-child {
    border-bottom: none;
}
.home-meta-label {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.55);
}
.home-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}
.home-meta-value.mono {
    font-family: 'Menlo', 'Monaco', monospace;
}
.home-coming-soon {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.5);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* Mobile tweaks --------------------------------------------------------- */
@media (max-width: 600px) {
    .shop-form-card {
        padding: 28px 20px;
    }
    .home-card {
        padding: 24px 20px;
    }
}
