* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--color-primary);
    color: #fff;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
}

.logo__img {
    max-height: 40px;
    width: auto;
    display: block;
}

.main-nav a {
    margin-left: 1.5rem;
    opacity: 0.9;
}

.main-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Page title */
.page-title {
    margin-top: 2rem;
    font-size: 1.75rem;
}

/* Category filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-filter a {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.category-filter a.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 3rem;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(36, 26, 23, 0.08);
}

.product-card__image {
    aspect-ratio: 1 / 1;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__placeholder {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.product-card__body {
    padding: 1rem;
}

.product-card__body h2 {
    font-size: 1rem;
    margin: 0 0 0.4rem;
}

.price {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.empty-state {
    color: var(--color-text-muted);
    padding: 2rem 0;
}

/* Product detail */
.product-detail {
    padding-bottom: 3rem;
}

.back-link {
    display: inline-block;
    margin: 1.5rem 0 1rem;
    color: var(--color-text-muted);
}

.product-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.product-gallery {
    min-width: 0;
    width: 100%;
}

.product-gallery__main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 65vh;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.product-gallery__main img,
.product-gallery__main video,
.product-gallery__main iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(36, 26, 23, 0.15);
    z-index: 2;
}

.gallery-arrow:hover {
    background: #fff;
}

.gallery-arrow--prev {
    left: 0.75rem;
}

.gallery-arrow--next {
    right: 0.75rem;
}

.product-gallery__thumbs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.gallery-thumb-btn {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    background: var(--color-surface);
}

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

.gallery-thumb-btn.active {
    border-color: var(--color-primary);
}

.gallery-thumb-btn--video {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--color-primary);
    background: var(--color-bg);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.lightbox.open {
    display: flex;
}

.lightbox-media {
    max-width: 100%;
    max-height: 100%;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
}

.product-detail__info {
    min-width: 0;
}

.product-detail__info h1 {
    margin-top: 0;
    font-size: 1.6rem;
}

.product-detail__info .price {
    font-size: 1.9rem;
    margin: 0.5rem 0 1rem;
}

.detailed-description {
    color: var(--color-text-muted);
    margin: 1rem 0;
}

.add-to-cart-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.option-group {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.option-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

.selected-option-name {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.selected-option-name::before {
    content: '—';
    margin-right: 0.5rem;
}

.selected-option-name:empty::before {
    content: '';
    margin-right: 0;
}

.color-swatches {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(36, 26, 23, 0.55);
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s ease;
}

.color-swatch.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
    transform: scale(1.15);
}

.size-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.size-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #000;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(36, 26, 23, 0.12);
    cursor: pointer;
    font-weight: 600;
    color: #000;
}

.size-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.add-to-cart-form input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.add-to-cart-form button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.add-to-cart-form button:hover {
    background: var(--color-primary-dark);
}

.out-of-stock {
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Cart indicator */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 1.2rem;
}

.cart-count {
    display: none;
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--color-accent);
    color: #241a17;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.cart-count.is-visible {
    display: flex;
}

/* Checkout */
.checkout {
    padding-bottom: 3rem;
}

.checkout__grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.checkout__section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout__section h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.checkout__section label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.checkout__section input[type="text"],
.checkout__section input[type="email"],
.checkout__section input[type="tel"],
.checkout__section textarea,
.checkout__section select {
    font-family: inherit;
    font-weight: 400;
    padding: 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.radio-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.6rem;
    font-weight: 400 !important;
    padding: 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.6rem !important;
    cursor: pointer;
}

.checkout__submit {
    width: 100%;
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.checkout__submit:hover {
    background: var(--color-primary-dark);
}

.checkout__summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.checkout__summary h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.summary-items {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    gap: 0.75rem;
}

.summary-item__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.9rem;
}

.summary-item__variant,
.summary-item__qty {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.summary-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    font-weight: 600;
    white-space: nowrap;
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-weight: 400;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0.35rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0.4rem 0 0;
}

/* Order confirmation */
.order-confirmation {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.order-confirmation__card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    max-width: 480px;
}

.order-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.03em;
}

.btn-continue {
    display: inline-block;
    margin-top: 1rem;
    background: var(--color-primary);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
}
