/* ============================================
   Base Styles - Typography & Foundations
   ============================================ */

/* Body */
body {
    font-family: var(--font-main);
    font-size: var(--text-base);
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.5;
}

/* Кольцо фокуса. Правило жило в src/css/main.css, который не был
   подключён ни к одной странице, — то есть своего кольца у сайта не было
   вовсе, рисовало только браузерное. base.css доезжает до всех страниц
   цепочкой @import, поэтому правило переехало сюда. */
:focus-visible {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

::selection {
    background-color: var(--primary-purple);
    color: var(--bg-white);
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Section */
section {
    padding: var(--section-padding);
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-h2);
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Typography Utilities */
.italic-accent {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

.script-text {
    font-family: var(--font-script);
    font-weight: 400;
    font-style: italic;
}

.handwritten {
    font-family: var(--font-script);
    font-size: 1.4em;
    font-weight: 400;
}

.italic-serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

/* Section Headers */
.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    margin-bottom: 20px;
}

.section-header p {
    max-width: 800px;
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: 40px;
    line-height: var(--leading-tight);
}

/* Text utilities */
.text-gray { color: var(--text-gray); }
.text-light { color: var(--text-light); }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--primary-purple); }
.text-center { text-align: center; }

/* ============================================
   Links
   ============================================ */

a:hover {
    color: var(--primary-purple);
}

/* ============================================
   Badge Styles
   ============================================ */

.badge {
    padding: 4px 8px;
    border-radius: var(--radius-xl);
    font-size: var(--text-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge--pink {
    background-color: var(--accent-pink);
    color: white;
}

.badge--purple {
    background: var(--bg-badge-purple);
    color: #6b21a8;
}

.badge--green {
    background: var(--bg-badge-green);
    color: #065f46;
}

.badge--red {
    background: var(--bg-badge-red);
    color: #991b1b;
}

.badge--blue {
    background: var(--bg-badge-blue);
    color: #1e40af;
}

.badge--discount {
    background: var(--badge-pink);
    color: #fff;
}

.discount-badge {
    background: var(--accent-pink);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   Price Styles
   ============================================ */

.current-price {
    color: var(--primary-purple);
    font-weight: 700;
    font-size: var(--text-lg);
}

.old-price {
    text-decoration: line-through;
    color: var(--text-strikethrough);
    font-size: var(--text-sm);
}

.price-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 8px;
}

html[lang="ru"] .price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

html[lang="ru"] .old-price {
    text-decoration: none;
    color: var(--text-light);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.3;
}

/* ============================================
   Grid Systems
   ============================================ */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* ============================================
   Responsive Media Queries
   ============================================ */

@media (max-width: 1024px) {
    .section-title {
        font-size: 2rem;
    }
    
    h1 {
        font-size: var(--text-4xl);
    }
    
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    section {
        padding: 30px 0;
    }

    .section-title {
        font-size: calc(var(--text-3xl) * 0.95);
    }

    h1 {
        font-size: calc(var(--text-4xl) * 0.95);
    }

    h2 {
        font-size: calc(var(--text-3xl) * 0.95);
    }

    h3 {
        font-size: calc(var(--text-2xl) * 0.95);
    }

    h4 {
        font-size: calc(var(--text-xl) * 0.95);
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: calc(var(--text-h2) * 0.95);
    }

    h1 {
        font-size: calc(var(--text-h2) * 0.95);
    }

    h2 {
        font-size: calc(var(--text-3xl) * 0.95);
    }

    h3 {
        font-size: calc(var(--text-2xl) * 0.95);
    }

    h4 {
        font-size: calc(var(--text-xl) * 0.95);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}
