:root {
    --blue: #2277BB;
    --red: #AA5555;
    /* Muted Red */
    --gray: #AAAAAA;
    --light: #F4F4F4;
    --dark: #111111;
    --border-color: #000;

    /* Golden Ratio Scale (Base 1rem = 16px) */
    --s-xs: 0.382rem;
    --s-sm: 0.618rem;
    --s-base: 1rem;
    --s-md: 1.618rem;
    --s-lg: 2.618rem;
    --s-xl: 4.236rem;
    --s-xxl: 6.854rem;
}

html {
    font-size: 125%;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    /* Stabilize scrolling */
}

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar {
    width: var(--s-sm);
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--dark);
    border: 2px solid white;
    /* Adds crisp definition */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
    font-family: 'Courier New', Courier, monospace !important;
}

body {
    background: white;
    color: var(--dark);
    line-height: 1.618;
    font-size: var(--s-base);
}

/* Sidebar & Nav */
.hamburger {
    position: fixed;
    top: var(--s-base);
    left: var(--s-base);
    z-index: 1000;
    cursor: pointer;
    display: block;
    width: var(--s-lg);
    height: var(--s-lg);
    background: white;
    border: 4px solid var(--dark);
    box-shadow: var(--s-xs) var(--s-xs) 0 var(--dark);
    transition: 0.1s;
}

.hamburger:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--s-sm) var(--s-sm) 0 var(--dark);
}

.hamburger:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 var(--dark);
}

.hamburger span {
    display: none;
}

.hamburger::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

#nav-toggle:checked~.hamburger {
    background: var(--blue);
    box-shadow: 2px 2px 0 var(--dark);
}

.nav-toggle {
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -16.18rem;
    width: 16.18rem;
    height: 100vh;
    background: white;
    padding: var(--s-xl) var(--s-md) var(--s-md);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border-right: 3px solid var(--dark);
    display: flex;
    flex-direction: column;
}

#nav-toggle:checked~.sidebar {
    left: 0;
}

/* Header Branding Changes */
.sidebar h2 {
    color: var(--blue);
    font-size: 2.5rem;
    line-height: 0.9;
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 700;
    word-break: break-word;
    text-shadow: 2px 2px 0 var(--dark);
    -webkit-text-stroke: 1px var(--dark);
    text-align: center;
}

.sidebar h2 span {
    display: block;
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar a {
    display: block;
    padding: 0.8rem 0;
    color: var(--dark);
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid transparent;
    transition: 0.2s;
    transition-delay: var(--sidebar-delay, 0s);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--blue);
    color: white;
    padding-left: var(--s-base);
    border-bottom-color: var(--dark);
    box-shadow: 4px 4px 0 var(--dark);
}

.sidebar footer {
    margin-top: auto;
    font-size: var(--s-sm);
    color: #555;
    border-top: 4px solid var(--dark);
    padding-top: var(--s-base);
}

.sidebar footer a {
    display: inline;
    padding: 0;
    border: none;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
    color: inherit;
    text-decoration: underline;
}

.sidebar footer a:hover {
    background: transparent;
    color: var(--blue);
    padding-left: 0;
    box-shadow: none;
    text-decoration: underline;
}

/* Main Layout */
main {
    margin-left: 0;
    padding: var(--s-base);
    min-height: 100vh;
}

/* Grid */
.grid {
    display: grid;
    gap: var(--s-md);
    grid-template-columns: repeat(auto-fill, minmax(calc(var(--s-xxl) * 1.618), 1fr));
    max-width: 1800px;
    margin: 0 auto;
    contain: layout;
}

.grid-item {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 2px solid var(--dark);
    transition: 0.2s;
    /* Unify speed with buttons */
    background: white;

    /* FORCE RECTANGLE SHAPE */
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.grid-item:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--s-sm) var(--s-sm) 0 var(--blue);
    /* Matched to buttons size (7px) */
    border-color: var(--dark);
    /* Keep border black */
    /* Pop over */
    transition-delay: var(--hover-delay, 0s);
    /* Debounce fast movement */
}

.grid-item:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 var(--blue);
    /* Tactile press */
    transition: 0.1s;
}

/* Images */
.grid img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--s-xl);
    font-size: var(--s-md);
    color: var(--gray);
}

/* Product Page Styles */
.main-image-container {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border: 4px solid var(--dark);
    box-shadow: var(--s-sm) var(--s-sm) 0 var(--blue);
    margin-bottom: var(--s-base);
    position: relative;
    cursor: zoom-in;
    background: white;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main-image.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.thumbnails {
    display: flex;
    gap: var(--s-sm);
    overflow-x: auto;
    padding-bottom: var(--s-sm);
}

.thumb {
    width: 4.236rem;
    height: 4.236rem;
    object-fit: cover;
    border: 2px solid var(--dark);
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
    flex-shrink: 0;
}

.thumb:hover,
.thumb.active {
    opacity: 1;
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0 var(--dark);
}



/* Buttons */
.buy-btn {
    display: inline-block;
    background: black;
    color: white;
    padding: var(--s-base) var(--s-md);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    border: 4px solid var(--dark);
    box-shadow: var(--s-xs) var(--s-xs) 0 var(--dark);
    transition: 0.2s;
    cursor: pointer;
    margin-top: var(--s-base);
    font-size: 1rem;
}

.buy-btn:hover {
    background: var(--red);
    color: white;
    transform: translate(-3px, -3px);
    box-shadow: var(--s-sm) var(--s-sm) 0 var(--dark);
}

.buy-btn:active {
    -webkit-text-stroke: 1px var(--dark);
    background: var(--blue);
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 var(--dark);
}

.back-btn {
    display: inline-block;
    margin-bottom: var(--s-base);
    color: var(--gray);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--s-sm);
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
}

.back-btn:hover {
    color: var(--dark);
    border-bottom-color: var(--red);
}

/* Sentinel */
.sentinel {
    height: var(--s-lg);
    width: 100%;
}

@media (min-width: 768px) {
    .sidebar {
        left: 0;
        /* Always show sidebar on desktop */
    }

    .hamburger {
        display: none;
        /* Hide toggle on desktop */
    }

    main {
        margin-left: 16.18rem;
        /* Sidebar width */
        padding: 3rem;
    }
}