*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #123024;
    background: #F5F9F7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* HEADER */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffffcc;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #E0EEE6;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.logo span {
    font-weight: 700;
    font-size: 20px;
    color: #1F6F3D;
}

.nav {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.nav a {
    padding: 6px 10px;
    border-radius: 999px;
    transition: 0.2s;
}

.nav a:hover {
    background: #E0F3E8;
}

.cart-toggle {
    border: none;
    background: #3BAA63;
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}

/* HERO */

.hero {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #E8F8EF, #FDFDFD);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-text h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1F6F3D;
}

.hero-text p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 999px;
    background: #3BAA63;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.btn:hover {
    background: #1F6F3D;
}

.btn-outline {
    background: #fff;
    color: #1F6F3D;
    border: 1px solid #3BAA63;
}

.btn-outline:hover {
    background: #E8F8EF;
}

/* FILTERS */

.filters {
    padding: 20px 0;
    border-bottom: 1px solid #E0EEE6;
    background: #F9FCFA;
}

.filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #C9E3D4;
    outline: none;
}

.search-group {
    flex: 1;
}

/* CATALOG */

.catalog {
    padding: 40px 0;
}

.catalog h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #1F6F3D;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.product-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.product-card img {
    border-radius: 12px;
    margin-bottom: 10px;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #f7f7f7;
}

.product-card h3 {
    font-size: 16px;
    margin: 0 0 6px;
}

.product-card .product-meta {
    font-size: 13px;
    color: #567;
    margin-bottom: 6px;
}

.product-card .product-price {
    font-weight: 700;
    color: #1F6F3D;
    margin-bottom: 8px;
}

.product-card .product-old-price {
    font-size: 13px;
    text-decoration: line-through;
    color: #999;
    margin-left: 6px;
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 10px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    overflow: auto;
    position: relative;
    padding: 16px;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
}

.modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
}

.modal-info h3 {
    margin-top: 0;
}

.modal-price {
    font-size: 18px;
    margin: 8px 0;
}

.modal-old-price {
    font-size: 14px;
    text-decoration: line-through;
    color: #999;
    margin-left: 8px;
}

/* CAROUSEL */

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carousel {
    position: relative;
    border-radius: 16px;
    background: #f7f7f7;
    overflow: hidden;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.carousel-track img {
    width: 100%;
    flex-shrink: 0;
    border-radius: 16px;
    cursor: zoom-in;
    object-fit: contain;
    min-height: 320px;
    max-height: 500px;
    height: auto;
    background: #f7f7f7;
    display: block;
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.35);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.25s ease;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover,
.next:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: translateY(-50%) scale(1.1);
}

/* THUMBNAILS */

.thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.thumbnails img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #f7f7f7;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.thumbnails img:hover {
    opacity: 0.85;
}

.thumbnails img.active {
    opacity: 1;
    border-color: #3BAA63;
}

/* LIGHTBOX */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 16px;
    box-shadow: 0 0 20px #000;
    cursor: zoom-out;
}

/* ORDER FORM */

.order-form {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #E0EEE6;
    font-size: 14px;
}

.order-form h4 {
    margin: 0 0 8px;
}

.order-form label {
    display: block;
    font-size: 12px;
    color: #567;
    margin-bottom: 3px;
}

.order-form input,
.order-form textarea {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #C9E3D4;
    margin-bottom: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.order-status {
    margin: 6px 0 0;
    font-size: 13px;
    min-height: 18px;
}

.order-status.success { color: #1F6F3D; }
.order-status.error   { color: #c0392b; }

/* REVIEWS */

.reviews {
    padding: 40px 0;
    background: #F9FCFA;
}

.reviews h2 {
    text-align: center;
    margin-bottom: 20px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.review-item {
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    font-size: 14px;
}

.review-item strong {
    display: block;
    margin-bottom: 4px;
}

.review-form {
    max-width: 500px;
    margin: 0 auto;
}

.review-form input,
.review-form textarea {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #C9E3D4;
    margin-bottom: 8px;
}

/* DELIVERY / ABOUT / CONTACTS */

.delivery,
.about,
.contacts {
    padding: 40px 0;
}

.delivery h2,
.about h2,
.contacts h2 {
    text-align: center;
    margin-bottom: 20px;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* CART */

.cart-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    z-index: 150;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 12px;
    border-bottom: 1px solid #E0EEE6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.cart-item img {
    width: 50px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-footer {
    padding: 10px 12px;
    border-top: 1px solid #E0EEE6;
    font-size: 14px;
}

/* CART ORDER FORM */

.cart-order-form {
    position: absolute;
    inset: 0;
    background: #fff;
    overflow-y: auto;
    z-index: 10;
}

.cart-order-form-inner {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-order-form-inner h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1F6F3D;
}

.cart-order-form-inner label {
    font-size: 12px;
    color: #567;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cart-order-form-inner input,
.cart-order-form-inner textarea {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #C9E3D4;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 4px;
}

.cart-order-form-inner textarea {
    min-height: 70px;
    resize: vertical;
}

/* FOOTER */

.footer {
    padding: 16px 0;
    border-top: 1px solid #E0EEE6;
    background: #F9FCFA;
    font-size: 13px;
    position: relative;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .nav {
        display: none;
    }

    .hero-text h1 {
        font-size: 26px;
    }
}
/* ADMIN WIDGET (шестерня у футері) */

.admin-widget {
    position: absolute;
    bottom: 10px;
    right: 16px;
}

.admin-widget-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #ccc;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.admin-widget-toggle:hover { color: #888; }

.admin-login-popup {
    position: absolute;
    bottom: 30px;
    right: 0;
    background: #fff;
    border: 1px solid #E0EEE6;
    border-radius: 10px;
    padding: 12px;
    width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 300;
}

.admin-login-popup input {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #C9E3D4;
    font-size: 12px;
}

.aw-btn {
    padding: 5px 10px;
    border-radius: 6px;
    background: #3BAA63;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
}

.aw-btn:hover { background: #1F6F3D; }
.aw-error { color: red; font-size: 11px; margin: 0; }

/* ADMIN MODAL */

.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.admin-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    margin: auto;
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E0EEE6;
}

.admin-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1F6F3D;
}

.admin-modal-close {
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

/* TABS */

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px 0;
    border-bottom: 1px solid #E0EEE6;
}

.admin-tab {
    padding: 7px 13px;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: #567;
    transition: 0.15s;
    border-bottom: 2px solid transparent;
}

.admin-tab:hover { background: #F0F9F4; }

.admin-tab.active {
    color: #1F6F3D;
    font-weight: 600;
    border-bottom-color: #3BAA63;
    background: #F0F9F4;
}

/* PANES */

.admin-tab-content {
    flex: 1;
    padding: 20px;
}

.admin-pane { display: none; }
.admin-pane.active { display: block; }

.admin-pane h3 {
    margin: 0 0 14px;
    color: #1F6F3D;
    font-size: 15px;
}

.admin-pane label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #567;
    margin: 10px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-pane input[type="text"],
.admin-pane input[type="file"],
.admin-pane textarea {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #C9E3D4;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.admin-pane textarea { min-height: 80px; }

.admin-hint {
    font-size: 12px;
    color: #888;
    margin: 0 0 12px;
}

.admin-btn {
    margin-top: 12px;
    padding: 8px 18px;
    border-radius: 8px;
    background: #3BAA63;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.admin-btn:hover { background: #1F6F3D; }

.admin-btn-primary {
    background: #1F6F3D;
    padding: 10px 22px;
    font-size: 14px;
}

.admin-status { font-size: 12px; color: #1F6F3D; margin: 6px 0 0; }

/* REVIEWS MODERATION */

.admin-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
}

.admin-review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    background: #F9FCFA;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.admin-review-item .ari-name { font-weight: 600; color: #1F6F3D; }
.admin-review-item .ari-text { color: #333; margin-top: 2px; }

.admin-review-del {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #e55;
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.admin-review-del:hover { color: #c00; }

/* FOOTER */

.admin-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid #E0EEE6;
    background: #F9FCFA;
    border-radius: 0 0 16px 16px;
}

.admin-save-note {
    font-size: 12px;
    color: #1F6F3D;
}
