:root {
    --bg: #ffffff;
    --surface: #f7f7f7;
    --text: #111111;
    --muted: #666666;
    --border: #e9e9e9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.site-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.cart-link {
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cart-count-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.brand {
    font-weight: 900;
    letter-spacing: 0.12em;
    text-decoration: none;
}

.hero {
    padding: 24px 16px;
}

.hero-content {
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 24px;
}

.hero-content h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 6vw, 42px);
    line-height: 1.1;
}

.hero-content p {
    margin: 0;
    color: rgba(255,255,255,0.84);
}

.products-section {
    padding: 8px 16px 32px;
}

.section-head h2 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.1);
}

.product-link {
    text-decoration: none;
    display: block;
}

.product-media {
    aspect-ratio: 1 / 1;
    width: 100%;
    background: var(--surface);
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-meta {
    padding: 14px;
}

.product-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px 14px;
}

.tap-hint {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.quick-add-btn {
    border: 1px solid #111;
    background: #111;
    color: #fff;
    border-radius: 8px;
    min-height: 34px;
    padding: 0 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.quick-add-btn:hover {
    opacity: 0.92;
}

.product-meta h3 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.35;
}

.price {
    margin: 0;
    color: #111;
    font-weight: 700;
}

.product-page {
    padding: 16px;
}

.product-layout {
    display: grid;
    gap: 20px;
}

.media-stack {
    display: grid;
    gap: 12px;
}

.main-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    position: relative;
}

#main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
    touch-action: manipulation;
}

#main-image.zoomed {
    transform: scale(1.06);
}

.thumbnail-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 72px;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    padding: 0;
    width: 72px;
    height: 72px;
    cursor: pointer;
}

.thumb.active {
    border-color: #111;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.info h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.info .price {
    margin-top: 8px;
    font-size: 22px;
}

.info .desc {
    margin: 12px 0 16px;
    color: var(--muted);
    line-height: 1.6;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.size-btn {
    border: 1px solid var(--border);
    background: #fff;
    color: #111;
    border-radius: 10px;
    min-height: 42px;
    cursor: pointer;
    font-weight: 600;
}

.size-btn.active {
    border-color: #111;
    background: #111;
    color: #fff;
}

.cart-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.cart-page h1 {
    margin: 0 0 16px;
}

.cart-items-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.cart-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
}

.cart-item h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.cart-item p {
    margin: 4px 0;
    color: var(--muted);
}

.cart-item-price {
    color: var(--text) !important;
    font-weight: 700;
}

.cart-summary {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    display: grid;
    gap: 12px;
    max-width: 360px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-empty {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 18px;
    color: var(--muted);
}

.add-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid #111;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.add-btn:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.accordion {
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.accordion details {
    border-bottom: 1px solid var(--border);
}

.accordion summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 0;
    font-weight: 700;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
    white-space: pre-line;
}

.color-options-side {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.color-options-side.visible {
    display: flex;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cfcfcf;
    cursor: pointer;
    padding: 0;
}

.color-dot.active {
    box-shadow: 0 0 0 1px #fff;
    outline: 2px solid #111;
    outline-offset: 1px;
}

.back-link {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 12px;
    color: #111;
    font-weight: 600;
}

.image-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    margin-bottom: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    background: #b8b8b8;
    border-radius: 50%;
    transition: background 0.3s;
    cursor: pointer;
}

.dot.active {
    background: #111111;
}

@media (min-width: 900px) {
    .products-section,
    .hero,
    .product-page {
        max-width: 1200px;
        margin: 0 auto;
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 36px;
    }
}
