/* Omenka storefront + admin styles. Mobile-first, system font stack. */

:root {
    --navy: #1f2a44;
    --navy-700: #18203a;
    --accent: #c8842b;     /* warm brass/amber */
    --accent-700: #a96d20;
    --ink: #222;
    --muted: #6b7280;
    --line: #e6e8ec;
    --bg: #f6f7f9;
    --white: #fff;
    --green: #1f9d55;
    --red: #d64545;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.55;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 18px; }
.section { padding: 40px 18px; }
.section-title { font-size: 1.5rem; margin: 0 0 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.empty { color: var(--muted); padding: 30px 0; }
.hint { color: var(--muted); font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; cursor: pointer;
    background: var(--accent); color: #fff; border: 1px solid var(--accent);
    padding: 10px 18px; border-radius: var(--radius); font-size: .95rem; font-weight: 600;
    text-align: center; transition: background .15s; text-decoration: none;
}
.btn:hover { background: var(--accent-700); border-color: var(--accent-700); text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-block { display: block; width: 100%; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Header ---------- */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { color: #fff; font-size: 1.4rem; font-weight: 700; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 6px; align-items: center; }
.main-nav a { color: #dfe3ea; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-cart { position: relative; }
.cart-badge { background: var(--accent); color: #fff; border-radius: 20px; padding: 1px 7px; font-size: .75rem; font-weight: 700; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; display: block; }

/* ---------- Flash ---------- */
.flash { padding: 12px 0; font-weight: 500; }
.flash .container { padding-left: 18px; padding-right: 18px; }
.flash-success { background: #e8f6ee; color: #176b3a; border-bottom: 1px solid #c6e9d4; }
.flash-error { background: #fdeaea; color: #9b2c2c; border-bottom: 1px solid #f6cccc; }
.admin-content .flash, .admin-main .flash { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--navy), var(--navy-700)); color: #fff; }
.hero-inner { padding: 64px 18px; }
.hero-text { max-width: 620px; }
.hero h1 { color: #fff; font-size: 2.2rem; margin: 0 0 14px; }
.hero p { font-size: 1.1rem; color: #d7dbe4; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Categories ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category-tile {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px 18px; display: flex; flex-direction: column; gap: 4px; transition: transform .12s, box-shadow .12s;
}
.category-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.category-name { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.category-count { color: var(--muted); font-size: .85rem; }

/* ---------- Product grid / cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .12s, transform .12s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-media { display: block; position: relative; aspect-ratio: 1/1; background: var(--bg); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; color: #fff; text-transform: uppercase; letter-spacing: .4px; }
.tag-quote { background: var(--accent); }
.tag-out { background: var(--muted); }
.product-card-body { padding: 14px; }
.product-card-body h3 { font-size: 1rem; margin: 0 0 8px; }
.price { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 0 0 12px; }
.price-quote { color: var(--accent-700); }

/* ---------- Catalogue / filter ---------- */
.catalogue-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.catalogue-head p { color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; background: var(--bg); padding: 14px; border-radius: var(--radius); }
.filter-bar input, .filter-bar select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; background: #fff; }
.filter-bar input[type="search"] { flex: 1; min-width: 180px; }
.filter-bar input[type="number"] { width: 100px; }

/* ---------- Product detail ---------- */
.breadcrumb { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-gallery #gallery-main { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 1/1; object-fit: cover; background: var(--bg); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.eyebrow { text-transform: uppercase; letter-spacing: .8px; color: var(--accent-700); font-size: .8rem; font-weight: 700; margin: 0 0 6px; }
.product-info h1 { font-size: 1.8rem; margin: 0 0 8px; }
.sku { color: var(--muted); font-size: .85rem; margin: 0 0 14px; }
.product-info .price { font-size: 1.6rem; }
.stock { font-weight: 600; margin: 0 0 16px; }
.in-stock { color: var(--green); }
.out-stock { color: var(--red); }
.add-form { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.add-form label { font-size: .85rem; color: var(--muted); }
.add-form input { display: block; width: 80px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.whatsapp-inline { display: inline-block; margin: 6px 0 20px; color: var(--green); font-weight: 600; }
.product-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.product-section h2 { font-size: 1.15rem; }
.spec-list { padding-left: 18px; margin: 0; }
.spec-list li { margin-bottom: 6px; }

/* ---------- Cart ---------- */
.cart-row { display: grid; grid-template-columns: 70px 1fr 90px 110px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-thumb img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.cart-name a { font-weight: 600; }
.cart-name span { display: block; color: var(--muted); font-size: .85rem; }
.cart-qty input { width: 70px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.cart-line-total { text-align: right; font-weight: 700; }
.cart-footer { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; flex-wrap: wrap; gap: 16px; }
.cart-totals { text-align: right; }
.cart-subtotal { font-size: 1.15rem; margin: 0; }
.cart-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Cards / forms ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
label { display: block; font-weight: 500; font-size: .9rem; }
input, select, textarea { font-family: inherit; font-size: .95rem; }
.form-stack input, .form-stack select, .form-stack textarea,
.checkout-form input, .checkout-form select, .checkout-form textarea,
.quote-form input, .quote-form textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 5px; background: #fff;
}
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.form-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.checkout-form h2, .order-summary h2 { margin-top: 0; font-size: 1.2rem; }
.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-total { font-weight: 700; font-size: 1.15rem; border-bottom: 0; }

/* ---------- Receipt ---------- */
.receipt { max-width: 620px; margin: 0 auto; }
.receipt-head { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.receipt-head.success h1 { color: var(--green); }
.receipt-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.receipt-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.receipt-table .num { text-align: right; }
.receipt-total td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.receipt-meta { background: var(--bg); border-radius: 8px; padding: 16px; margin-bottom: 20px; }

/* ---------- Quote / contact ---------- */
.quote-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.quote-intro h1 { font-size: 1.8rem; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 6px 0; }
.quote-form { display: flex; flex-direction: column; gap: 14px; }
.quote-or { margin-top: 18px; }

/* ---------- Bands ---------- */
.band { background: var(--bg); border-top: 1px solid var(--line); }
.band-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 40px 18px; flex-wrap: wrap; }
.band h2 { margin: 0 0 6px; }
.band p { margin: 0; color: var(--muted); max-width: 540px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cdd3df; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 44px 18px; }
.footer-brand { color: #fff; font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.site-footer h4 { color: #fff; margin: 0 0 10px; }
.site-footer a { color: #cdd3df; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 18px; font-size: .85rem; }

/* ---------- WhatsApp FAB ---------- */
.whatsapp-fab {
    position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%;
    background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 60;
}
.whatsapp-fab:hover { background: #1eb858; text-decoration: none; }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 70px 0; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--accent); }

/* ================= ADMIN ================= */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 230px; background: var(--navy); color: #cdd3df; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; }
.admin-brand { color: #fff; font-size: 1.3rem; font-weight: 700; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-brand span { color: var(--accent); font-size: .8rem; }
.admin-sidebar nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; }
.admin-sidebar nav a { color: #cdd3df; padding: 11px 20px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; border-left: 3px solid var(--accent); padding-left: 17px; }
.admin-logout { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.admin-logout button { background: none; border: 1px solid rgba(255,255,255,.3); color: #cdd3df; padding: 8px 14px; border-radius: 8px; cursor: pointer; width: 100%; }
.admin-logout button:hover { background: rgba(255,255,255,.1); }
.admin-main { margin-left: 230px; flex: 1; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 16px 28px; display: flex; align-items: center; gap: 14px; }
.admin-topbar h1 { font-size: 1.3rem; margin: 0; flex: 1; }
.admin-user { color: var(--muted); font-size: .9rem; }
.admin-content { padding: 28px; }
.admin-nav-toggle { display: none; }
.admin-nav-toggle span { background: var(--navy); }

.page-actions { margin-bottom: 18px; }
.admin-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat-card span:last-child { color: var(--muted); font-size: .85rem; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.stat-card.highlight { background: var(--navy); }
.stat-card.highlight .stat-num, .stat-card.highlight span { color: #fff; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.data-table tfoot td { font-weight: 600; }
.data-table .total-row td { font-size: 1.05rem; color: var(--navy); }
.row-actions { display: flex; gap: 12px; align-items: center; }
.row-actions form { display: inline; }
.link, .link-danger { background: none; border: 0; cursor: pointer; font-size: .9rem; padding: 0; font-family: inherit; }
.link { color: var(--navy); }
.link-danger { color: var(--red); }
.link:hover, .link-danger:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--line); color: var(--navy); text-transform: capitalize; }
.badge-pending { background: #fff4d6; color: #8a6d1a; }
.badge-paid { background: #e8f6ee; color: #176b3a; }
.badge-processing { background: #e0ecff; color: #1f4f9e; }
.badge-delivered { background: #d8f0e0; color: #0f5c33; }
.badge-cancelled { background: #fdeaea; color: #9b2c2c; }
.badge-new { background: #fff4d6; color: #8a6d1a; }
.badge-contacted { background: #e0ecff; color: #1f4f9e; }
.badge-closed { background: var(--line); color: var(--muted); }

.filter-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-tabs a { padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: .88rem; }
.filter-tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-tabs a:hover { text-decoration: none; }

.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.contents { display: contents; }
.image-manager { display: flex; flex-wrap: wrap; gap: 10px; }
.image-thumb img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.inline-del { margin: 0; }

/* ---------- Admin auth ---------- */
.admin-auth-body { background: var(--navy); min-height: 100vh; }
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: #fff; border-radius: var(--radius); padding: 30px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.auth-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 5px; }
.auth-brand { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.auth-brand span { color: var(--accent); font-size: .9rem; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .product-detail, .checkout-grid, .quote-layout, .admin-cols { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 10px 18px; gap: 2px; }
    body.nav-open .main-nav { display: flex; }
    .main-nav a { width: 100%; }

    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 1.7rem; }
    .form-row { grid-template-columns: 1fr; }

    /* Admin: collapsible sidebar */
    .admin-sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 70; }
    body.admin-nav-open .admin-sidebar { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-nav-toggle { display: flex; }
}

@media (max-width: 460px) {
    .product-grid, .category-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .cart-row { grid-template-columns: 56px 1fr; grid-auto-rows: auto; }
    .cart-line-total { text-align: left; grid-column: 2; }
}
