/* =========================
   1. BASE / RESET
   ========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
    color: #222;
    background: #f6f6f6;
}

/* Убираем визуальный мусор Prom */
[class*="bazooka"],
[class*="tg-"],
script[type="text/html"] {
    display: none !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1b7f3a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   2. LAYOUT
   ========================= */

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    background: #fff;
}

.content-line {
    margin: 32px 0;
}

/* =========================
   3. TOP BAR
   ========================= */

.b-head-control-panel {
    background: #2e7d32;
    color: #fff;
    font-size: 14px;
}

.b-head-control-panel__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.b-head-control-panel a {
    color: #fff;
    font-weight: 600;
}

/* =========================
   4. HEADER
   ========================= */

.header__table {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    flex-wrap: wrap;
}

.b-header-company-name__title {
    font-size: 1.25rem;
    margin: 8px 0 0;
}

.header-phones {
    text-align: right;
    font-size: 0.95rem;
}

/* =========================
   5. NAVIGATION
   ========================= */

.navigation-block {
    background: #388e3c;
}

.top-menu {
    display: flex;
    flex-wrap: wrap;
}

.top-menu__item {
    position: relative;
}

.top-menu__link {
    display: block;
    padding: 12px 16px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.top-menu__item:hover {
    background: #2e7d32;
}

/* Dropdown */
.top-menu__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #ddd;
    z-index: 100;
}

.top-menu__item:hover > .top-menu__dropdown {
    display: block;
}

.top-menu__dropdown-link {
    display: block;
    padding: 10px 14px;
    color: #222;
}

.top-menu__dropdown-link:hover {
    background: #f2f2f2;
}

/* =========================
   6. SEARCH
   ========================= */

.search-wrapper {
    padding: 16px 0;
    background: #fafafa;
}

.search__form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
}

.search__input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.search__button {
    width: 48px;
    border: none;
    background: #2e7d32;
    cursor: pointer;
}

/* =========================
   7. CATEGORY GRID
   ========================= */

.product-groups__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-groups__item-inner {
    border: 1px solid #e0e0e0;
    padding: 12px;
    background: #fff;
    transition: box-shadow .2s;
}

.product-groups__item-inner:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.product-groups__counter {
    background: #2e7d32;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}

.product-groups__title {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

/* =========================
   8. PRODUCT CARDS
   ========================= */

.b-product-line {
    border: 1px solid #ddd;
    padding: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.b-product-line__product-name {
    font-size: 0.95rem;
    margin: 8px 0;
}

.b-product-line__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #c62828;
}

.b-product-line__data {
    font-size: 0.8rem;
    color: #555;
}

.b-product-line__order-bar {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.b-button-colored {
    background: #2e7d32;
    color: #fff;
    padding: 8px 12px;
    border-radius: 3px;
    font-weight: 600;
}

.b-button-colored:hover {
    background: #1b5e20;
}

/* =========================
   9. ACCESSIBILITY
   ========================= */

:focus {
    outline: 2px solid #1b7f3a;
    outline-offset: 2px;
}

/* =========================
   10. MOBILE
   ========================= */

@media (max-width: 768px) {
    .header__table {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-menu {
        flex-direction: column;
    }

    .top-menu__dropdown {
        position: static;
        border: none;
    }
}
