:root {
    --page-background: #111111;
    --header-background: #111111;
    --card-background: #1c1c1c;
    --text-color: #ffffff;
    --secondary-text-color: #bbbbbb;
    --accent-color: #ffffff;
    --button-background: #ffffff;
    --button-text: #111111;
    --border-color: #333333;
    --content-width: 1200px;
    --card-radius: 12px;
    --background-image: none;
    --catalog-background-image: none;
    --catalog-overlay: rgba(0, 0, 0, 0.28);
    --catalog-animation-duration: 16s;
}
* { box-sizing: border-box; }
body {
    min-height: 100vh;
    background-color: var(--page-background);
    background-image: var(--background-image);
    background-size: cover;
    background-position: center;
    color: var(--text-color);
}
header { background: var(--header-background); border-color: var(--border-color); gap: 16px; }
a { color: var(--accent-color); }
header a { color: var(--text-color); }
main { max-width: var(--content-width); }
.brand-logo { max-width: 100%; object-fit: contain; }
.product, .product-card, .shipping-section, .shipping-rate {
    background: var(--card-background);
    border-color: var(--border-color);
    border-radius: var(--card-radius);
}
.cart-item { border-color: var(--border-color); }
input, select {
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
}
button, .button {
    background: var(--button-background);
    color: var(--button-text);
    border: 1px solid var(--border-color);
}
.shipping-message, .shipping-rate-delivery, .checkout-status, .product-price, #product-status {
    color: var(--secondary-text-color);
}
.shipping-error { color: #ff7a7a; }
.shipping-rate:hover { border-color: var(--accent-color); }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }
.categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 16px; }
.category-button { padding: 10px 16px; border-radius: 999px; cursor: pointer; font: inherit; }
.category-button[aria-pressed="true"] { outline: 2px solid var(--accent-color); outline-offset: 3px; font-weight: bold; }
#product-status { text-align: center; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination button { min-width: 44px; min-height: 44px; padding: 10px 14px; border-radius: 8px; font: inherit; cursor: pointer; }
.pagination button[aria-current="page"] { outline: 2px solid var(--accent-color); outline-offset: 2px; font-weight: bold; }
.pagination button:disabled, .category-button:disabled { opacity: 0.55; cursor: default; }
.pagination .page-gap { align-self: center; }
.products { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: 24px; }
.product-card { padding: 20px; transition: transform 150ms ease, border-color 150ms ease; }
.product-card:hover { transform: translateY(-3px); border-color: var(--accent-color); }
.product-card > a { color: var(--text-color); text-decoration: none; display: flex; height: 100%; flex-direction: column; gap: 12px; }
.product-image-area { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--card-radius); }
.product-card img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.product-card h2 { font-size: 20px; margin: 0; overflow-wrap: anywhere; }
.product-price { margin: 0; }
.product-card .button { margin-top: auto; display: block; padding: 12px; border-radius: var(--card-radius); font-weight: bold; }
@media (max-width: 600px) {
    main { padding: 28px 16px; }
    header { flex-wrap: wrap; }
    .product { padding: 20px; }
    .categories { gap: 8px; }
    .category-button { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { .product-card { transition: none; } .product-card:hover { transform: none; } }

/* Isolated layers keep animation and overlay behind main content only. */
main.catalog-main { max-width: none; padding: 0; }
.store-background-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--page-background);
    --catalog-breath-scale: 1.05;
}
.store-background-section::before, .store-background-section::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.store-background-section::before {
    z-index: -2;
    background-image: var(--catalog-background-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: catalog-breathe var(--catalog-animation-duration) ease-in-out infinite;
}
.store-background-section::after {
    z-index: -1;
    background: var(--catalog-overlay);
}
.catalog-content {
    max-width: var(--content-width);
    margin: auto;
    padding: 50px 20px;
}
/* Retain the configured opaque card surface; no breathing on card content. */
.store-background-section .product-card { transition: border-color 150ms ease; }
.store-background-section .product-card:hover { transform: none; }
@keyframes catalog-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(var(--catalog-breath-scale)); }
}
@media (max-width: 600px) {
    .catalog-content { padding: 28px 16px; }
    .store-background-section { --catalog-breath-scale: 1.03; }
}
@media (prefers-reduced-motion: reduce) {
    .store-background-section::before { animation: none; transform: none; }
    .store-background-section .product-card { transition: none; }
}

/* Equal side columns center the title within the whole homepage header. */
.store-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    background: #111111;
}
.store-header .brand { justify-self: start; min-width: 0; }
.store-header .header-cart { justify-self: end; text-align: right; }
.header-title {
    margin: 0;
    font-size: clamp(18px, 3vw, 32px);
    line-height: 1.2;
    text-align: center;
    color: var(--text-color);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .header-title {
        background: linear-gradient(90deg, #ff5252, #ffad42, #ffe66d, #63e88a, #60b7ff, #c58aff, #ff5252);
        background-size: 200% 100%;
        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;
        animation: header-rainbow 10s ease-in-out infinite;
    }
}
@keyframes header-rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@media (max-width: 600px) {
    .store-header { gap: 8px; padding: 16px 12px; }
    .store-header .header-title { max-width: 42vw; font-size: clamp(16px, 4vw, 22px); }
    .store-header .header-cart { font-size: 14px; overflow-wrap: anywhere; }
    .store-header .brand-logo { height: auto; max-height: 56px; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .header-title { animation: none; }
}
@media (forced-colors: active) {
    .header-title { background: none; color: CanvasText; animation: none; }
}

/* Shared header text metrics, including pages whose default paragraph is larger. */
.store-header .header-title { font-weight: bold; margin: 0; }
.store-header .header-cart { font-size: 18px; }
.product-loading-space { min-height: 320px; }
.product img[hidden] { display: none; }
@media (max-width: 600px) {
    .store-header .header-cart { font-size: 14px; }
    .product-loading-space { min-height: 240px; }
}

/* Keep cart and confirmation text readable without changing page behavior. */
.store-content-panel {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 24px;
}
@media (max-width: 600px) {
    .store-content-panel { padding: 16px; }
}

/* Fill the viewport below any header height, including short loading/error pages.
   Scoped to detail/cart/success pages so the homepage stays unchanged. */
body.store-content-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
.store-content-page > header { flex-shrink: 0; }
.store-content-page > .store-background-section {
    flex: 1 0 auto;
    width: 100%;
}
.store-content-page .store-background-section > main { width: 100%; }
.store-content-page .product,
.store-content-page .store-content-panel {
    background: rgba(20, 20, 20, 0.82);
    background: color-mix(in srgb, var(--card-background) 82%, transparent);
}
