/* ============================================================
   Loopcast Crafts — brand theme
   Palette:  ink #2C2C2A  ·  raspberry #D4537E  ·  paper #FAF7F2
   Wordmark/headings: Fredoka. Body: Nunito Sans.
   ============================================================ */

:root {
    --ink: #2C2C2A;
    --ink-soft: #55524d;
    --raspberry: #D4537E;
    --raspberry-dark: #b83c66;
    --raspberry-tint: #fbe9f0;
    --paper: #FAF7F2;
    --paper-2: #f3ede3;
    --card: #ffffff;
    --line: #e7e0d5;
    --shadow: 0 6px 24px rgba(44, 44, 42, 0.08);
    --shadow-sm: 0 2px 8px rgba(44, 44, 42, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --heading: "Fredoka", "Quicksand", "Poppins", sans-serif;
    --body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, .font-brand {
    font-family: var(--heading);
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.2px;
}

a { color: var(--raspberry-dark); text-decoration: none; }
a:hover { color: var(--raspberry); text-decoration: underline; }

main { flex: 1 0 auto; }

.container { max-width: 1160px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--heading); font-weight: 500; border-radius: 999px; padding: .55rem 1.4rem; letter-spacing: .3px; }
.btn-brand { background: var(--raspberry); border: none; color: #fff; }
.btn-brand:hover { background: var(--raspberry-dark); color: #fff; }
.btn-outline-brand { border: 2px solid var(--raspberry); color: var(--raspberry-dark); background: transparent; }
.btn-outline-brand:hover { background: var(--raspberry); color: #fff; }
.btn-ink { background: var(--ink); border: none; color: #fff; }
.btn-ink:hover { background: #000; color: #fff; }
.btn-soft { background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); }
.btn-soft:hover { background: #ece4d6; color: var(--ink); }

/* ---------- Header / nav ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1030;
    backdrop-filter: saturate(1.1) blur(2px);
}
.site-header .navbar-brand img { height: 46px; width: auto; display: block; }
.nav-link.brand-link {
    font-family: var(--heading); font-weight: 500; color: var(--ink) !important;
    padding: .4rem .9rem; border-radius: 999px;
}
.nav-link.brand-link:hover, .nav-link.brand-link.active { color: var(--raspberry-dark) !important; background: var(--raspberry-tint); }

.cart-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--ink); color: #fff; border-radius: 999px;
    padding: .4rem .9rem; font-family: var(--heading); font-weight: 500;
}
.cart-pill:hover { background: #000; color: #fff; text-decoration: none; }
.cart-count {
    background: var(--raspberry); color: #fff; border-radius: 999px;
    min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem; padding: 0 .35rem;
}

.dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.dropdown-item.active, .dropdown-item:active { background: var(--raspberry); }

/* ---------- Hero ---------- */
.hero {
    background: radial-gradient(1200px 500px at 15% -10%, var(--raspberry-tint), transparent 60%),
                linear-gradient(180deg, var(--paper), var(--paper-2));
    border-bottom: 1px solid var(--line);
    padding: 4.5rem 0 4rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
.hero .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34rem; }
.hero-badge { height: 200px; width: auto; filter: drop-shadow(var(--shadow)); }
.eyebrow {
    font-family: var(--heading); text-transform: uppercase; letter-spacing: 3px;
    font-size: .78rem; color: var(--raspberry-dark);
}

/* ---------- Category cards ---------- */
.cat-card {
    display: block; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.8rem; height: 100%;
    box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
    color: inherit;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.cat-card h3 { color: var(--raspberry-dark); margin-bottom: .3rem; }
.cat-card p { color: var(--ink-soft); margin: 0; }
.cat-card .arrow { color: var(--raspberry); font-family: var(--heading); margin-top: 1rem; display: inline-block; }

/* ---------- Product grid & cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
    display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-thumb {
    aspect-ratio: 4 / 3; background: var(--paper-2); display: flex; align-items: center; justify-content: center;
    overflow: hidden; border-bottom: 1px solid var(--line);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .placeholder-mark { width: 46%; opacity: .55; }
.product-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.product-body h3 a { color: var(--ink); }
.product-body h3 a:hover { color: var(--raspberry-dark); text-decoration: none; }
.product-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--raspberry-dark); font-family: var(--heading); }
.product-desc { color: var(--ink-soft); font-size: .92rem; margin: .4rem 0 .9rem; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.price { font-family: var(--heading); font-weight: 500; font-size: 1.15rem; color: var(--ink); }

.tag {
    display: inline-block; font-size: .7rem; letter-spacing: .5px; font-family: var(--heading);
    padding: .15rem .6rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.tag.made { background: var(--raspberry-tint); color: var(--raspberry-dark); border-color: transparent; }
.tag.out { background: #efe7e7; color: #9a6a6a; }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { font-size: 2rem; }
.section-title p { color: var(--ink-soft); }

/* ---------- Product detail ---------- */
.detail-media {
    background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .placeholder-mark { width: 45%; opacity: .5; }

/* ---------- Cards / panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; }

/* ---------- Tables ---------- */
.table-brand thead th { font-family: var(--heading); font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid var(--line); }
.table-brand td { vertical-align: middle; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: var(--radius-sm); border: 1px solid var(--line); padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--raspberry); box-shadow: 0 0 0 .2rem rgba(212, 83, 126, .15); }
label, .form-label { font-weight: 600; color: var(--ink); }

/* ---------- Badges for order status ---------- */
.status { font-family: var(--heading); font-size: .78rem; padding: .2rem .7rem; border-radius: 999px; }
.status-pending { background: #fff3d6; color: #8a6d1f; }
.status-paid { background: #dff3e6; color: #1f6d43; }
.status-ready { background: var(--raspberry-tint); color: var(--raspberry-dark); }
.status-shipped { background: #e1edf8; color: #25527f; }
.status-completed { background: #e4e9f2; color: #3a4b66; }
.status-cancelled { background: #efe0e0; color: #8a3838; }

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0; background: var(--ink); color: #d9d5cd; margin-top: 3rem; padding: 2.5rem 0 1.5rem;
}
.site-footer a { color: #fff; }
.site-footer .footer-brand { height: 40px; filter: brightness(0) invert(1); opacity: .95; }
.site-footer .muted { color: #a7a29a; font-size: .88rem; }

/* ---------- Auth pages tidy-up ---------- */
.auth-wrap { max-width: 460px; margin: 2rem auto; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
.admin-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; height: fit-content; }
.admin-nav a { display: block; padding: .55rem .8rem; border-radius: var(--radius-sm); color: var(--ink); font-family: var(--heading); }
.admin-nav a:hover, .admin-nav a.active { background: var(--raspberry-tint); color: var(--raspberry-dark); text-decoration: none; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.stat-card .num { font-family: var(--heading); font-size: 2rem; color: var(--raspberry-dark); }
.stat-card .lbl { color: var(--ink-soft); font-size: .9rem; }

@media (max-width: 800px) {
    .admin-shell { grid-template-columns: 1fr; }
    .hero { padding: 3rem 0; text-align: center; }
    .hero-badge { height: 150px; margin-top: 1.5rem; }
}

/* ---------- PHP-version additions ---------- */
.search-form { min-width: 190px; }
.search-form .form-control { border-radius: 999px; }
.alert.flash { border-radius: var(--radius-sm); border: none; }
.alert-success.flash { background: var(--raspberry-tint); color: var(--raspberry-dark); }
.alert-info.flash { background: var(--paper-2); color: var(--ink); }
.alert-danger.flash { background: #f6e1e1; color: #8a3838; }
.admin-nav hr { margin: .6rem 0; }
@media (max-width: 991px) { .search-form { width: 100%; } }

/* ---------- Maintenance banner ---------- */
.maintenance-banner { background: #fff3d6; color: #6b531a; border-bottom: 1px solid #f0dca8; padding: .65rem 0; text-align: center; font-weight: 600; font-size: .95rem; }
