﻿/* --------------------------------------------------------------------------
   Crumulus • site.css
   Premium, responsive theme — no markup changes required
   -------------------------------------------------------------------------- */

/* ===== Core theme tokens ================================================== */
:root {
    /* Surfaces & text */
    --bg: #f7faf7;
    --card: #ffffff;
    --border: #e6ece6;
    --txt: #101112;
    --muted: #6b7280;
    --ink: #1f2937;
    /* Brand (logo green + subtle wash) */
    --brand: #27A654; /* logo green */
    --brand-600: #23964C; /* hover (≈5% darker) */
    --brand-700: #1F8845; /* active (≈10% darker) */
    --brand-wash: #E0EFD0;
    /* Effects */
    --focus-ring: 0 0 0 3px rgba(39,166,84,.18);
    --shadow: 0 8px 24px rgba(16,24,16,.08);
    /* Layout */
    --radius: 14px;
    --container: 1120px;
    /* Type scale */
    --fs-1: clamp(28px,5vw,34px);
    --fs-2: clamp(20px,3.4vw,24px);
    --fs-3: 18px;
    --fs-4: 16px;
    --fs-5: 14px;
}

/* ===== Resets & base ====================================================== */
* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

    body.theme {
        margin: 0;
        background: var(--bg);
        color: var(--txt);
        font-family: Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

img {
    max-width: 100%;
    height: auto;
    display: block
}

a {
    color: inherit;
    text-decoration: none
}

    a:hover {
        text-decoration: underline
    }

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 8px
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 16px
}

.muted {
    color: var(--muted)
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0
}

/* ===== Header / Topbar ==================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(6px);
    box-shadow: 0 12px 20px -20px rgba(17,24,39,.25);
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap
}

.brand-logo {
    display: block;
    height: 40px;
    width: auto
}

@media (max-width:900px) {
    .brand-logo {
        height: 28px
    }
}

.mainnav {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center
}

.navlink {
    color: var(--ink);
    padding: 10px 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none
}

    .navlink:hover {
        background: var(--brand-wash);
        border-color: var(--border);
        text-decoration: none
    }

    .navlink.is-active {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand)
    }

.mobile-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer
}

    .mobile-toggle:focus-visible {
        box-shadow: var(--focus-ring)
    }

@media (max-width:900px) {
    .nav {
        height: 56px
    }

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px
    }

    .mainnav {
        position: absolute;
        left: 0;
        right: 0;
        top: 56px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        display: none;
        flex-direction: column;
        padding: 10px 16px 14px;
        gap: 6px;
        z-index: 60
    }

        .mainnav[data-open="true"] {
            display: flex
        }

    .navlink {
        padding: 12px
    }
}

/* ===== Admin sub-bar ====================================================== */
.adminbar {
    background: var(--brand-wash);
    border-bottom: 1px solid var(--border)
}

.adminnav {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 44px
}

    .adminnav a {
        color: var(--ink);
        padding: 6px 10px;
        min-height: 36px;
        border-radius: 10px;
        border: 1px solid transparent;
        font-weight: 600;
        text-decoration: none
    }

        .adminnav a:hover {
            background: #fff;
            border-color: var(--border)
        }

        .adminnav a.is-active {
            background: var(--brand);
            color: #fff;
            border-color: var(--brand)
        }

/* ===== Page area & footer ================================================= */
.content {
    padding: 24px 0 64px
}

.footer {
    background: var(--brand-wash);
    border-top: 1px solid var(--border)
}

.footer-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-height: 72px
}

/* ===== Headings & text ==================================================== */
.section-title {
    margin: 0 0 12px;
    font-size: var(--fs-2);
    font-weight: 800;
    letter-spacing: .3px
}

h1 {
    font-size: var(--fs-1);
    margin: 0 0 10px
}

h2 {
    font-size: var(--fs-2);
    margin: 18px 0 8px
}

h3 {
    font-size: var(--fs-3);
    margin: 16px 0 6px
}

p {
    font-size: var(--fs-4);
    margin: 0 0 12px;
    color: var(--ink)
}

/* ===== Cards & panels ===================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow)
}

.brand-panel {
    background: var(--brand-wash);
    border: 1px solid rgba(39,166,84,.35);
    color: #193116;
    border-radius: 12px;
    padding: 16px
}

/* ===== Grid helpers ======================================================= */
.grid {
    display: grid;
    gap: 14px
}

.cols-2 {
    grid-template-columns: repeat(2,minmax(0,1fr))
}

.cols-3 {
    grid-template-columns: repeat(3,minmax(0,1fr))
}

@media (max-width:900px) {
    .cols-2, .cols-3 {
        grid-template-columns: 1fr
    }
}

/* ===== Lists & rows ======================================================= */
.list {
    list-style: none;
    padding: 0;
    margin: 0
}

    .list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-top: 1px solid var(--border)
    }

        .list li:first-child {
            border-top: 0
        }

/* ===== Buttons ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    font-weight: 700;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .04s ease
}

    .btn:hover {
        background: var(--brand-600);
        border-color: var(--brand-600);
        text-decoration: none
    }

    .btn:active {
        background: var(--brand-700);
        border-color: var(--brand-700);
        transform: translateY(1px)
    }

    .btn:focus-visible {
        box-shadow: var(--focus-ring)
    }

    .btn.alt {
        background: #fff;
        color: var(--ink);
        border-color: var(--border)
    }

        .btn.alt:hover {
            background: var(--brand-wash)
        }

    .btn.lg {
        height: 44px;
        padding: 0 18px;
        border-radius: 14px
    }

/* ===== Forms ============================================================== */
label {
    display: block;
    font-size: var(--fs-5);
    color: var(--muted);
    margin: 0 0 6px
}

input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], select, textarea {
    width: 100%;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    transition: box-shadow .12s ease,border-color .12s ease
}

    input:focus, select:focus, textarea:focus {
        border-color: var(--brand);
        box-shadow: var(--focus-ring)
    }

textarea {
    min-height: 110px;
    resize: vertical
}

.input-validation-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.15) !important
}

.validation-summary-errors, .field-validation-error {
    color: #b91c1c;
    font-weight: 600
}

.kv {
    display: grid;
    gap: 12px
}

.row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2,minmax(0,1fr))
}

@media (max-width:800px) {
    .row {
        grid-template-columns: 1fr
    }
}

/* ===== Table ============================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

    .table thead th {
        background: var(--brand);
        color: #fff;
        font-weight: 700;
        text-align: left;
        padding: 12px 14px
    }

    .table tbody td {
        padding: 12px 14px;
        border-top: 1px solid var(--border)
    }

    .table tr:hover td {
        background: var(--brand-wash)
    }

/* ===== Chips / badges ===================================================== */
.chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px
}

.chip-paid {
    background: rgba(39,166,84,.14);
    color: #167247;
    border: 1px solid rgba(39,166,84,.35)
}

.chip-pending {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa
}

.chip-canceled, .chip-failed {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca
}

/* ===== Sticky summary (e.g., cart/checkout) ============================== */
.sticky-summary {
    position: sticky;
    top: 84px
}

.list-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--border)
}

    .list-row:first-child {
        border-top: 0
    }

.fw-700 {
    font-weight: 700
}

/* ===== Skeleton loader ==================================================== */
.skeleton-row {
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg,#eee 25%,#f8f8f8 37%,#eee 63%);
    background-size: 400% 100%;
    animation: sk 1.2s ease-in-out infinite
}

@keyframes sk {
    0% {
        background-position: 100% 0
    }

    100% {
        background-position: 0 0
    }
}

/* ===== Toast (optional if you add via page) ============================== */
.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: #111;
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: .95;
    z-index: 1000
}

    .toast.hide {
        display: none
    }

/* ===== Utilities ========================================================== */
.text-danger {
    color: #b91c1c
}

.center {
    text-align: center
}

.mt-1 {
    margin-top: 4px
}

.mt-2 {
    margin-top: 8px
}

.mt-3 {
    margin-top: 12px
}

.mt-4 {
    margin-top: 16px
}

.mb-1 {
    margin-bottom: 4px
}

.mb-2 {
    margin-bottom: 8px
}

.mb-3 {
    margin-bottom: 12px
}

.mb-4 {
    margin-bottom: 16px
}

/* ===== Motion & Print ===================================================== */
@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important
    }
}

@media print {
    .topbar, .adminbar, .mobile-toggle, .footer {
        display: none !important
    }

    .container {
        max-width: 100%;
        padding: 0
    }

    body.theme {
        background: #fff;
        color: #000
    }

    a {
        text-decoration: none;
        color: #000
    }
}

body.theme {
    min-height: 100vh; /* fallback */
    min-height: 100svh; /* mobile-safe viewport units */
    display: flex;
    flex-direction: column;
}

/* Let main content expand to fill remaining space */
main {
    flex: 1 0 auto;
}

/* Footer sits at the bottom when content is short */
footer.footer {
    margin-top: auto;
}
/* Disabled-looking button used by the cart guard */
.btn.is-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

    .btn.is-disabled:hover {
        background: #e5e7eb;
        border-color: #e5e7eb;
        text-decoration: none;
    }
/* --- Flash/Error: bold red + rounded, subtle shadow --- */
.alert.error {
    background: #fee2e2; /* red-100 */
    border: 1px solid #fca5a5; /* red-300 */
    color: #7f1d1d; /* red-900 */
    border-radius: 16px; /* nicer rounded corners */
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.08);
}

    .alert.error .alert-title {
        color: #b91c1c; /* red-700 */
        font-weight: 800;
    }

    .alert.error .alert-text {
        color: #7f1d1d; /* red-900 */
    }

/* Optional: make ALL alerts a bit rounder for consistency */
.alert {
    border-radius: 16px;
}