:root {
    --banner-bg: #0a2351;
    --banner-text: #ffffff;
    --page-bg: #f5f5f5;
    --category-bg: #ffffff;
    --category-text: #0a2351;
    --accent: #c9a227;
    --button-bg: #0a2351;
    --button-text: #ffffff;
    --row-shadow: 0 2px 6px rgba(10, 35, 81, 0.08);
    --row-shadow-hover: 0 4px 14px rgba(10, 35, 81, 0.18);
    --muted: #8a8a8a;
    --border: #e2e2e2;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    display: flex;
    flex-direction: column;
}

.banner {
    background: var(--banner-bg);
    color: var(--banner-text);
    padding: calc(20px + var(--safe-top)) var(--safe-right) 20px var(--safe-left);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

.banner-inner {
    display: inline-block;
    line-height: 1;
}

.title-line {
    display: block;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    white-space: nowrap;
}

.title-line-1 {
    font-size: clamp(20px, 6vw, 36px);
    margin-bottom: 4px;
}

.title-line-2 {
    font-size: clamp(40px, 14vw, 88px);
}

.app {
    flex: 1 1 auto;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px max(16px, var(--safe-right)) 24px max(16px, var(--safe-left));
    display: flex;
    flex-direction: column;
}

.view {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.view-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 12px 0 20px;
}

.view-categories {
    justify-content: center;
}

.row-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: auto 0;
    padding: 8px 0;
}

.row-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    padding: 20px 24px;
    background: var(--category-bg);
    color: var(--category-text);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--row-shadow);
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    line-height: 1.2;
}

.row-button:hover,
.row-button:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--row-shadow-hover);
    outline: none;
}

.row-button:active {
    transform: scale(0.99);
}

.row-button.subcategory {
    min-height: 70px;
    font-size: 19px;
    background: var(--category-bg);
}

.back-link {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--button-bg);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 4px;
    cursor: pointer;
    margin-bottom: 6px;
}

.back-link:hover { text-decoration: underline; }

.contact-strip {
    background: var(--banner-bg);
    color: var(--banner-text);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.item-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.item-card {
    background: var(--category-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--row-shadow);
    display: flex;
    flex-direction: column;
}

.item-photo-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    -webkit-user-select: none;
    user-select: none;
}

.item-photo-placeholder {
    color: var(--muted);
    font-size: 14px;
}

.item-body {
    padding: 16px 18px 18px;
}

.item-name {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--category-text);
}

.item-desc {
    margin: 0 0 12px;
    color: #555;
    font-size: 14px;
    line-height: 1.45;
}

.size-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fafafa;
    font-size: 13px;
    font-weight: 600;
    color: var(--category-text);
    min-height: 36px;
}

.size-chip .size-label {
    letter-spacing: 0.5px;
}

.size-chip .size-qty {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.size-chip.empty {
    color: var(--muted);
    background: #f3f3f3;
    text-decoration: line-through;
    text-decoration-color: var(--muted);
    opacity: 0.7;
}

.size-chip.empty .size-qty {
    background: #c9c9c9;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 40px 12px;
    color: var(--muted);
    font-size: 15px;
}

.loading {
    text-align: center;
    padding: 60px 12px;
    color: var(--muted);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: env(safe-area-inset-top, 16px) env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 16px) env(safe-area-inset-left, 16px);
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-close {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
}

.footer {
    text-align: center;
    padding: 18px max(16px, var(--safe-right)) calc(18px + var(--safe-bottom)) max(16px, var(--safe-left));
    color: var(--muted);
    font-size: 13px;
    background: transparent;
}

.footer p { margin: 4px 0; }
.footer .admin-link a { color: var(--muted); text-decoration: none; }
.footer .admin-link a:hover { text-decoration: underline; }

@media (min-width: 720px) {
    .item-card {
        flex-direction: row;
    }
    .item-photo-wrap {
        width: 240px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }
    .item-body {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
