/* Nibbu Store — Teenage Engineering inspired */

@font-face {
    font-family: 'Neue Kabel';
    src: url('assets/NeueKabel.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #e8e4de;
    --fg: #0f0e12;
    --fg-muted: #6b6762;
    --accent: #0f0e12;
    --card-radius: 4px;
    --font-sans: 'Space Grotesk', 'Neue Kabel', system-ui, sans-serif;
    --font-mono: 'Space Mono', monospace;
    --gutter: 24px;
    --max-w: 1200px;
}

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

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ─── TOPBAR ─── */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    height: 48px;
    background: var(--bg);
    border-bottom: 1px solid rgba(15, 14, 18, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.topbar-logo {
    display: flex;
    align-items: center;
    margin-right: 24px;
    height: 100%;
    padding: 0 4px;
}

.topbar-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
}

.topbar-link {
    font-size: 12px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    color: var(--fg-muted);
    transition: color 0.2s;
}

.topbar-link:hover,
.topbar-link.active {
    color: var(--fg);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-toggle {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--fg-muted);
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
}

.lang-toggle:hover {
    color: var(--fg);
}

.topbar-cart {
    position: relative;
    cursor: pointer;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.cart-icon {
    display: block;
}

.cart-count {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: var(--fg);
    pointer-events: none;
}

/* ─── HERO ─── */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px var(--gutter);
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg);
    will-change: transform, opacity;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 80px;
    width: 100%;
    max-width: 700px;
    justify-content: center;
}

.hero-face {
    width: 200px;
    height: 200px;
    position: relative;
    margin-top: -30px;
    flex-shrink: 0;
}

.hero-text {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.hero-text h1 {
    font-family: var(--font-sans);
    font-size: clamp(40px, 6vw, 72px);
    white-space: nowrap;
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -2px;
    text-transform: lowercase;
}

/* ─── HERO CTA ─── */

.hero-cta {
    display: inline-block;
    align-self: flex-start;
    margin-top: 32px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: lowercase;
    color: var(--fg);
    padding: 12px 28px;
    border: 1px solid var(--fg);
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
}

.hero-cta:hover {
    background: var(--fg);
    color: var(--bg);
    transform: translateY(-2px);
}

/* ─── PRODUCTS ─── */

.products-wrapper {
    position: relative;
    z-index: 2;
    background: var(--bg);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.08);
}

.products {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 20px var(--gutter) 50px;
    scroll-margin-top: 48px;
}

/* Category — scroll reveal */
.category {
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.category.revealed {
    opacity: 1;
    transform: translateY(0);
}

.category-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 14, 18, 0.12);
    margin-bottom: 32px;
}

.category-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
}

.category-title {
    font-size: 14px;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.category-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
    margin-left: auto;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

/* Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-img {
    aspect-ratio: 1 / 1;
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.product-img--wide {
    aspect-ratio: 2.4 / 1;
}

.product-img-placeholder {
    opacity: 0.6;
    transition: opacity 0.3s;
}

.product-card:hover .product-img-placeholder {
    opacity: 1;
}

.product-info {
    padding: 16px 0;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.2px;
    margin-bottom: 4px;
}

.product-desc {
    font-size: 12px;
    color: var(--fg-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

.product-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border: 1px solid var(--fg);
    border-radius: 100px;
    background: transparent;
    color: var(--fg);
    transition: all 0.2s;
    text-transform: lowercase;
}

.product-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

/* ─── ABOUT ─── */

.about {
    position: relative;
    z-index: 2;
    background: var(--bg);
    border-top: 1px solid rgba(15, 14, 18, 0.12);
}


.marquee {
    overflow: hidden;
    padding: 20px 0;
    border-bottom: 1px solid rgba(15, 14, 18, 0.12);
}

.marquee-inner {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.marquee-inner span {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--fg-muted);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.about-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 60px var(--gutter);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.about-text {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.6;
    max-width: 400px;
}

.about-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.about-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.about-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fg-muted);
}

.about-value {
    font-size: 14px;
}

/* ─── FOOTER ─── */

.footer {
    position: relative;
    z-index: 2;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    padding: 20px var(--gutter);
    border-top: 1px solid rgba(15, 14, 18, 0.12);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
}

/* ─── CART PANEL ─── */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: var(--bg);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(15, 14, 18, 0.1);
}

.cart-panel.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(15, 14, 18, 0.1);
    flex-shrink: 0;
}

.cart-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 400;
    text-transform: lowercase;
}

.cart-close {
    font-size: 24px;
    line-height: 1;
    color: var(--fg-muted);
    transition: color 0.2s;
    padding: 0;
}

.cart-close:hover {
    color: var(--fg);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--fg-muted);
    font-size: 13px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(15, 14, 18, 0.08);
}

.cart-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 500;
    text-transform: lowercase;
}

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

.cart-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(15, 14, 18, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--fg);
    transition: all 0.15s;
    line-height: 1;
}

.cart-qty-btn:hover {
    border-color: var(--fg);
}

.cart-item-remove {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: lowercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: var(--fg);
}

/* Cart Footer */
.cart-footer {
    flex-shrink: 0;
    padding: 24px;
    border-top: 1px solid rgba(15, 14, 18, 0.1);
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--fg-muted);
}

.cart-summary-row span:last-child {
    font-family: var(--font-mono);
}

.cart-summary-total {
    color: var(--fg);
    font-weight: 500;
    font-size: 14px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 14, 18, 0.1);
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: lowercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cart-checkout-btn:hover {
    opacity: 0.85;
}

/* Checkout Form */
.checkout-form {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.checkout-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkout-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fg-muted);
    margin-bottom: 4px;
}

.checkout-input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 16px;
    border: 1px solid rgba(15, 14, 18, 0.15);
    border-radius: 4px;
    background: transparent;
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s;
}

.checkout-input::placeholder {
    color: var(--fg-muted);
    opacity: 0.6;
}

.checkout-input:focus {
    border-color: var(--fg);
}

.checkout-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.checkout-total-bar {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    padding: 16px 0;
    border-top: 1px solid rgba(15, 14, 18, 0.1);
}

.checkout-total-bar span:last-child {
    font-family: var(--font-mono);
}

.checkout-back {
    width: 100%;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
    text-align: center;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    transition: color 0.2s;
}

.checkout-back:hover {
    color: var(--fg);
}

/* Order Confirmation */
.checkout-confirm {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border: 2px solid var(--fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.checkout-confirm h3 {
    font-size: 16px;
    font-weight: 500;
    text-transform: lowercase;
}

.checkout-confirm p {
    font-size: 13px;
    color: var(--fg-muted);
    margin-bottom: 24px;
}

/* Voucher */
.cart-voucher {
    margin-bottom: 20px;
}

.cart-voucher-row {
    display: flex;
    gap: 8px;
}

.cart-voucher-input {
    flex: 1;
    padding: 10px 12px !important;
    font-size: 13px !important;
}

.cart-voucher-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 0 16px;
    border: 1px solid var(--fg);
    border-radius: 4px;
    background: transparent;
    color: var(--fg);
    text-transform: lowercase;
    transition: all 0.2s;
    white-space: nowrap;
}

.cart-voucher-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.cart-voucher-msg {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    margin-top: 6px;
    min-height: 16px;
}

.cart-voucher-msg.success {
    color: #1c9446;
}

.cart-voucher-msg.error {
    color: #cf3a2b;
}

.cart-summary-row--discount {
    color: #1c9446;
}

/* Checkboxes */
.checkout-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 12px;
    color: var(--fg-muted);
    line-height: 1.4;
    margin-top: 4px;
}

.checkout-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--fg);
    cursor: pointer;
    margin-top: 1px;
}

.checkout-checkbox span {
    user-select: none;
}

.checkout-checkbox--terms {
    margin-bottom: 12px;
}

.checkout-checkbox--terms.error span {
    color: #cf3a2b;
}

.checkout-terms-link {
    text-decoration: underline;
    color: var(--fg);
}

/* Add-to-cart feedback */
.product-btn.added {
    background: var(--fg);
    color: var(--bg);
}

/* Cart badge pulse */
@keyframes cartPulse {
    0% { transform: scale(1); }
    20% { transform: scale(1.35); }
    40% { transform: scale(1); }
    60% { transform: scale(1.35); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

.topbar-cart.pulse {
    animation: cartPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fly-to-cart animation */
.fly-to-cart {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    border-radius: 12px;
    opacity: 1;
    transition: none;
}

.fly-to-cart.flying {
    transition: transform 0.7s ease-in-out,
                opacity 0.7s ease-in-out;
    opacity: 0;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .hero {
        min-height: 100svh;
        overflow: visible;
    }

    .hero-inner {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .hero-face {
        width: 150px;
        height: 180px;
    }

    .hero-text h1 {
        white-space: normal;
    }

    .hero-cta {
        margin-top: 24px;
        align-self: center;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 480px) {
    :root {
        --gutter: 16px;
    }

    .hero-text h1 {
        font-size: 36px;
        letter-spacing: -1px;
    }

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

    .topbar-links {
        gap: 16px;
    }

    .cart-panel {
        width: 100vw;
    }
}
