/* Общие стили */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f4f5f7;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* <- Добавьте или исправьте эту строку */
}

a {
    text-decoration: none;
    color: #007bff;
}

h1, h2 {
    color: #2c3e50;
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
}

/* Шапка сайта */
header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* <- Добавьте это свойство */
}
.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.logo img {
    height: 80px; /* <- Основная настройка. Можете поменять это значение */
    width: auto;
    display: block; /* Убирает лишние отступы под картинкой */
}
header nav a {
    color: #555;
    margin-left: 20px;
    font-size: 16px;
}

/* Сетка карточек предложений */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Карточка предложения */
.offer-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.offer-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.offer-card-header img {
    width: 80px;
    height: auto;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
}
.offer-store-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}
.offer-discount {
    font-size: 22px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}
.offer-name {
    flex-grow: 1;
    margin-bottom: 15px;
}
.offer-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
}
.offer-meta .exclusive {
    color: #27ae60;
    font-weight: bold;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}
.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
}


/* Сетки для категорий и магазинов */
.grid {
    display: grid;
    gap: 15px;
}
.category-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.store-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-card, .store-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.category-card:hover, .store-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.category-card {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.store-card img {
    max-width: 100px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
}
.store-card strong {
    display: block;
    margin-bottom: 5px;
}

/* Модальное окно */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background: #fff; padding: 30px 40px; border-radius: 10px; position: relative; max-width: 500px; width: 90%; text-align: center; }
.close { position: absolute; top: 10px; right: 20px; font-size: 28px; cursor: pointer; color: #aaa; }
.promo-code-box { margin: 20px 0; display: flex; justify-content: center; gap: 10px; align-items: center; }
.promo-code { font-size: 24px; border: 2px dashed #007bff; padding: 10px 20px; border-radius: 6px; font-weight: bold; background: #f1f9ff; }
.copy-btn { padding: 10px 15px; background: #28a745; color: #fff; border: none; border-radius: 5px; cursor: pointer; }
.go-shop-btn { display: inline-block; margin-top: 20px; padding: 12px 24px; background: #007bff; color: white; text-decoration: none; border-radius: 5px; }
.go-shop-btn:hover { background: #0056b3; }

/* Футер */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

/* Стили для формы поиска */
.search-form {
    display: flex;
    flex-grow: 1; /* Позволяет форме занять доступное пространство */
    margin: 0 40px;
}
.search-form input[type="search"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    font-size: 16px;
    outline: none;
}
.search-form input[type="search"]:focus {
    border-color: #007bff;
}
.search-form button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    font-size: 16px;
    border-radius: 0 5px 5px 0;
}
.search-form button:hover {
    background-color: #0056b3;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}
.pagination a {
    color: #007bff;
    text-decoration: none;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.pagination a:hover {
    background-color: #f0f0f0;
}
.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

/* Новый стиль для кнопки "Перейти к акции" */
.btn-action {
    background-color: #28a745; /* Зеленый цвет */
    color: #fff;
}
.btn-action:hover {
    background-color: #218838; /* Более темный зеленый при наведении */
}