:root {
    --tg-bg: #faf7f5;
    --tg-text: #333;
    --tg-hint: #888;
    --tg-link: #d4536a;
    --tg-button: #d4536a;
    --tg-button-text: #fff;
    --tg-secondary-bg: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff !important;
    color: var(--tg-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
header {
    background: var(--tg-secondary-bg);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 14px 0;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tg-link);
    text-decoration: none;
}

/* Main */
main {
    flex: 1;
    padding: 20px 16px 100px;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--tg-text);
}

/* Categories */
.categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cat-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--tg-secondary-bg);
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--tg-hint);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cat-btn:hover,
.cat-btn.active {
    background: var(--tg-button);
    color: var(--tg-button-text);
    border-color: var(--tg-button);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.product-card:active {
    transform: scale(0.97);
}

.product-img {
    height: 160px;
    background: #f0e8e4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    color: #bbb;
    font-size: 0.9rem;
}

.product-info {
    padding: 12px;
}

.product-info h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tg-link);
}

/* Product Detail */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--tg-hint);
}

.breadcrumb a {
    color: var(--tg-link);
    text-decoration: none;
}

.product-detail {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.product-detail-img {
    width: 100%;
    height: 280px;
    background: #f0e8e4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-info {
    padding: 20px;
}

.product-detail-info h1 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.price-big {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--tg-link);
    margin-bottom: 16px;
}

.description {
    color: var(--tg-hint);
    line-height: 1.5;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Photo Gallery */
.product-gallery {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s;
}

.gallery-thumb.active {
    border-color: var(--tg-button);
    opacity: 1;
}

/* Order Form (Mini App) */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--tg-bg);
    color: var(--tg-text);
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--tg-button);
}

.input-field::placeholder {
    color: var(--tg-hint);
}

.btn-order {
    display: inline-block;
    padding: 14px 36px;
    background: var(--tg-button);
    color: var(--tg-button-text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: opacity 0.2s;
    text-align: center;
}

.btn-order:active {
    opacity: 0.8;
}

.empty {
    text-align: center;
    color: var(--tg-hint);
    padding: 60px 0;
    font-size: 1rem;
}

/* Footer hidden in Mini App */
footer {
    display: none;
}

/* Desktop */
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .product-img {
        height: 220px;
    }

    .product-detail {
        display: flex;
    }

    .product-detail-img {
        width: 400px;
        height: auto;
        min-height: 350px;
        flex-shrink: 0;
    }

    footer {
        display: block;
        background: var(--tg-secondary-bg);
        border-top: 1px solid rgba(0,0,0,0.06);
        padding: 20px 0;
        text-align: center;
        color: var(--tg-hint);
        font-size: 0.9rem;
    }
}
