:root {
    --black: #111111;
    --dark: #1c1c1c;
    --light: #f5f5f5;
    --white: #ffffff;
    --border: #dddddd;
    --accent: #e30613;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: var(--black);
    background: var(--white);
}

.container {
    width: min(1200px, 92%);
    margin: auto;
}

.site-header {
    background: var(--black);
    color: white;
}

.header-inner {
    min-height: 76px;

    display: flex;
    align-items: center;
    gap: 35px;
}

.logo {
    color: white;
    text-decoration: none;

    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
}

.search-wrap {
    flex: 1;
}

.search-wrap input {
    width: 100%;

    padding: 14px 18px;

    border: none;
    border-radius: 4px;

    font-size: 15px;
}

.cart-button {
    background: white;
    border: none;

    padding: 12px 18px;
    border-radius: 4px;

    cursor: pointer;
}

#cart-count {
    font-weight: bold;
    margin-left: 5px;
}

.category-bar {
    border-bottom: 1px solid var(--border);
    background: white;
}

.category-inner {
    display: flex;
    gap: 30px;

    padding: 15px 0;
}

.category-inner a {
    color: var(--black);
    text-decoration: none;
    font-size: 14px;
}

.category-inner a:hover {
    color: var(--accent);
}

.hero {
    background: var(--dark);
    color: white;
}

.hero-inner {
    min-height: 390px;

    display: flex;
    align-items: center;
}

.eyebrow {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
}

.hero h1 {
    font-size: clamp(42px, 6vw, 76px);
    line-height: .95;

    margin: 18px 0;
}

.hero p {
    font-size: 18px;
    max-width: 600px;

    color: #dddddd;
}

.primary-button,
.secondary-button {
    border: none;
    cursor: pointer;

    padding: 14px 24px;

    font-weight: bold;
    border-radius: 3px;
}

.primary-button {
    background: var(--accent);
    color: white;
}

.secondary-button {
    background: var(--black);
    color: white;

    margin: 35px auto;
    display: block;
}

.products-section {
    padding: 70px 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;

    margin-bottom: 35px;
}

.section-heading h2 {
    margin: 8px 0 0;
    font-size: 34px;
}

.products-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap: 24px;
}

.product-card {
    border: 1px solid var(--border);
    background: white;

    cursor: pointer;

    transition:
        transform .15s,
        box-shadow .15s;
}

.product-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 10px 30px
        rgba(0,0,0,.10);
}

.product-image {
    width: 100%;
    height: 220px;

    object-fit: contain;

    padding: 18px;

    background: #fafafa;
}

.product-info {
    padding: 18px;
}

.product-brand {
    font-size: 12px;
    color: #777;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    min-height: 48px;

    margin-top: 7px;

    font-size: 15px;
    line-height: 1.35;
}

.product-price {
    margin-top: 18px;

    font-size: 22px;
    font-weight: 800;
}

.price-label {
    font-size: 11px;
    color: #777;

    margin-top: 3px;
}

.product-stock {
    margin-top: 10px;

    font-size: 12px;
}

.in-stock {
    color: #16833a;
}

.out-stock {
    color: #a00;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #777;
}

footer {
    background: var(--black);
    color: white;

    margin-top: 50px;
}

.footer-inner {
    padding: 50px 0;

    display: flex;
    justify-content: space-between;
}

.footer-bottom {
    border-top: 1px solid #333;

    text-align: center;

    padding: 18px;

    color: #aaa;

    font-size: 12px;
}

.modal {
    position: fixed;

    inset: 0;

    background:
        rgba(0,0,0,.75);

    padding: 40px;

    overflow: auto;
}

.modal-content {
    background: white;

    max-width: 900px;

    margin: auto;

    padding: 35px;

    position: relative;
}

.modal-close {
    position: absolute;

    right: 15px;
    top: 10px;

    border: none;
    background: none;

    font-size: 32px;

    cursor: pointer;
}

.detail-product {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 40px;
}

.detail-product img {
    width: 100%;
    max-height: 450px;

    object-fit: contain;
}

.detail-price {
    font-size: 32px;
    font-weight: 800;

    margin: 20px 0 5px;
}

.detail-price-label {
    color: #777;
    font-size: 12px;
}

.add-cart {
    background: var(--accent);
    color: white;

    border: none;

    padding: 15px 25px;

    cursor: pointer;

    font-weight: bold;

    margin-top: 20px;
}

@media(max-width:700px) {

    .header-inner {
        flex-wrap: wrap;
        padding: 15px 0;
    }

    .search-wrap {
        order: 3;
        flex-basis: 100%;
    }

    .category-inner {
        overflow-x: auto;
        white-space: nowrap;
    }

    .hero-inner {
        min-height: 330px;
    }

    .products-section {
        padding: 45px 0;
    }

    .detail-product {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: 30px;
    }
}

.stock-unknown {
    color: #996600;
}


/* =========================
   DATABASE CATEGORY MENU
   ========================= */

.dynamic-category-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-dropdown {
    position: relative;
}

.category-menu-button {
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
    padding: 9px 12px;
    font-weight: 600;
}

.category-menu-button::after {
    content: " ▾";
    font-size: 10px;
}

.category-dropdown-content {
    display: none;
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    padding: 6px 0;
}

.category-dropdown:hover .category-dropdown-content {
    display: block;
}

.category-dropdown-content a {
    display: block;
    padding: 9px 14px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.category-dropdown-content a:hover {
    background: #f5f6f8;
}

.category-loading {
    padding: 9px 12px;
    opacity: .6;
}

@media (max-width: 900px) {

    .dynamic-category-menu {
        flex-wrap: wrap;
    }

    .category-dropdown-content {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        max-height: 70vh;
        overflow-y: auto;
    }
}
