/* Global Styles */
:root {
    /* Colors */
    --navy: #0b2236;
    --navy-dark: #06202f;
    --teal: #13c4a8;
    --teal-dark: #0e9f8a;
    --mint: #e9f7f8;
    --ink: #0f1f2e;
    --muted: #5d6b78;
    --line: #e4eaef;
    --bg: #ffffff;
    --green: #0fa968;
    --blue: #1f5fe0;

    /* Spacing and shape */
    --radius: 14px;
    --page-pad: clamp(16px, 5.3vw, 82px);
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 40px;

    /* Safe areas for phones with notches */
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1a29;
        --ink: #eaf2f7;
        --muted: #9fb0bd;
        --line: #1c3347;
        --mint: #0d2a3a;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    background: var(--bg);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.container {
    padding-inline: var(--page-pad);
    max-width: 1700px;
    margin-inline: auto;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 40px;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--teal-dark);
}

.btn-secondary {
    height: 46px;
    padding: 0 22px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: var(--mint);
}

/* Top Bar */
.top-bar {
    background: var(--navy);
    color: #e6eef5;
    font-size: 12.5px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    gap: 16px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.divider {
    width: 1px;
    height: 14px;
    background: #ffffff40;
}

/* Header Styles */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

header .container {
    display: flex;
    align-items: center;
    height: 76px;
    gap: 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    mix-blend-mode: multiply;
    border-radius: 50%;
}

.logo-name {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #0b2a44;
}

.logo-tagline {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.42em;
    color: var(--teal-dark);
}

nav {
    margin-left: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
    font-size: 13.5px;
    font-weight: 600;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 76px;
    position: relative;
}

.nav-links a.active {
    color: var(--teal-dark);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    height: 2.5px;
    background: var(--teal);
    border-radius: 2px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 320px;
    height: 42px;
    padding: 0 18px;
    background: #eef2f5;
    color: var(--muted);
    border-radius: 999px;
}

.search-box input {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    color: var(--ink);
}

.search-box input:focus-visible {
    outline: 0;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px var(--teal);
}

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

.header-actions .icon {
    width: 24px;
    height: 24px;
}

.cart-icon {
    position: relative;
    display: flex;
}

.cart-count {
    position: absolute;
    top: -9px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    background: var(--teal);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 357px;
    background: var(--navy-dark);
    color: #fff;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    right: 0;
    top: 0;
    width: 68%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38%);
    mask-image: linear-gradient(90deg, transparent 0, #000 38%);
}

.hero .container {
    position: relative;
    padding-block: 30px 28px;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5em;
}

.hero-eyebrow::after {
    content: "";
    width: 66px;
    height: 1.5px;
    background: var(--teal);
}

.hero h1 {
    font-size: clamp(34px, 3.7vw, 52px);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.hero h1 .highlight {
    display: block;
    color: #17d9b6;
}

.hero p {
    max-width: 440px;
    margin: 18px 0 22px;
    font-size: 15.5px;
    line-height: 1.4;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 26px;
}

.trust-badges {
    display: flex;
    gap: 20px;
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.25;
}

.trust-badges .icon {
    width: 30px;
    height: 30px;
    stroke-width: 1.4;
}

/* Section Headers (shared) */
.categories,
.featured {
    padding-top: var(--space-3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-2);
}

.section-header h2 {
    position: relative;
    padding-bottom: 8px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.section-header h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--teal);
    border-radius: 2px;
}

.section-header a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    color: var(--teal-dark);
    font-size: 12.5px;
    font-weight: 600;
}

.section-header a .icon {
    width: 14px;
    height: 14px;
}

/* Categories Section */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.category-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px #0b22360f;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px #0b223622;
}

.category-card img {
    display: block;
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.category-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--mint);
}

.category-info h3 {
    font-size: 15px;
    font-weight: 700;
}

.category-info p {
    font-size: 12.5px;
    color: var(--muted);
}

.arrow-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: #dfe7ec;
    color: var(--ink);
    border-radius: 50%;
}

.arrow-btn .icon {
    width: 15px;
    height: 15px;
}

/* Features Strip */
.features-strip {
    margin-top: var(--space-3);
    padding-block: 16px;
    background: var(--mint);
}

.features-strip .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-inline: 20px;
    border-left: 1px solid var(--line);
}

.feature-item:first-child {
    padding-left: 0;
    border: 0;
}

.feature-item .icon {
    width: 38px;
    height: 38px;
    color: var(--teal-dark);
    stroke-width: 1.5;
}

.feature-item h3 {
    font-size: 15px;
    font-weight: 700;
}

.feature-item p {
    font-size: 12.5px;
    color: var(--muted);
}

/* Featured Products Section */
.product-slider {
    position: relative;
}

.product-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 7 * 14px) / 8);
    gap: 14px;
    padding: 2px 2px 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.product-grid::-webkit-scrollbar {
    display: none;
}

.product-card {
    position: relative;
    min-width: 150px;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 2px 8px #0b22360d;
    scroll-snap-align: start;
}

.badge {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 1;
    padding: 2px 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 5px;
}

.badge.green {
    background: var(--green);
}

.badge.blue {
    background: var(--blue);
}

.product-image {
    height: 104px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card h3 {
    min-height: 30px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.price {
    font-size: 17px;
    font-weight: 800;
    color: var(--teal-dark);
}

.add-to-cart {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: #e6edf1;
    color: var(--ink);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.add-to-cart:hover,
.add-to-cart.added {
    background: var(--teal);
    color: #fff;
}

.slider-next {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-60%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 3px 10px #0b223626;
    cursor: pointer;
}

.no-results {
    padding: 24px 0;
    color: var(--muted);
}

/* Cart Modal */
.cart-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(6, 32, 47, 0.65);
}

.cart-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.cart-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--ink);
}

.cart-body {
    padding: 8px 20px;
    overflow-y: auto;
}

.empty-cart-message {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
}

.cart-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    column-gap: 12px;
    row-gap: 6px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
    border-bottom: 0;
}

.item-image {
    grid-row: 1 / 3;
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.item-info h4 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.item-price {
    font-size: 12px;
    color: var(--muted);
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    background: var(--mint);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.quantity-btn:hover {
    background: var(--teal);
    color: #fff;
}

.quantity {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

.item-total {
    font-weight: 800;
    color: var(--teal-dark);
    text-align: right;
}

.remove-item {
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    justify-self: end;
}

.remove-item:hover {
    color: #e5484d;
}

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.cart-total h3 {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
}

.checkout-btn {
    width: 100%;
    justify-content: center;
    padding: 0;
}

/* Bill Preview Modal */
.bill-content {
    max-width: 640px;
}

.bill-preview {
    max-height: 320px;
    margin: 12px 0;
    padding: 16px;
    background: var(--mint);
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    overflow-y: auto;
}

.bill-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.bill-actions .btn-primary {
    padding: 0 28px;
    font-size: 14px;
}

/* Footer */
footer {
    margin-top: var(--space-4);
    padding-block: 32px;
    background: var(--navy);
    color: #c7d4df;
    font-size: 13px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

footer b {
    color: #fff;
    font-size: 16px;
    letter-spacing: 0.06em;
}

.footer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

/* Toast Message */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1100;
    padding: 10px 18px;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    border-radius: 99px;
    opacity: 0;
    transform: translate(-50%, 30px);
    transition: 0.25s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Responsive Design */
@media (max-width: 1180px) {
    .search-box {
        width: 220px;
    }

    .nav-links {
        gap: 18px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-grid {
        grid-auto-columns: calc((100% - 3 * 14px) / 4);
    }

    .features-strip .container {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 16px;
    }

    .feature-item:nth-child(3) {
        padding-left: 0;
        border: 0;
    }
}

@media (max-width: 900px) {
    .top-bar-left span:not(:first-child),
    .top-bar-left .divider,
    .top-bar-right .hide-mobile {
        display: none;
    }

    header .container {
        gap: 16px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    nav {
        display: none;
        position: absolute;
        top: 76px;
        left: 0;
        right: 0;
        padding: 8px var(--page-pad);
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    nav.open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
    }

    .nav-links a {
        height: 44px;
    }

    .nav-links a.active::after {
        display: none;
    }

    .search-box {
        display: none;
    }

    .hero-image {
        width: 100%;
        opacity: 0.45;
    }

    .product-grid {
        grid-auto-columns: calc((100% - 14px) / 2);
    }

    .slider-next {
        display: none;
    }
}

@media (max-width: 560px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid .category-card:last-child {
        grid-column: span 2;
    }

    .features-strip .container {
        grid-template-columns: 1fr;
    }

    .feature-item {
        padding-left: 0;
        border: 0;
    }

    .trust-badges {
        gap: 12px;
    }

    .logo img {
        width: 52px;
        height: 52px;
    }

    .hero p {
        font-size: 14.5px;
    }

    .bill-actions .btn-primary,
    .bill-actions .btn-secondary {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
