:root {
    /* Material Light theme */
    --store-bg-darkest: #fafafa;
    --store-bg-darker: #f5f5f5;
    --store-bg-dark: #eeeeee;
    --store-bg-card: #ffffff;
    --store-bg-elevated: #f5f5f5;
    --store-border: #e0e0e0;
    --store-text: #212121;
    --store-text-muted: #757575;
    --store-accent: #1976d2;
    --store-accent-hover: #1565c0;
    --store-success: #388e3c;
    --store-danger: #d32f2f;
    --store-warning: #f57c00;

    /* Header - solid black */
    --store-header-bg: #000000;
    --store-header-text: #ffffff;
}

body {
    background: var(--store-bg-darkest);
    color: var(--store-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar {
    background: var(--store-header-bg) !important;
    border-bottom: none;
}

.navbar-brand {
    font-weight: 600;
    color: var(--store-header-text) !important;
}

.navbar-brand img {
    height: 32px;
    width: auto;
}

/* Header menu (Knox Makers style) */
#header-menu {
    gap: 20px;
    flex-wrap: nowrap;
    font-family: 'Jost', sans-serif;
}

#header-menu .nav-item {
    list-style: none;
}

#header-menu .nav-link {
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px;
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

#header-menu .nav-link:hover,
#header-menu .nav-link:focus {
    color: #ffffff !important;
    text-decoration: none;
}

/* Hide Bootstrap's default caret everywhere (replaced by chevron icon) */
#header-menu .dropdown-toggle::after {
    display: none;
}

/* Chevron icon: mobile only, rotates when open */
#header-menu .dropdown-chevron {
    display: none;
    font-size: 0.75em;
    transition: transform 0.2s ease;
}
@media (max-width: 991.98px) {
    #header-menu .dropdown-chevron {
        display: inline;
    }
    #header-menu .dropdown-toggle[aria-expanded="true"] .dropdown-chevron {
        transform: rotate(180deg);
    }
}

/* Dropdown base styles */
#header-menu .dropdown-menu {
    background: rgb(104, 104, 104);
    border: none;
    border-radius: 0;
    margin-top: 0;
    min-width: 180px;
    padding: 0;
}

/* Mobile: slide open/close using max-height (no space taken when closed) */
@media (max-width: 991.98px) {
    #header-menu .dropdown-menu {
        display: block !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        background: #000;
        padding-left: 1rem;
    }
    #header-menu .dropdown-menu.show {
        max-height: 500px;
    }
}

/* Desktop: fade in/out, open on hover */
@media (min-width: 992px) {
    #header-menu .dropdown-menu {
        display: block !important;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.15s ease, visibility 0.15s ease;
        pointer-events: none;
    }
    #header-menu .dropdown-menu.show,
    #header-menu .nav-item.dropdown:hover .dropdown-menu {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
}

#header-menu .dropdown-item {
    color: #ffffff;
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    padding: 10px 12px;
    text-decoration: none;
}

#header-menu .dropdown-item:hover,
#header-menu .dropdown-item:focus {
    background: rgb(70, 70, 70);
    color: #ffffff;
    text-decoration: none;
}

/* Cart badge */
.cart-badge {
    position: absolute;
    top: 0;
    right: -8px;
    background: var(--store-accent);
    color: white;
    border-radius: 50%;
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--store-bg-card);
    border: 1px solid var(--store-border);
    border-radius: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: var(--store-bg-elevated);
    border-bottom: 1px solid var(--store-border);
}

/* Product cards */
.product-card {
    cursor: pointer;
    overflow: hidden;
}

.product-card .card-img-top {
    height: 280px;
    object-fit: cover;
    background: var(--store-bg-elevated);
}

.product-card .card-img-placeholder {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--store-bg-elevated);
    color: var(--store-text-muted);
    font-size: 3rem;
}

.product-card .card-body {
    padding: 1rem;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--store-accent);
}

/* Product detail page */
.product-image-main {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: var(--store-bg-elevated);
    border-radius: 0.5rem;
}

.product-image-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--store-bg-elevated);
    color: var(--store-text-muted);
    font-size: 5rem;
    border-radius: 0.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--store-accent);
    border-color: var(--store-accent);
}

.btn-primary:hover {
    background: var(--store-accent-hover);
    border-color: var(--store-accent-hover);
}

.btn-outline-primary {
    color: var(--store-accent);
    border-color: var(--store-accent);
}

.btn-outline-primary:hover {
    background: var(--store-accent);
    border-color: var(--store-accent);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--store-text-muted);
    border-color: var(--store-border);
}

.btn-outline-secondary:hover {
    background: var(--store-bg-elevated);
    border-color: var(--store-border);
    color: var(--store-text);
}

.btn-success {
    background: var(--store-success);
    border-color: var(--store-success);
}

.btn-danger {
    background: var(--store-danger);
    border-color: var(--store-danger);
}

/* Forms */
.form-control, .form-select {
    background: var(--store-bg-dark);
    border-color: var(--store-border);
    color: var(--store-text);
}

.form-control:focus, .form-select:focus {
    background: var(--store-bg-dark);
    border-color: var(--store-accent);
    color: var(--store-text);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-control::placeholder {
    color: var(--store-text-muted);
}

/* Cart table */
.cart-table {
    background: var(--store-bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
}

.cart-table th {
    background: var(--store-bg-elevated);
    border-color: var(--store-border);
}

.cart-table td {
    vertical-align: middle;
    border-color: var(--store-border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cart-item-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--store-bg-elevated);
    color: var(--store-text-muted);
    border-radius: 0.25rem;
}

/* Quantity input */
.quantity-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input .btn {
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.quantity-input input {
    width: 60px;
    text-align: center;
}

/* Cart summary */
.cart-summary {
    background: var(--store-bg-card);
    border: 1px solid var(--store-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--store-border);
}

.cart-summary .summary-row:last-child {
    border-bottom: none;
}

.cart-summary .summary-total {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Categories sidebar */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.25rem;
}

.category-list a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--store-text-muted);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.category-list a:hover,
.category-list a.active {
    background: var(--store-bg-elevated);
    color: var(--store-text);
}

/* Footer */
.footer {
    background: var(--store-header-bg);
    border-top: none;
}

/* Alerts */
.alert-success {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-color: #ffe0b2;
    color: #ef6c00;
}

.alert-info {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1565c0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--store-text-muted);
}

.empty-state > i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state .btn i {
    font-size: inherit;
    margin-bottom: 0;
}

/* Checkout form */
.checkout-form .form-label {
    font-weight: 500;
}

.checkout-form .form-group {
    margin-bottom: 1.25rem;
}

/* Order summary */
.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--store-border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.order-item-details {
    flex: 1;
}

.order-item-name {
    font-weight: 500;
}

.order-item-quantity {
    color: var(--store-text-muted);
    font-size: 0.875rem;
}

.order-item-price {
    font-weight: 600;
}

/* Filter bar */
.filter-bar .card {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-bar .card:hover {
    transform: none;
}

.filter-bar .form-select {
    font-weight: 500;
    min-width: 160px;
}

/* Hide header search - use filter bar instead */
.navbar .d-flex.mx-auto {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    /* Adjust container padding on mobile */
    main.container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .product-card .card-img-top,
    .product-card .card-img-placeholder {
        height: 240px;
    }

    .product-card .card-body {
        padding: 0.75rem;
    }

    .product-card .card-title {
        font-size: 1rem;
    }

    .product-card .product-price {
        font-size: 1rem;
    }

    .cart-item-image,
    .cart-item-placeholder {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 575.98px) {
    /* Smaller product cards on very small screens */
    .product-card .card-img-top,
    .product-card .card-img-placeholder {
        height: 200px;
    }
}
