/* ===================== СБРОС И БАЗОВАЯ СТИЛИСТИКА ===================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

@font-face {
    font-family: 'CirceRoundedAltBold';
    src: url('/static/fonts/CirceRounded-AltBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'CirceRoundedExtraLight';
    src: url('/static/fonts/CirceRounded-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'CirceRoundedRegular';
    src: url('/static/fonts/CirceRounded-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CirceRoundedRegularAlt2';
    src: url('/static/fonts/CirceRounded-Regular2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CirceRoundedRegularAlt3';
    src: url('/static/fonts/CirceRounded-Regular3.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'CirceRoundedRegular';
    background-color: white;
}

h1 {
    font-family: 'CirceRoundedAltBold';
}

.light-text {
    font-family: 'CirceRoundedExtraLight';
}

:root {
    --hover-color: #b4008c;
    --main-color: #00c3b4;
    --main-color-hover: #02c5b5;
}

/* ===================== ОСНОВНОЙ КОНТЕЙНЕР ===================== */
main {
    max-width: 1450px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: 'CirceRoundedRegular';
    background-color: #fff;
}

/* ===================== ШАПКА (header) И ВЕРХНЯЯ НАВИГАЦИЯ ===================== */
header {
    background-color: #fff;
    margin-bottom: 5px;
}
header > div,
.top-nav {
    max-width: 1450px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.logo-container img {
    display: block;
    margin-left: 20px;
}

.pharmacy-network {
    color: #888;
    font-size: 18px;
    margin-right: auto;
}

.selected-pharmacy {
    display: flex;
    align-items: left;
    margin-right: 200px;
}
.selected-pharmacy select {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: inherit;
    font: inherit;
    outline: none;
}
.selected-pharmacy select:focus {
    outline: none;
    border: none;
    box-shadow: none;
}
.selected-pharmacy select:hover {
    color: var(--main-color);
}

.header-phone {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-left: auto;
    white-space: nowrap;
}

.top-nav {
    border-radius: 6px;
    margin-bottom: 10px;
}
.top-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.top-nav a {
    text-decoration: none;
    color: grey;
    font-weight: bold;
    transition: color 0.2s ease;
}
.top-nav a:hover {
    color: var(--hover-color);
}

/* ===================== ПОИСКОВАЯ СТРОКА ===================== */
.search-area {
    max-width: 1450px;
    margin: 20px auto 30px auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #ffffff;
    border: 2px solid var(--main-color);
    border-radius: 6px;
    overflow: hidden;
}
.parameters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #80808014;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    color: #555;
    font-weight: bold;
    height: 50px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.parameters-btn svg {
    margin-right: 5px;
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.parameters-btn:hover {
    background-color: var(--hover-color);
    color: #fff;
}
.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-btn {
    background: var(--main-color);
    border: none;
    color: #fff;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    height: 50px;
    transition: background-color 0.2s ease;
}
.search-btn:hover {
    background-color: var(--main-color-hover);
}

.search-suggestions {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    z-index: 99;
    max-height: 250px;
    overflow-y: auto;
}
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}
.suggestion-item:hover {
    background: #f9f9f9;
    cursor: pointer;
}
.suggestion-thumb {
    width: 30px;
    height: 30px;
    object-fit: cover;
    margin-right: 8px;
}

/* ===================== КАРУСЕЛЬ ===================== */
.carousel-container {
    max-width: 1450px;
    margin: 0 auto 20px auto;
    position: relative;
}
.carousel-slide {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.carousel-slide img {
    width: 100%;
    object-fit: cover;
    display: block;
}
.carousel-caption {
    position: absolute;
    top: 50%;
    left: 20px;
    background: rgb(255, 255, 255) !important;
    padding: 10px 15px;
    border-radius: 4px;
    transform: translateY(-50%);
}
.carousel-caption a {
    display: inline-block;
    text-decoration: none;
    color: var(--main-color);
    font-weight: bold;
    border: 1px solid var(--main-color);
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.carousel-caption a:hover {
    background-color: var(--main-color-hover);
    color: #fff;
}

/* ===================== КАТЕГОРИИ ===================== */
.categories {
    max-width: 1450px;
    margin: 0 auto 40px auto;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
}
.categories h2 {
    margin-bottom: 15px;
    font-size: 24px;
    color: #333;
}
.categories > ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-link {
    color: #006064;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}
.category-link:hover {
    color: var(--hover-color);
}
.subcategory-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 10;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.subcategory-dropdown li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    line-height: 1.4;
}
.subcategory-dropdown li:last-child {
    border-bottom: none;
}
.subcategory-dropdown a {
    color: #333;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}
.subcategory-dropdown a:hover {
    color: var(--hover-color);
    background-color: transparent;
}
.categories > ul > li:nth-last-child(1):nth-child(3n+1) {
    grid-column: 1 / -1;
}

/* ===================== ТОВАРЫ (products-block) ===================== */
.products-block {
    max-width: 1450px;
    margin: 0 auto 30px auto;
    background: #ffffff85;
}
.products-block h2 {
    margin-bottom: 15px;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.product-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 430px;
    padding: 12px;
    position: relative;
}
.product-card:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}
.product-card img {
    width: 214px;
    height: 214px;
    object-fit: cover;
    margin: 0 auto 10px auto;
    display: block;
}
.product-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 15px;
    color: #333;
}
.manufacturer {
    margin: 2px 0;
    font-size: 14px;
    color: #666;
}
.price {
    color: #d32f2f;
    font-weight: bold;
    margin-top: 5px;
    font-size: 16px;
}
.stock {
    font-size: 14px;
    margin: 5px 0;
    color: #444;
}
.add-to-cart {
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: 90%;
    padding: 8px 15px;
    border: 2px solid var(--main-color-hover);
    background-color: transparent;
    color: var(--main-color-hover);
    text-align: center;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.add-to-cart:hover {
    background-color: var(--hover-color);
    color: #fff;
    border-color: var(--hover-color);
}

/* ===================== БЛОК "О НАШЕЙ АПТЕКЕ" (about-block) ===================== */
.about-block {
    max-width: 1450px;
    margin: 20px auto 40px auto;
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
    line-height: 1.6;
}
.about-block h2 {
    margin-bottom: 15px;
    font-size: 24px;
    color: #333;
}
.about-block p {
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
}
.about-block .about-btn {
    display: inline-block;
    background: var(--main-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    margin-top: 10px;
    text-decoration: none;
}
.about-block .about-btn:hover {
    background-color: var(--main-color-hover);
}

/* ===================== БЛОК ПРЕИМУЩЕСТВ (advantages-block) ===================== */
.advantages-block {
    max-width: 1450px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.adv-card {
    width: 23%;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
}
.adv-card:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
.adv-card img {
    max-width: 60px;
    margin-bottom: 10px;
}

/* ===================== ФИЛЬТР (NEW) ===================== */
.filter-block {
    max-width: 1450px;
    margin: 0 auto 20px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}
.filter-header {
    background: var(--main-color);
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filter-header-title {
    font-size: 18px;
}
.filter-group {
    margin-bottom: 15px;
}
.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}
.filter-group input[type="number"],
.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease;
}
.filter-group input:hover,
.filter-group select:hover {
    border-color: var(--main-color);
}
.filter-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}
.filter-show-btn {
    background: var(--main-color);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.filter-show-btn:hover {
    background-color: var(--main-color-hover);
}
.filter-reset-btn {
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.filter-reset-btn:hover {
    background-color: var(--main-color-hover);
    color: #fff;
    border-color: var(--main-color-hover);
}

/* ===================== FOOTER ===================== */
footer {
    background-color: #f4f4f4;
    padding: 20px;
}
.footer-top {
    max-width: 1450px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
    flex-direction: row;
}
.footer-contacts, .footer-links {
    min-width: 200px;
    color: #333;
    font-size: 14px;
}
.footer-contacts ul,
.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links p {
    font-weight: bold;
    margin-bottom: 8px;
}
.footer-links a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
    display: inline-block;
    margin-bottom: 6px;
}
.footer-links a:hover {
    color: var(--hover-color);
}
.footer-bottom {
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

/* ===================== АДАПТИВ ПОД ТЕЛЕФОН ===================== */
@media (max-width: 768px) {
    header > div,
    .logo-container {
        flex-direction: column;
        align-items: center;
    }
    .logo-container {
        margin-top: 0;
        gap: 5px;
        width: 100%;
    }
    .pharmacy-network {
        margin-right: 0;
    }
    .selected-pharmacy {
        margin-left: 0;
        margin-top: 5px;
    }
    .header-phone {
        margin: 10px 0 0 0;
    }
    .top-nav {
        padding: 10px;
    }
    .top-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .search-area {
        flex-direction: column;
        align-items: stretch;
    }
    .parameters-btn {
        border-right: none;
        border-bottom: 1px solid var(--main-color);
        width: 100%;
        justify-content: flex-start;
    }
    .search-input-container {
        width: 100%;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-card {
        height: auto;
        padding: 10px;
    }
    .product-card img {
        width: 100%;
        height: auto;
        max-width: 180px;
    }
    .advantages-block {
        gap: 15px;
    }
    .adv-card {
        width: 47%;
        padding: 5px;
    }
    .categories > ul {
        grid-template-columns: 1fr;
    }
    .filter-body {
        display: flex;
        flex-direction: column;
    }
    .filter-buttons {
        flex-direction: row;
        gap: 10px;
        justify-content: flex-start;
    }
    .filter-show-btn, .filter-reset-btn {
        flex: none;
    }
}

/* ===================== СТИЛИ ПАГИНАЦИИ ===================== */
.pagination-block {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    align-items: center;
    justify-content: center;
}
.pagination-block a {
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.pagination-block a:hover {
    background-color: var(--main-color-hover);
    color: #fff;
    border-color: var(--main-color-hover);
}
.active-page {
    font-weight: bold;
    color: #fff;
    background-color: var(--main-color);
    border: 1px solid var(--main-color);
    padding: 5px 10px;
    border-radius: 4px;
}
.pag-dots {
    padding: 5px 10px;
    color: #999;
}

/* ===================== STYLES FOR PRODUCT DETAIL PAGE ===================== */
.product-title {
    font-size: 24px;
    margin: 15px 0;
    color: #333;
}
.product-detail {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.product-detail-img img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.product-detail-info {
    flex: 1;
}
.product-description-block {
    margin-top: 20px;
}
.product-description-block h3 {
    font-size: 20px;
    margin-bottom: 10px;
}
.product-description-block pre {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.5;
    color: #444;
}
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        align-items: center;
    }
    .product-detail-img img {
        width: 200px;
        height: auto;
        margin-bottom: 10px;
    }
    .product-detail-info {
        width: 100%;
    }
}

/* ===================== STYLES FOR BREADCRUMBS ===================== */
.breadcrumbs {
    font-size: 14px;
    margin-bottom: 15px;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.breadcrumbs a {
    text-decoration: none;
    color: #00796b;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #b4008c;
    text-decoration: underline;
}

.breadcrumbs-separator {
    color: #ccc;
    margin: 0 5px;
    user-select: none;
}

.breadcrumbs .current-crumb {
    font-weight: bold;
    color: #333;
}
