/* ================================================================
   AGRO SKIN для існуючого шаблону (класи НЕ змінені)
   Оригінал: темний авто-магазин → Світлий агро-магазин
   Дата: 2025-07-16
=================================================================== */

html {
                scroll-padding-top: 80px;
                /* висота твоєї шапки */
                scroll-behavior: smooth;
            }
            
            #catalog,
            #perevaga,
            #how-to-order {
                scroll-margin-top: 80px;
            }



            

/* 1) ХЕДЕР як flex-лайн, авто-адаптація логотипа і кнопки-кошика */

/*header {*/
/*    flex-wrap: wrap;*/
/*    gap: clamp(6px, 2vw, 18px);*/
/*}*/

/*header img[alt=""] {*/
/*    max-width: clamp(120px, 28vw, 240px) !important;*/
/*    height: auto !important;*/
/*}*/


/* 2) КНОПКА КОШИКА (замінює inline-width / margin) */

#openCartBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto !important;
    margin: 0 !important;
    padding: 0.65rem 1.1rem;
    font-size: clamp(0.9rem, 3.2vw, 1.05rem);
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #95d484;
    color: #000000;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
    white-space: nowrap;
}

#openCartBtn:hover {
    background: var(--brand);
}

#openCartBtn:active {
    transform: scale(0.94);
}

#openCartBtn #cart-counter {
    background: #fff;
    color: #4a8f2d;
    font-weight: 700;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    line-height: 1;
}




 @media (max-width: 768px) {
                .catalog {
                    display: grid;
                    grid-template-columns: repeat(2, 1fr);
                    /* 2 карточки в ряд */
                    gap: 20px;
                    /* відступи між картками */
                    padding: 5px 5px 20px 5px;
                }
            }


/* 3) ОВЕРЛЕЙ і ВІКНО КОШИКА (адаптивно, без правок HTML) */

#cartModal {
    justify-content: center !important;
    align-items: center !important;
    padding: 0 3vw;
    /* трішки відступ від краю */
}

#cartModal > div {
    
    
    /* 2. Твої оригінальні стилі */
    width: clamp(260px, 90vw, 420px) !important;
    background: #eef7e7 !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    
    /* 3. ДИНАМІКА: Скрол та адаптивна висота */
    overflow-y: auto;
    
    /* 100dvh — це реальна висота екрана, що враховує панелі браузера.
       Віднімаємо 160px (це приблизно 80px хедер + 80px твоя bottom-nav).
       Якщо кошик все одно торкається низу — просто збільш число 160.
    */
    max-height: calc(90dvh - 160px); 

    /* Щоб не було різких стрибків при появі панелей */
    transition: max-height 0.3s ease;
    
    /* Твій кошик має бути над усім контентом */
    z-index: 9999;
}

/* Прибираємо горизонтальний скрол, якщо він раптом з'явиться */
#cartModal > div {
    overflow-x: hidden;
}

#cartModal h2 {
    margin-top: 0;
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    text-align: center;
    color: #000000;
}

#cartModal h3 {
    margin: 0.6rem 0;
    font-size: 1rem;
    color: #000000;
}


/* універсальна кнопка всередині модалки */

#showFormBtn,
#order_form button[type="submit"] {
    font-family: "Comfortaa", "Montserrat", sans-serif;
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: clamp(0.95rem, 3.5vw, 1.15rem);
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #6cbf3f;
    color: #fff;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
}

#showFormBtn:hover,
#order_form button[type="submit"]:hover {
    background: #213b13;
}

#showFormBtn:active,
#order_form button[type="submit"]:active {
    transform: scale(0.96);
}

button[disabled] {
    opacity: 0.55;
    pointer-events: none;
}


/* форма та її поля */

#order_form {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

@keyframes formFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
    }
}

#order_form input[type="text"],
#order_form input[type="tel"] {
    width: 100%;
    margin-bottom: 0.8rem;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}


/* X-кнопка закриття */

#closeCart {
    position: absolute;
    top: 10px;
    right: 18px;
    width: 32px;
    height: 32px;
    background: #e53535;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    outline: none;
}

/* Малюємо лінії хрестика */
#closeCart::before,
#closeCart::after {
    content: '';
    position: absolute;
    width: 16px;          /* Довжина палички */
    height: 2px;          /* Товщина палички (зроби 1px, якщо треба ще тонше) */
    background-color: white;
    border-radius: 2px;
}

/* Повертаємо першу паличку на 45 градусів */
#closeCart::before {
    transform: rotate(45deg);
}

/* Повертаємо другу паличку на -45 градусів */
#closeCart::after {
    transform: rotate(-45deg);
}

/* Ефекти при наведенні */
#closeCart:hover {
    background: #ff4d4d;
    transform: rotate(90deg); /* Хрестик крутиться, а лінії залишаються рівними */
}

#closeCart:active {
    transform: scale(0.9);
}

/* приховуємо «Оформити замовлення», коли форма відкрита */

#order_form[style*="display: block"]+#showFormBtn {
    display: none;
}


/* 4) РОЗКЛАДКА NAV на ≥769 px (страхувальне правилo)

@media (min-width: 769px) {
    nav {
        display: flex !important;
    }
} */


/* ---- Палітра --------------------------------------------------- */

:root {
    --bg: #f5fff3;
    --bg-dark: #e9f7ed;
    --bg-card: #ffffff;
    --bg-card-dark: #eef8e9;
    --text: #1c1c1c;
    --text-light: #666;
    --text-invert: #fff;
    --brand: #197b04;
    --brand-dark: #0f5700;
    --accent: #ffb703;
    --accent-dark: #ff9b00;
    --discount: #ff416c;
    /* можна змінити на var(--accent) */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.16);
    --transition-fast: 0.25s;
}


/* ---- Глобальне ------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.6em;
    line-height: 1.2;
    font-weight: 700;
    color: var(--brand-dark);
}

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


/* лінки */

a {
    color: var(--brand-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand);
}


/* ---- Шапка ----------------------------------------------------- */

header {
    display: flex;
   
    justify-content: space-between;
    flex-wrap: nowrap;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(270deg, var(--brand-dark), #396730, #ffffff);
    position: sticky;
    top: 0;
    z-index: 2001;
    color: var(--text-invert);
}

header img {
    display: block;
    height: auto;
    max-height: 56px;
    width: auto;
}


/* ==== GRID OVERRIDES: адаптив каталогу ================================== */


/* базово – мобілка: 1 колонка */


/* ≥600px – 2 колонки */

@media (min-width: 600px) {
    .catalog {
        grid-template-columns: repeat(2, 1fr);

                padding: 10px;
        gap: 10px;
    }
}


/* ≥900px – 3 колонки */

@media (min-width: 900px) {
    .catalog {
        grid-template-columns: repeat(3, 1fr);
                padding: 10px;
        gap: 10px;
    }
    
}


/* ≥1200px – 4 колонки (те, що просив) */

@media (min-width: 1200px) {
    .catalog {
        grid-template-columns: repeat(4, 1fr);
        padding: 10px;
        gap: 10px;
    }
}

/* Контейнер всієї навігації */
/* #nav {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: sans-serif;
}

/* Заголовки "Насіння" та "Тип насіння" 
#nav p {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: #000;
    letter-spacing: 1px;
} */



/* бургер 

.burger {
    display: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-invert);
    line-height: 1;
}*/


/* мобільне меню */

/* @media (max-width: 768px) {
    nav {
        display: none;
        flex-direction: column;
        background: var(--brand-dark);
        position: absolute;
        top: 70px;
        right: 20px;
        padding: 20px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-card);
    }
    nav.show {
        display: flex;
    }
    .burger {
        display: block;
    }
} */


/* ---- Кнопка замовлення (глобальна) ----------------------------- */

.order-btn,
button[type="submit"],
.modal-content button,
.buy-btn,
.buy-button {
    background: var(--brand);
    color: #fff;
    border: 2px solid var(--brand);
    padding: 12px 25px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

/* Hover */
.order-btn:hover,
button[type="submit"]:hover,
.modal-content button:hover,
.buy-btn:hover,
.buy-button:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

/* Натискання */
.order-btn:active,
button[type="submit"]:active,
.modal-content button:active,
.buy-btn:active,
.buy-button:active {
    transform: scale(0.95);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Focus (доступність) */
.order-btn:focus-visible,
button[type="submit"]:focus-visible,
.modal-content button:focus-visible,
.buy-btn:focus-visible,
.buy-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* кнопка у картці */
.buy-btn {
    margin-top: 15px;
    width: 100%;
}

.buy-button {
    margin-top: 15px;
    width: 100%;
    display: inline-block;
    text-align: center;
}

/* ---------------------- */
/* СТАН "ДОДАНО В КОШИК" */
/* ---------------------- */

.buy-btn.is-added {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000;
    cursor: default;
    transform: none;
    box-shadow: 0 0 0 2px #000;
}

/* Вимикаємо hover / active для доданої кнопки */
.buy-btn.is-added:hover,
.buy-btn.is-added:active {
    background-color: #fff !important;
    color: #000 !important;
    transform: none;
    box-shadow: 0 0 0 2px #000;
}

/* Картка */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    color: var(--text);
    text-align: left;
    
    /* Твій Flexbox для картки */
    display: flex;
    flex-direction: column;
    height: 100%; 
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1; 
    padding: 15px;
}

/* 1. Тепер ЦЕЙ блок штовхає все, що нижче, до дна картки */
.card-content .price {
    margin-top: auto; /* Відштовхується від тексту опису зверху */
   
}

/* 2. Кнопка просто йде слідом за ціною */
.card-content .buy-btn {
    display: block;
    width: 100%;
    /* margin-top тут вже не потрібен, бо price спрацював як буфер */
}


.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card img {
    width: 100%;
    object-fit: cover;
}

.card-content {
    padding: 10px;
}

.title {
    /*font-size:1.4rem;*/
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--brand-dark);
}

.desc {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--text-light);
}

.scent {
    font-style: italic;
    margin-bottom: 10px;
    color: var(--accent-dark);
    font-size: smaller;
}


/* ціни */

.utp {
    background-color: var(--brand-dark);
    text-align: center;
    color: #ffffff;
    padding: 4px;
    font-size: 30px;
}

.price {
    font-size: 0;
}

.cina {
    margin-right: 10px;
    color: var(--brand-dark);
}

.price .old-price,
.price .new-price,
.price .cina {
    font-size: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.new-price {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--brand-dark);
}

.card .discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #000;
    padding: 5px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    z-index: 5;
    display: inline-block;
}





/* ---- HOW-TO-ORDER блок ----------------------------------------- */


/* Ми таргетуємо ID, бо в HTML інлайни; CSS перезапише (якщо прибрати inline) */

#how-to-order {
    background: var(--brand-dark);
    padding: 50px 20px;
    border-radius: var(--radius-lg);
    margin: 20px;
    color: #fff;
    text-align: center;
}

#how-to-order h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 50px;
    color: #fff;
}

.steps-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.step-item {
    flex: 1 1 200px;
    text-align: center;
}

.step-item img {
    width: 60px;
    margin: 0 auto 20px;
}

.step-item h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.step-item p {
    color: #d6f5d2;
    margin: 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .steps-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}


/* ---- Форма (lead-блоки зверху / знизу) ------------------------- */

.modal-content {
    background: var(--bg-card-dark);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    position: relative;
    color: var(--text);
    box-shadow: var(--shadow-card);
}

.modal-content h3,
.modal-content h4 {
    color: var(--brand-dark);
    margin-bottom: 12px;
    text-align: center;
}

.modal-content input {
    width: 100%;
    margin-top: 15px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid #cddcc9;
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
}

.modal-content input::placeholder {
    color: #999;
}

.modal-content button {
    margin-top: 18px;
    width: 94%;
}


/* ---- Модалка ---------------------------------------------------- */

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

.modal.is-open {
    display: flex;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--brand-dark);
}


/* ---- Footer ----------------------------------------------------- */

footer {
    text-align: center;
    padding: 30px 10px;
    font-size: 1rem;
    color: var(--text-light);
    border-top: 1px solid #dfe8db;
    background: var(--bg-dark);
}

footer p {
    margin: 0;
    color: var(--text-light);
}


/* ---- Центрований блок із політиками ---------------------------- */

center {
    /* лишаємо, бо є в HTML; краще перевести на div, але ти просив не міняти */
    display: flex;
    font-size: large;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text);
    gap: 4px;
}

center a {
    color: var(--brand-dark);
    font-weight: 600;
}

center a:hover {
    color: var(--brand);
}


/* ---- Мобільні корекції ----------------------------------------- */


/* @media (max-width:480px){
  header{padding:8px 12px;}
  nav a{font-size:1rem;}

  .card-content{padding:16px;}
  .title{font-size:1.25rem;}
  .new-price{font-size:1.4rem;}
  #how-to-order{margin:16px;padding:40px 16px;}
  #how-to-order h2{font-size:1.8rem;margin-bottom:32px;}
} */




.logo {
    font-family: "Comfortaa", "Montserrat", sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 2vw + 1rem, 2.75rem);
    margin: 0;
    line-height: 1;
    letter-spacing: 0.5px;
    color: #fff;
    /* на темному фоні шапки */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}


