/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --bg: #f6f7fb;
    --text: #0f172a;
    --muted: #6b7280;
    --brand: #0284c7;
    --brand2: #06b6d4;
    --brandSoft: rgba(2, 132, 199, .14);
    --card: #ffffff;
    --border: rgba(15, 23, 42, .10);
    --shadow: 0 18px 50px rgba(2, 6, 23, .08);
    --radius: 16px;
    --radius-sm: 10px;
    --bottom-nav-h: 64px;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: var(--bottom-nav-h);
}

img { max-width: 100%; height: auto; display: block; }

/* Remove tap highlight on mobile */
a, button { -webkit-tap-highlight-color: transparent; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(1.6rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 2rem); }
h3 { font-size: clamp(1.2rem, 3.5vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2.5vw, 1.25rem); }

/* ===== NAVBAR ===== */
.navbar {
    box-shadow: 0 1px 12px rgba(2,6,23,.06);
}

.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: -.02em;
}

.navbar .nav-link.active {
    font-weight: 800;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background .15s;
}

.navbar .nav-link:hover {
    background: rgba(2,132,199,.06);
}

/* ===== BOTTOM NAV (mobile only) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 1050;
    box-shadow: 0 -8px 24px rgba(2,6,23,.08);
}

.bottom-nav-inner {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    gap: 3px;
    transition: color .15s, background .15s;
    border-top: 2.5px solid transparent;
}

.bottom-nav-item i {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--brand);
    border-top-color: var(--brand);
    background: rgba(2,132,199,.04);
}

.bottom-nav-wa {
    flex: 1.1;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff !important;
    border-top-color: transparent !important;
    border-radius: 0;
}

.bottom-nav-wa:hover {
    filter: brightness(.95);
    color: #fff !important;
    background: linear-gradient(135deg, #15803d, #16a34a);
}

/* ===== BADGE SOFT ===== */
.badge-soft {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .02em;
}

/* ===== BUTTONS ===== */
.btn {
    min-height: 42px;
    font-weight: 600;
    border-radius: 10px;
    transition: filter .15s, box-shadow .15s, transform .1s;
}

.btn:active { transform: scale(.97); }

.btn-lg { min-height: 50px; font-size: 1rem; }
.btn-sm { min-height: 34px; font-size: .8rem; }

.btn-brand {
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    border: 0;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(2, 132, 199, .20);
}

.btn-brand:hover {
    filter: brightness(.96);
    color: #fff;
    box-shadow: 0 12px 28px rgba(2, 132, 199, .28);
}

.btn-brand-outline {
    border: 2px solid rgba(2, 132, 199, .35);
    color: #075985;
    font-weight: 700;
    background: rgba(255, 255, 255, .75);
}

.btn-brand-outline:hover {
    border-color: rgba(2, 132, 199, .55);
    background: rgba(2, 132, 199, .06);
    color: #075985;
}

/* ===== PILLS ===== */
.pill {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
    font-size: 12px;
    color: #0f172a;
    white-space: nowrap;
    border: 1px solid rgba(15, 23, 42, .06);
    font-weight: 600;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
    min-height: 44px;
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,.12) !important;
}

.form-label { font-weight: 600; font-size: .875rem; margin-bottom: 6px; }

/* ===== HERO ===== */
.hero-modern {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.hero-bg {
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(900px 400px at 15% 10%, rgba(2, 132, 199, .20) 0%, transparent 60%),
        radial-gradient(900px 420px at 85% 20%, rgba(6, 182, 212, .18) 0%, transparent 55%),
        radial-gradient(700px 380px at 50% 110%, rgba(34, 197, 94, .10) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
    pointer-events: none;
    filter: saturate(1.15);
}

.hero-title {
    letter-spacing: -0.025em;
    line-height: 1.15;
}

/* Hero stats */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat {
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 8px 20px rgba(2, 6, 23, .05);
    min-width: 140px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
}

.stat:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(2,6,23,.08); }

.stat-num {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--brand);
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

/* Glass card */
.glass-card {
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== FEATURE CARDS ===== */
.feature-card2 {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 8px 24px rgba(2, 6, 23, .05);
    transition: transform .18s ease, box-shadow .18s ease;
    height: 100%;
}

.feature-card2:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(2, 6, 23, .09);
}

.icon-bubble {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--brandSoft);
    color: var(--brand);
    border: 1px solid rgba(2, 132, 199, .15);
    flex-shrink: 0;
}

.icon-bubble i { font-size: 22px; }

/* ===== PRODUCT CARDS ===== */
.card-pro {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(2, 6, 23, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 55px rgba(2, 6, 23, .10);
}

.img-wrap {
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform .3s ease;
}

.card-pro:hover .product-img { transform: scale(1.05); }

.price-tag {
    font-weight: 800;
    background: rgba(2, 132, 199, .08);
    border: 1px solid rgba(2, 132, 199, .16);
    color: #075985;
    padding: 7px 12px;
    border-radius: 12px;
    font-size: .875rem;
}

/* ===== FLOATING WHATSAPP ===== */
.wa-float {
    position: fixed;
    right: 18px;
    bottom: calc(var(--bottom-nav-h) + 14px);
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #22c55e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 14px 36px rgba(34, 197, 94, .30);
    z-index: 1040;
    transition: transform .15s, box-shadow .15s;
}

.wa-float i { font-size: 26px; }

.wa-float:hover {
    transform: scale(1.06);
    color: #fff;
    box-shadow: 0 18px 44px rgba(34, 197, 94, .38);
}

/* ===== CARDS (generic) ===== */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

/* ===== ADMIN STYLES ===== */
.admin-card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 10px 32px rgba(2, 6, 23, .06);
    background: #fff;
}

.admin-kpi {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(2, 6, 23, .05);
    background: linear-gradient(160deg, #fff 60%, rgba(2, 132, 199, .05));
}

/* Admin table scroll on mobile */
.table-responsive {
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-sm) !important;
    border: none !important;
    font-size: .9rem;
}

/* ===== WALLET / ACCOUNT LEDGER ===== */
.ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 8px;
}

/* ===== ORDER ITEM ROW ===== */
.order-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    background: rgba(2,132,199,.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
}

/* ===== SCROLL MARGIN FOR ANCHORS ===== */
[id] { scroll-margin-top: 72px; }

/* ===== SELECTION COLOR ===== */
::selection { background: var(--brandSoft); }

/* ===================================================================
   RESPONSIVE BREAKPOINTS
   =================================================================== */

/* ---- LARGE DESKTOP (≥ 1200px) ---- */
@media (min-width: 1200px) {
    .product-img { height: 200px; }
}

/* ---- TABLET (≤ 991px) ---- */
@media (max-width: 991px) {
    .hero-modern .container { padding-top: 2rem; padding-bottom: 2rem; }
    .stat { min-width: 120px; }
}

/* ---- MOBILE (≤ 767px) ---- */
@media (max-width: 767px) {

    /* Bottom nav — show on mobile */
    .bottom-nav { display: block; }

    /* Reduce body padding on mobile */
    body { padding-bottom: calc(var(--bottom-nav-h) + 8px); }

    /* WhatsApp float — sits above bottom nav */
    .wa-float {
        right: 14px;
        bottom: calc(var(--bottom-nav-h) + 10px);
        width: 48px;
        height: 48px;
    }

    /* Hide desktop WhatsApp button from navbar on mobile */
    .navbar .btn-dark.ms-lg-3 { display: none; }

    /* Navbar tighter */
    .navbar { padding-top: 8px; padding-bottom: 8px; }
    .navbar-brand { font-size: 1rem; }

    /* Container padding */
    .container { padding-left: 14px; padding-right: 14px; }

    /* Hero */
    .hero-modern { padding-top: 0; }
    .hero-title { font-size: clamp(1.5rem, 6.5vw, 2.2rem); }
    .hero-modern .container { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .hero-stats { gap: 8px; }
    .stat { min-width: 0; flex: 1; min-width: calc(33% - 6px); padding: 8px 10px; }
    .stat-num { font-size: .95rem; }

    /* Glass card becomes a full-width card below hero on mobile */
    .glass-card { border-radius: 16px; padding: 18px !important; }

    /* Product cards */
    .product-img { height: 160px; }
    .card-pro { border-radius: 14px !important; }
    .card-body { padding: 14px !important; }

    /* Feature cards */
    .feature-card2 { padding: 16px; }

    /* Buttons */
    .btn { min-height: 46px; font-size: .9rem; }
    .btn-lg { min-height: 52px; font-size: 1rem; }
    .btn-sm { min-height: 36px; font-size: .8rem; }

    /* Forms */
    .form-control, .form-select { min-height: 48px; font-size: 1rem; }

    /* Tables on mobile */
    table { font-size: .8rem; }
    th, td { padding: 8px 6px !important; }

    /* Admin dashboard */
    .admin-kpi .fs-3, .admin-kpi .fs-5 { font-size: 1.2rem !important; }

    /* Nav pills scroll */
    .nav.nav-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px !important; padding-bottom: 4px; }
    .nav.nav-pills .nav-link { white-space: nowrap; font-size: .8rem; padding: 6px 12px; }

    /* h4 admin headings */
    h4.fw-bold { font-size: 1.1rem; }

    /* Margin / padding reductions */
    .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    .p-4 { padding: 14px !important; }
    .p-5 { padding: 20px !important; }

    /* Footer */
    footer .container { flex-direction: column; text-align: center; gap: 6px; }
}

/* ---- VERY SMALL (≤ 400px) ---- */
@media (max-width: 400px) {
    .stat { padding: 7px 8px; }
    .stat-num { font-size: .85rem; }
    .hero-title { font-size: 1.4rem; }
    .bottom-nav-item { font-size: 10px; }
    .bottom-nav-item i { font-size: 18px; }
}

/* ===== PRINT ===== */
@media print {
    .bottom-nav, .wa-float, .navbar { display: none !important; }
    body { padding-bottom: 0; }
}
