@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Inter.woff2') format('woff2');
}

:root {
    --warm-bg: #fff3d6;
    --warm-card: #fff3d6;
    --text-main: #5d4037;
    --accent: #d4a373;
    --soft-shadow: 0 10px 30px rgba(22, 15, 13, 0.2);
    --shadow: 0 10px 30px rgba(22, 15, 13, 0.3);
    --ozon: #005bff;
    --wb: #cb11ab;
    --yandex: #ffcc00;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 10px;
    font-family: "Inter", sans-serif;
    background-color: var(--warm-bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

/* Шапка */
header {
    padding: 20px 0 20px;
    text-align: center;
}

.logo-container {
    display: flex;
    justify-content: center
}

.logo-img {
    max-width: 400px;
    width: 100%;  
    height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
} 

.logo {
    font-size: 2.5rem;
    font-style: italic;
} 

.social-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
}

.social-link {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.social-link svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.social-link.tg {
    color: #0088cc;
}

.social-link.yt {
    color: #ff0000;
}

.social-link.ig {
    color: #d62976;
}

.social-link:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* Главный блок текста */
.hero {
    text-align: center;
    padding: 20px 20px 60px 20px
}

.hero p {
    max-width: 100%; 
    margin: 0 auto;
    opacity: 0.85;
    font-size: 1.2rem;
    white-space: pre-line;
    text-align: center;
}

/* Секция каталога */
.catalog-section {
    padding-bottom: 60px;
}

.catalog-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 50px;
    font-weight: 400;
    position: relative;
}

.catalog-title::after {
    content: "________";
    display: block;
    font-size: 1.5rem;
    color: var(--accent);
    margin-top: -10px;
    opacity: 0.5;
}

/* Сетка изделий */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.card {
    background: var(--warm-card);
    border-radius: 24px;
    padding: 12px;
    box-shadow: var(--soft-shadow);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
   box-shadow: var(--shadow);
}

.card-img-container {
    width: 100%;
    aspect-ratio: 1/1.33;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #eeeae0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card h3 {
    font-weight: normal;
    margin: 0 0 10px;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.price-tag {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: block;
}

.btn-buy {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
    padding: 12px 30px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-buy:hover {
    background: none;
    color: var(--accent);
}

/* Модальное окно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(93, 64, 55, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10000;
    /* Разрешаем скролл внутри оверлея, а не окна */
    overflow-y: auto;
    align-items: flex-start; /* Окно начинается сверху */
    justify-content: center;
    padding: 40px 20px;
}

.modal {
    background: var(--warm-card);
    padding: 20px;
    border-radius: 30px;
    max-width: 900px;
    width: 100%;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(212, 163, 115, 0.2);
    margin: auto 0; /* Центрируем, если контента мало, но позволяем расти */
    max-height: none; 
    overflow: visible; 
}

.modal-body {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.modal-image-container {
    aspect-ratio: 1/1.33;
    border-radius: 20px;
    overflow: hidden;
    background: #eeeae0;
    max-width: 350px;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal h2 {
    font-size: 1.2rem;
    margin: 0 40px 15px 0;
    line-height: 1.2;
    color: var(--text-main);
}

.modal .description-header {
    font-size: 1rem;
    margin: 0 0 8px 0;
    font-weight: 700;
    opacity: 0.9;
}

.modal .description {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.market-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.market-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 32px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
    background-color: var(--accent);
    color: white;
    flex: 1;
    max-width: 300px;
}

.market-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: var(--shadow);
}

.close-modal {
    position: absolute;
    top: 12px; 
    right: 12px;
}

.close-modal-btn:hover { 
    background: var(--accent);
}

.close-modal-btn {
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 100;
    background: var(--warm-card);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--soft-shadow);
    transition: 0.3s;
    color: var(--text-main);
    border: none;
}

.close-modal-btn:hover { 
    background: var(--accent);
}

/* Футер */
footer {
    text-align: center;
    border-top: 1px solid rgba(212, 163, 115, 0.2);
    font-size: 0.85rem;
    opacity: 0.6;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-80px) scale(0); opacity: 0; }
}

@media (max-width: 850px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal-overlay {
        padding: 0;
        background: var(--warm-card);
    }
    .modal {
        height: 100%;
        border-radius: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }
    .modal-body {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        flex: 1;
    }
    .modal-image-container {
        max-width: 100%;
        width: 100%;
        aspect-ratio: 1 / 1.33;
        border-radius: 0 0 20px 20px;
    }
    .modal h2 {
        margin: 0;
        font-size: 1.6rem;
        text-align: center;
    }

    .modal .description {
        padding: 10px 20px 10px 20px;
    }

    .modal-content-container {
        width: 100%;
    }
    .modal-footer{
        width: 100%;
        position: sticky;
        bottom: 0;
        left: 0;
    }
    .market-buttons{
        padding: 20px;
        background: var(--warm-card);
        box-shadow: 0 10px 30px rgba(22, 15, 13, 0.5);
        border-radius: 20px 20px 0 0;
    }
    .market-btn {
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 5px;
        min-height: 42px;
    }
    .close-modal {
        position: sticky;
        top: 0;
        right: 0;
        height: 0;
        display: flex;
        justify-content: flex-end;
    }
    .close-modal-btn {
        margin-top: 10px;
        margin-right: 10px;
    }
}

@media (max-width: 600px) {
    .logo { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .catalog-title { font-size: 2rem; }
}