:root {
    --banner-bg: #0b1726;
    --banner-text: #ffffff;
    --page-bg: #0b1726;
    --category-bg: #ffffff;
    --category-text: #0b1726;
    --accent: #c9a96e;
    --button-bg: #0b1726;
    --button-text: #ffffff;
    --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 10px 28px rgba(201, 169, 110, 0.30), 0 4px 14px rgba(0, 0, 0, 0.4);
    --muted: #9aa6b8;
    --border: rgba(255, 255, 255, 0.08);
    --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);
    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    color: #e6ebf2;
    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;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(77, 168, 218, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(201, 169, 110, 0.06) 0%, transparent 55%),
        var(--page-bg);
}

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

.banner-inner {
    display: inline-block;
    width: 100%;
    max-width: 520px;
    padding: 0 16px;
}

.logo-svg {
    width: 100%;
    max-width: 460px;
    height: auto;
    display: block;
    margin: 0 auto;
}

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

.view {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeSlideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.view-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    margin: 8px 0 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.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;
    gap: 16px;
    width: 100%;
    min-height: 84px;
    padding: 16px 20px;
    background: var(--category-bg);
    color: var(--category-text);
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 19px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.row-button::after {
    content: '›';
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 28px;
    font-weight: 400;
    transition: transform var(--transition);
}

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

.row-button:hover::after { transform: translateY(-50%) translateX(4px); }

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

.row-button.subcategory { min-height: 72px; font-size: 17px; }

.row-button .row-image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: #eef1f6;
    flex-shrink: 0;
}

.row-button .row-image-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f2f4f8, #e1e6ee);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 24px;
    font-weight: 800;
}

.row-button .row-text { flex: 1; padding-right: 28px; }

.back-link {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 4px;
    cursor: pointer;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.back-link:hover { text-decoration: underline; }
.back-arrow { display: inline-block; transition: transform var(--transition); }
.back-link:hover .back-arrow { transform: translateX(-4px); }

.contact-strip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: #e6ebf2;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

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

.item-card {
    background: var(--category-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
    color: var(--category-text);
}

.item-photo-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef1f6;
    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: #8a93a1;
    font-size: 14px;
    text-align: center;
    padding: 16px;
}

.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: #4a5566;
    font-size: 14px;
    line-height: 1.5;
}

.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 #dde2ea;
    background: #f7f9fc;
    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: #b3b8c2;
    background: #f1f3f7;
    text-decoration: line-through;
    text-decoration-color: #b3b8c2;
    opacity: 0.75;
}

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

.empty-state {
    text-align: center;
    padding: 40px 12px;
    color: var(--muted);
    font-size: 15px;
}
.empty-state .small { font-size: 13px; opacity: 0.7; margin-top: 6px; }

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

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    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: 12px;
    background: transparent;
    opacity: 0.7;
}

.footer p { margin: 4px 0; }

@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) {
    *, *::before, *::after {
        transition: none !important;
        animation-duration: 0.001s !important;
    }
}
