:root {
    --navy-950: #122c56;
    --navy-900: #17346a;
    --navy-800: #1f3f7c;
    --navy-700: #2a4f92;
    --navy-600: #3760ab;
    --lime: #a6ff1e;
    --lime-dark: #8be000;
    --lime-soft: rgba(166, 255, 30, 0.14);
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #101828;
    --text-muted: #5c6579;
    --border: #e4e8f0;
    --danger: #e0435b;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(10, 23, 48, 0.06);
    --shadow-hover: 0 8px 24px rgba(10, 23, 48, 0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; }

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--lime);
    color: var(--navy-950);
}
.btn-primary:hover { background: var(--lime-dark); box-shadow: 0 4px 14px rgba(166, 255, 30, 0.35); }
.btn-outline {
    background: transparent;
    border-color: var(--navy-700);
    color: var(--navy-800);
}
.btn-outline:hover { background: var(--navy-800); color: #fff; }
.btn-ghost {
    background: transparent;
    color: inherit;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* Header */
.site-header {
    background: var(--navy-950);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
}
.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.logo img { height: 28px; width: auto; display: block; }

.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
    color: rgba(255,255,255,0.82);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.15s;
}
.main-nav a:hover { color: var(--lime); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.search-form { display: flex; align-items: center; background: rgba(255,255,255,0.08); border-radius: 999px; padding: 6px 6px 6px 16px; }
.search-form input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    width: 180px;
    outline: none;
}
.search-form input::placeholder { color: rgba(255,255,255,0.45); }
.search-form button { background: var(--lime); border: none; color: var(--navy-950); width: 32px; height: 32px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.cart-link { position: relative; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.cart-badge {
    background: var(--lime);
    color: var(--navy-950);
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 100%);
    color: #fff;
    padding: 72px 0;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--lime-soft) 0%, transparent 70%);
}
.hero-inner { position: relative; max-width: 640px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.4em; }
.hero p { color: rgba(255,255,255,0.75); font-size: 1.1rem; margin-bottom: 1.6em; }

/* Section headings */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 1.6rem; }
.section-head a { color: var(--navy-700); font-weight: 700; font-size: 0.9rem; }
.eyebrow { color: var(--lime-dark); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; margin-bottom: 10px; display: block; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.category-card {
    background: var(--navy-900);
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease;
}
.category-card:hover { transform: translateY(-4px); }
.category-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.category-card p { color: rgba(255,255,255,0.6); font-size: 0.88rem; margin-bottom: 0; }
.category-card .arrow { color: var(--lime); font-weight: 800; margin-top: 14px; display: inline-block; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-thumb {
    aspect-ratio: 1 / 1;
    background: #eef1f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .placeholder { color: #b7c0cf; font-size: 2rem; font-weight: 800; }
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--lime);
    color: var(--navy-950);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 10px;
    border-radius: 999px;
}
.badge.sale { background: var(--danger); color: #fff; }
.product-info { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.product-name { font-size: 1rem; font-weight: 700; margin: 0; }
.product-name a { color: var(--text); }
.product-name a:hover { color: var(--navy-700); }
.product-desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.product-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--navy-900); }
.price-compare { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; margin-right: 6px; }
.add-btn {
    width: 40px; height: 40px;
    border-radius: 999px;
    background: var(--navy-950);
    color: var(--lime);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.add-btn:hover { background: var(--lime); color: var(--navy-950); }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumbs a:hover { color: var(--navy-800); }
.breadcrumbs span { margin: 0 6px; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.product-gallery { background: #eef1f6; border-radius: var(--radius); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .placeholder { font-size: 3rem; font-weight: 800; color: #b7c0cf; }
.product-main h1 { font-size: 1.9rem; }
.stock-line { font-weight: 700; font-size: 0.9rem; margin: 14px 0; }
.stock-line.in { color: #1a8a4a; }
.stock-line.out { color: var(--danger); }
.product-price-block { display: flex; align-items: baseline; gap: 10px; margin: 18px 0; }
.product-price-block .price { font-size: 2rem; }
.qty-form { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.qty-input {
    width: 70px; padding: 12px; border-radius: 10px; border: 1.5px solid var(--border);
    font-size: 1rem; text-align: center;
}
.product-description { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; white-space: pre-line; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--border);
    font-size: 0.95rem; font-family: var(--font); background: #fff; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--navy-700); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 18px; height: 18px; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 0.9rem; font-weight: 600; }
.alert-error { background: #fde8ea; color: #b3273f; }
.alert-success { background: var(--lime-soft); color: #3c6b00; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 0 0 12px; border-bottom: 1px solid var(--border); }
.cart-table td { padding: 16px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-product { display: flex; align-items: center; gap: 14px; }
.cart-thumb { width: 64px; height: 64px; border-radius: 8px; background: #eef1f6; overflow: hidden; flex-shrink: 0; display:flex; align-items:center; justify-content:center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-summary { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.95rem; }
.summary-row.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.remove-link { color: var(--danger); font-size: 0.8rem; font-weight: 700; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state h2 { color: var(--text); }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.order-line { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 8px 0; border-bottom: 1px solid var(--border); }

/* Footer */
.site-footer { background: var(--navy-950); color: rgba(255,255,255,0.7); padding: 48px 0 24px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.footer-grid a { display: block; color: rgba(255,255,255,0.6); font-size: 0.9rem; margin-bottom: 10px; }
.footer-grid a:hover { color: var(--lime); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; right: 24px; background: var(--navy-950); color: #fff;
    padding: 14px 22px; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 100; opacity: 0; transform: translateY(12px);
    transition: opacity 0.2s, transform 0.2s; pointer-events: none;
    border-left: 4px solid var(--lime);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Pagination-less search */
.search-form-page { display: flex; gap: 10px; max-width: 480px; margin-bottom: 32px; }
.search-form-page input { flex: 1; }

@media (max-width: 900px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
    .search-form { display: none; }
    .product-detail, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
