/* ==========================================================================
   Base — Reset, typography, body, scrollbars, loading states, animations
   ========================================================================== */

/* ── Reset ───────────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--background-color);
    min-height: 100vh;
}

html, body {
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
}

body {
    background: transparent;
    padding-top: var(--header-height);
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* ── Animated horizon grid background ───────────────────────────────────── */

.grid-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.grid-bg::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 140, 0, 0.12) 0px,
            rgba(255, 140, 0, 0.12) 1px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 140, 0, 0.12) 0px,
            rgba(255, 140, 0, 0.12) 1px,
            transparent 1px,
            transparent 60px
        );
    transform: perspective(300px) rotateX(65deg);
    transform-origin: center center;
    animation: gridScroll 8s linear infinite;
}

.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--background-color) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 140, 0, 0.03) 80%,
        var(--background-color) 100%
    );
}

@keyframes gridScroll {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 0 60px, 0 60px; }
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.site-name,
.nav-buttons {
    font-family: var(--font-main);
}

button,
.btn,
input,
select,
.nav-buttons a {
    font-family: var(--font-ui);
}

p,
.product-description,
.store-description,
.info-text p,
.update-notes {
    font-family: var(--font-body);
    line-height: 1.7;
}

.product-title,
.price-amount,
.btc-widget-header h2,
.btc-current-price {
    font-family: var(--font-main);
}

.price-usd,
.price-sats,
.btc-value,
.cart-count {
    font-family: var(--font-main);
    font-feature-settings: "tnum" 1;
}

.product-tag,
.info-label,
.price-label {
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Loading / shimmer ───────────────────────────────────────────────────── */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* ── Responsive base ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --spacing-md: 15px;
        --spacing-sm: 8px;
        --header-height: 60px;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing: 16px;
    }
}
