/* ============================================================================
   JVL Distribution - main stylesheet
   ============================================================================ */

:root {
    --c-primary: #1f4e79;
    --c-primary-dark: #15406b;
    --c-accent: #e8a33d;
    --c-bg: #f6f7f9;
    --c-surface: #ffffff;
    --c-text: #1f2933;
    --c-muted: #6b7280;
    --c-border: #e2e5ea;
    --c-success: #2e8b57;
    --c-error: #c0392b;
    --c-warning: #d68910;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 6px 20px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.5;
    font-size: 14px;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-fluid { max-width: 100%; padding: 0 16px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; }
.alert.success { background: #e6f6ec; color: var(--c-success); border:1px solid #c5e7d1; }
.alert.error { background: #fbe9e7; color: var(--c-error); border:1px solid #f3c9c4; }
.alert.info { background: #e8f1fb; color: var(--c-primary); border:1px solid #c9def0; }

/* Buttons */
.btn {
    display: inline-block; padding: 8px 14px; border: none; border-radius: var(--radius);
    background: var(--c-primary); color: #fff; cursor: pointer; font-size: 14px;
    text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--c-primary-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--c-primary); border:1px solid var(--c-border); }
.btn.secondary:hover { background: #f0f3f8; }
.btn.danger { background: var(--c-error); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.block { display: block; width: 100%; }

/* Forms */
label { display:block; margin: 10px 0 4px; font-weight: 600; font-size:13px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
    width: 100%; padding: 8px 10px; border:1px solid var(--c-border); border-radius: var(--radius);
    font-size: 14px; background: #fff;
}
textarea { min-height: 80px; }
.field-error { color: var(--c-error); font-size: 12px; margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Topbar (customer) */
.topbar { background: var(--c-primary); color: #fff; box-shadow: var(--shadow); }
.topbar a { color: #fff; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.topbar .brand { font-weight: 700; font-size: 16px; color:#fff; }
.topnav a { margin-left: 16px; font-size: 14px; }
.topnav a:hover { color: #ffd; text-decoration: none; }

.main-content { padding: 20px 16px 60px; min-height: 70vh; }

.footer { background: #1f2933; color: #cbd2d9; padding: 16px 0; text-align: center; }
.footer a { color: #cbd2d9; }

/* Hero / banners */
.hero { border-radius: 12px; overflow: hidden; margin: 16px 0; box-shadow: var(--shadow-lg); position: relative; }
.hero img { width: 100%; display: block; max-height: 320px; object-fit: cover; }

/* Section heading */
.section { margin: 32px 0; }
.section h2 { font-size: 20px; color: var(--c-text); margin: 0 0 16px; font-weight: 700; }
.section-head { display:flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--c-primary); }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--c-text); }
.section-head a { font-size: 13px; font-weight: 600; }

/* Page header */
.page-header { display:flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--c-text); }

/* Product grid */
.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.product-card {
    background: var(--c-surface); border:1px solid var(--c-border); border-radius: 10px;
    padding: 0; box-shadow: var(--shadow); display: flex; flex-direction: column;
    overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--c-primary); }
.product-card .card-img { position: relative; overflow: hidden; background: #f0f3f8; aspect-ratio: 1; }
.product-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .card-img img { transform: scale(1.05); }
.product-card .card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { font-size: 14px; margin: 0 0 4px; font-weight: 600; line-height: 1.3; }
.product-card h3 a { color: var(--c-text); }
.product-card h3 a:hover { color: var(--c-primary); }
.product-card .sku { color: var(--c-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.product-card .price { font-weight: 700; color: var(--c-primary); margin-top: 6px; font-size: 18px; }
.product-card .price-strike { color: var(--c-muted); text-decoration: line-through; margin-right:6px; font-weight: 400; font-size: 14px; }
.product-card .price-incl { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.product-card .stock-in { color: var(--c-success); font-size: 12px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.product-card .stock-in::before { content: '\25CF'; font-size: 14px; }
.product-card .stock-out { color: var(--c-error); font-size: 12px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.product-card .stock-out::before { content: '\25CF'; font-size: 14px; }
.product-card .stock-coming { color: var(--c-warning); font-size: 12px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.product-card .stock-coming::before { content: '\25CF'; font-size: 14px; }
.product-card .special-badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    background: linear-gradient(135deg, #e8a33d, #d68910); color:#fff; font-size:11px; font-weight: 700;
    padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(232,163,61,0.4);
}
.product-card .new-badge {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: var(--c-success); color:#fff; font-size:10px; font-weight: 700;
    padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em;
}
.product-card .card-actions { margin-top: auto; padding-top: 12px; }
.product-card .btn-add {
    width: 100%; padding: 9px; border: none; border-radius: 6px;
    background: var(--c-primary); color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.product-card .btn-add:hover { background: var(--c-primary-dark); }
.product-card .btn-add:disabled { background: #b0b8c0; cursor: not-allowed; }
.product-card .btn-add::before { content: '+ '; font-weight: 700; }
.product-card .btn-signin {
    width: 100%; padding: 9px; border: 1px solid var(--c-border); border-radius: 6px;
    background: #fff; color: var(--c-primary); font-size: 13px; font-weight: 600;
    text-align: center; text-decoration: none; display: block; transition: background .15s;
}
.product-card .btn-signin:hover { background: #f0f3f8; text-decoration: none; }

/* Shop filters */
.shop-filters {
    background: #fff; border: 1px solid var(--c-border); border-radius: 10px;
    padding: 16px 20px; margin-bottom: 24px; box-shadow: var(--shadow);
    display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
}
.shop-filters .filter-group { display: flex; flex-direction: column; gap: 4px; }
.shop-filters label { font-size: 11px; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.shop-filters input[type=text] { min-width: 200px; }
.shop-filters .filter-checks { display: flex; gap: 16px; align-items: center; }
.shop-filters .filter-checks label { display: flex; align-items: center; gap: 4px; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--c-text); cursor: pointer; }
.shop-filters .filter-actions { margin-left: auto; display: flex; gap: 8px; align-items: flex-end; }

/* Shop header banner */
.shop-banner {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: #fff; padding: 28px 32px; border-radius: 12px; margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}
.shop-banner h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; }
.shop-banner p { margin: 0; opacity: 0.85; font-size: 14px; }
.shop-banner .results-count { font-size: 13px; opacity: 0.7; margin-top: 8px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--c-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { color: var(--c-text); margin: 0 0 8px; }
.empty-state p { margin: 0; }

/* Product detail page */
.product-detail-info { padding: 20px; }
.sku-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sku-tag { background: #f0f3f8; color: var(--c-muted); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.new-badge-static { background: var(--c-success); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; }
.price-detail { font-size: 28px; font-weight: 800; color: var(--c-primary); margin: 8px 0 2px; }
.price-special { color: var(--c-accent); }
.price-label { font-size: 13px; font-weight: 500; color: var(--c-muted); }
.price-strike-detail { color: var(--c-muted); text-decoration: line-through; font-size: 16px; }
.price-incl-detail { font-size: 14px; color: var(--c-muted); }
.save-badge { display: inline-block; background: #e6f6ec; color: var(--c-success); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-top: 6px; }
.stock-detail { font-weight: 600; font-size: 14px; padding: 8px 0; }
.stock-detail.stock-in { color: var(--c-success); }
.stock-detail.stock-out { color: var(--c-error); }
.stock-detail.stock-coming { color: var(--c-warning); }

/* Specials page */
.specials-banner {
    background: linear-gradient(135deg, #e8a33d 0%, #d68910 100%);
    color: #fff; padding: 28px 32px; border-radius: 12px; margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}
.specials-banner h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; }
.specials-banner p { margin: 0; opacity: 0.9; font-size: 14px; }

/* Home welcome */
.home-welcome { padding: 24px 0 8px; }
.home-welcome h1 { font-size: 28px; font-weight: 700; color: var(--c-text); margin: 0 0 6px; }
.home-welcome p { font-size: 15px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); overflow:hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom:1px solid var(--c-border); font-size: 13px; }
table.data th { background: #f0f3f8; font-weight: 600; color: var(--c-primary); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfc; }

/* Badges */
.badge { display:inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.draft { background:#e2e5ea; color:#444; }
.badge.published { background:#e6f6ec; color: var(--c-success); }
.badge.hidden { background:#fbe9e7; color: var(--c-error); }
.badge.archived { background:#f0e6d6; color: #8a6d3b; }
.badge.discontinued { background:#ddd; color:#555; }
.badge.pending { background:#fdf3d1; color:#8a6d3b; }
.badge.approved { background:#e6f6ec; color: var(--c-success); }
.badge.rejected { background:#fbe9e7; color: var(--c-error); }
.badge.submitted { background:#e8f1fb; color: var(--c-primary); }
.badge.approved { background:#e6f6ec; color: var(--c-success); }
.badge.picking, .badge.packed { background:#fdf3d1; color:#8a6d3b; }
.badge.dispatched { background:#e8f1fb; color: var(--c-primary); }
.badge.delivered { background:#e6f6ec; color: var(--c-success); }
.badge.on_hold { background:#fbe9e7; color: var(--c-error); }
.badge.cancelled { background:#fbe9e7; color: var(--c-error); }

/* Auth layout */
.layout-auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--c-primary) 0%, #15406b 100%);
}
.auth-card {
    background:#fff; padding: 28px 32px; border-radius: 8px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.auth-card .brand { display:block; text-align:center; font-weight: 700; font-size: 18px; color: var(--c-primary); margin-bottom: 16px; }
.auth-card .alt-link { text-align:center; margin-top: 14px; font-size: 13px; }

/* Cards */
.card { background:#fff; border:1px solid var(--c-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 16px; color: var(--c-primary); }
.card.flush { padding: 0; overflow: hidden; }

.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.grid-4 { display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; }
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: 1fr; }
}

/* KPI tiles */
.kpi { background:#fff; padding: 16px; border-radius: var(--radius); border:1px solid var(--c-border); }
.kpi .label { color: var(--c-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--c-primary); }

/* Pagination */
.pagination { margin: 16px 0; text-align: center; }
.pagination a, .pagination span { padding: 4px 10px; border:1px solid var(--c-border); border-radius: 4px; margin: 0 2px; }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* Misc */
.muted { color: var(--c-muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.spacer { height: 16px; }
.flex-between { display:flex; justify-content: space-between; align-items: center; }
