/* Базовый сброс стилей, чтобы во всех браузерах выглядело одинаково */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    /* Отступ снизу, чтобы контент не перекрывался нижним меню */
    padding-bottom: 80px; 
}

/* --- ШАПКА --- */
.main-header {
    background: white;
    padding: 10px 15px;
    position: sticky; /* Прилипает к верху при скролле */
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.city-selector { cursor: pointer; }
.delivery-link { color: #0099cc; text-decoration: none; }

.search-input {
    width: 100%;
    padding: 10px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    font-size: 14px;
}

/* --- СЕТКА ТОВАРОВ --- */
.content {
    padding: 15px;
}

.product-grid {
    display: grid;
    /* Две колонки одинаковой ширины */
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 10px;
    position: relative; /* Чтобы позиционировать сердечко */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Заглушка для картинки */
.image-placeholder {
    width: 100%;
    height: 120px;
    background-color: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 10px;
    margin-bottom: 10px;
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
}

.price {
    font-weight: bold;
    color: #0099cc;
    margin-bottom: 5px;
    align-self: flex-start; /* Цена выровнена по левому краю внутри флекса */
}

.title {
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.3;
    align-self: flex-start;
    text-align: center;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #0099cc;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: auto; /* Прижимает кнопку к низу карточки */
}

.add-to-cart-btn:active {
    background-color: #007ba3;
}

/* --- СОЦСЕТИ --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px; /* Расстояние между кнопками */
    margin-bottom: 15px;
}

.social-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;       /* Размер кружка */
    height: 50px;
    background-color: #f0f2f5; /* Светло-серый фон */
    border-radius: 50%; /* Делает круг */
    transition: transform 0.2s;
}

/* Цвет иконок внутри */
.social-item svg {
    width: 28px;
    height: 28px;
    fill: #0099cc; /* Цвет как у кнопок "В корзину" */
}

/* Эффект при нажатии (немного сжимается) */
.social-item:active {
    transform: scale(0.95);
}


/* --- ПОДВАЛ --- */
/* --- ПОДВАЛ (Контакты) --- */
.main-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #888;
}

/* Общий контейнер для верхней части (Текст + Иконки) */
.footer-top {
    display: flex;
    justify-content: center; /* Центрируем весь блок */
    align-items: center;     /* Выравниваем по вертикали (по центру высоты) */
    gap: 60px;               /* Отступ между текстом и иконками */
    margin-bottom: 15px;
}

/* Текст (Телефон и Почта) */
.contact-text {
    text-align: right; /* Текст прижат к иконкам */
    display: flex;
    flex-direction: column; /* Друг под другом */
    justify-content: center;
}

.main-footer .phone {
    color: #0099cc;
    font-size: 14px;
    margin-bottom: 2px;
    font-weight: bold;
}

/* Цвет почты такой же, как у телефона */
.main-footer .email {
    color: #0099cc; 
    font-size: 13px;
}

/* Иконки соцсетей */
.social-links {
    display: flex;
    gap: 10px;
}

.social-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;       /* Размер кружка */
    height: 40px;
    background-color: #f0f2f5;
    border-radius: 50%;
    text-decoration: none;
}

.social-item svg {
    width: 24px;
    height: 24px;
    fill: #0099cc; /* Синий цвет иконок */
}

.main-footer .disclaimer {
    margin-top: 15px;
    font-size: 10px;
    line-height: 1.4;
    opacity: 0.7;
}

/* --- НИЖНЕЕ МЕНЮ --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #eee;
    z-index: 200;
}

.nav-item {
    text-decoration: none;
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    position: relative;
}

.nav-item.active { color: #333; }
.nav-item .icon { font-size: 20px; margin-bottom: 2px; }

/* Красный кружок над корзиной */
.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e91e63;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* --- СТИЛИ ДЛЯ КОРЗИНЫ --- */
.cart-page h1 {
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Карточка товара в корзине */
.cart-item {
    display: flex;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    position: relative;
    align-items: flex-start;
}

/* Картинка в корзине - ИСПРАВЛЕННАЯ */
.cart-img {
    width: 60px;
    height: 60px;
    background: #fff; /* Белый фон, чтобы прозрачные картинки выглядели хорошо */
    border-radius: 8px;
    margin-right: 15px;
    object-fit: contain; /* Самое важное: картинка не будет искажаться */
    border: 1px solid #eee; /* Тонкая рамка для красоты */
}

/* Информация о товаре */
.cart-info {
    flex: 1;
}
.cart-price {
    color: #0099cc;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}
.cart-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
}
.cart-brand {
    color: #999;
    font-size: 12px;
}

/* Кнопки управления количеством (- 1 +) */
.cart-controls {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.counter-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #0099cc;
    background: white;
    color: #0099cc;
    border-radius: 6px;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.counter-value {
    margin: 0 15px;
    font-size: 14px;
    font-weight: bold;
}

/* Кнопка удаления (мусорка) */
.delete-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #eee;
    background: white;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    cursor: pointer;
}

/* БЛОК ИТОГО */
.cart-summary {
    margin-top: 20px;
    padding-top: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 20px;
}

/* Большая синяя кнопка */
.checkout-btn {
    width: 100%;
    background-color: #0099cc;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
.checkout-btn:hover {
    background-color: #0088b5;
}



/* --- СТИЛИ СТРАНИЦЫ ТОВАРА (Product Page) --- */
.product-page {
    padding: 20px;
}

.product-header-row {
    display: flex;
    align-items: center;
    gap: 10px; /* Расстояние между заголовком и ссылкой */
    margin-bottom: 15px;
    flex-wrap: wrap; /* Чтобы на маленьких экранах переносилось */
}

.product-header-row h1 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.back-link {
    color: #0099cc;
    text-decoration: none;
    font-size: 14px;
}

/* Большая картинка */
.product-main-image {
    width: 100%;
    height: 300px;
    background-color: #f4f6f8; /* Светлый фон как на скрине */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-bottom: 20px;
}

/* Цена и информация */
.product-pricing {
    margin-bottom: 20px;
}

.big-price {
    font-size: 22px;
    font-weight: bold;
    color: #0099cc;
    margin-bottom: 8px;
}

.sub-info {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Большая кнопка купить */
.add-to-cart-large {
    width: 100%;
    background-color: #0099cc;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 25px;
}

.add-to-cart-large:active {
    background-color: #007ba3;
}

/* Блок описания */
.product-description h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-description p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.product-description ul {
    list-style-type: disc; /* Точки */
    padding-left: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.small-note {
    font-size: 12px;
    color: #888;
    margin-top: 20px;
}

/* Активное состояние кнопки Избранное */
.wishlist-btn.active {
    color: black !important; /* Делает сердечко черным */
    font-weight: bold;
}

/* --- МОДАЛЬНОЕ ОКНО (ГОРОД) --- */
.modal-overlay {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Затемнение фона */
    z-index: 1000; /* Поверх всего */
    justify-content: center;
    align-items: flex-start; /* Окно будет сверху, а не по центру высоты */
    padding-top: 50px;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-height: 80vh; /* Чтобы не вылезало за экран на маленьких телефонах */
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: bold;
}

.close-modal {
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    padding: 0 5px;
}
.close-modal:hover { color: #333; }

.modal-search-wrapper {
    margin-bottom: 15px;
}

.modal-search-wrapper input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.modal-search-wrapper input:focus {
    border-color: #0099cc;
}

/* Список городов */
.city-list {
    list-style: none;
    padding: 0;
    overflow-y: auto; /* Прокрутка, если список длинный */
}

.city-list li {
    padding: 10px 5px;
    cursor: pointer;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.city-list li:hover {
    background-color: #f9f9f9;
    color: #0099cc;
}


/* --- СТРАНИЦА КОНТАКТЫ --- */
.contact-card-list {
    background: white;
    border-radius: 15px;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 400px;
    margin: 0 auto 40px auto; /* Центрируем блок */
    text-align: left;
}

.contact-row {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.contact-row:last-child {
    border-bottom: none;
}

.c-icon {
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; /* Для эмодзи */
    width: 24px;
}

.c-text {
    font-weight: 500;
}

/* --- СТРАНИЦА О ДОСТАВКЕ --- */
.text-page h1 {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 25px;
}

.text-block {
    margin-bottom: 25px;
}

.text-block h2 {
    color: #0099cc;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.text-block p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #333;
}