:root {
    --bg: #ffffff;
    --text: #000000;
    --accent: #f2f2f2;
}

* { box-sizing: border-box; transition: 0.2s ease-in-out; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Helvetica', sans-serif;
    margin: 0;
    scroll-behavior: smooth;
}

header {
    padding: 30px;
    border-bottom: 1px solid #000;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
}

nav { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: 900; letter-spacing: 5px; }
.logo span { color: #888; }

nav ul { list-style: none; display: flex; gap: 30px; margin: 0; }
nav a { text-decoration: none; color: #000; text-transform: uppercase; font-size: 12px; letter-spacing: 2px; }

section { padding: 100px 5%; max-width: 1200px; margin: auto; }
.section-title { text-align: center; text-transform: uppercase; letter-spacing: 10px; margin-bottom: 50px; }

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product {
    padding: 20px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.product:hover { border-color: #000; }

.badge { font-size: 10px; text-transform: uppercase; color: #888; margin-bottom: 10px; }
.desc { font-size: 14px; color: #555; margin-bottom: 15px; flex-grow: 1; }
.price { font-size: 20px; font-weight: bold; margin-bottom: 15px; display: block; }

/* Кнопки */
.product-btns { display: flex; gap: 10px; }
button {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 12px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    flex: 1;
}

.info-btn { background: #fff; color: #000; }
button:hover { background: #333; color: #fff; }
.info-btn:hover { background: #f0f0f0; color: #000; }

/* Кошик */
#cart-section { background: var(--accent); }
.cart-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #ddd; }
.remove-btn { color: red; cursor: pointer; font-size: 12px; }
.total { font-size: 24px; font-weight: bold; margin: 20px 0; text-align: right; }

.form-group { display: flex; gap: 10px; }
input { padding: 15px; border: 1px solid #ccc; margin-bottom: 15px; width: 100%; }

/* МОДАЛЬНЕ ВІКНО */
.modal {
    position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: #fff; padding: 50px; max-width: 600px; width: 90%;
    position: relative; text-align: left; line-height: 1.6;
}
.modal-content h2 { margin-top: 0; letter-spacing: 2px; text-transform: uppercase; }
.close-modal {
    position: absolute; right: 20px; top: 15px;
    font-size: 35px; cursor: pointer; color: #888;
}
.close-modal:hover { color: #000; }

.hidden { display: none; }

footer { background: #000; color: #fff; padding: 50px 5%; }
.footer-content { display: flex; gap: 50px; }

/* Контейнер для слайдера */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
}

.products-wrapper {
    overflow-x: auto; /* Дозволяє гортати мишкою або пальцем */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory; /* "Прилипання" карток при гортанні */
    scrollbar-width: none; /* Приховуємо смугу прокрутки (Firefox) */
}

.products-wrapper::-webkit-scrollbar {
    display: none; /* Приховуємо смугу прокрутки (Chrome/Safari) */
}

.products {
    display: flex; /* Тепер товари в один ряд */
    gap: 20px;
}

.product {
    min-width: calc(33.333% - 14px); /* Рівно 3 товари на екрані */
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Стрілки навігації */
.nav-btn {
    background: #000;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.prev { left: -50px; }
.next { right: -50px; }

.nav-btn:hover { background: #333; }

/* Адаптивність: 2 товари на планшетах, 1 на телефонах */
@media (max-width: 1024px) {
    .product { min-width: calc(50% - 10px); }
    .prev, .next { display: none; } /* На мобільних краще гортати пальцем */
}

@media (max-width: 600px) {
    .product { min-width: 100%; }
}

/* Контейнер тепер має дозволяти кнопкам виходити за межі основної ширини */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1300px; /* Трохи більше за ширину товарів, щоб був простір для кнопок */
    margin: 0 auto;
}

.products-wrapper {
    width: 100%;
    overflow: hidden;
    scroll-behavior: smooth;
    padding: 10px; /* Невеликий відступ, щоб тіні або межі не обрізалися */
}

/* Оновлені стилі кнопок */
.nav-btn {
    position: absolute; /* Кнопки позиціонуються відносно slider-container */
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

/* Виносимо стрілки за межі wrapper */
.prev { 
    left: -60px; /* Від’ємне значення виносить кнопку вліво */
}

.next { 
    right: -60px; /* Від’ємне значення виносить кнопку вправо */
}

.nav-btn:hover {
    background: #333;
    scale: 1.1;
}

/* Важливо: адаптивність */
@media (max-width: 1400px) {
    /* Якщо екран вузький, повертаємо стрілки всередину, щоб вони не зникли за екраном */
    .prev { left: 10px; }
    .next { right: 10px; }
    
    .nav-btn {
        background: rgba(0, 0, 0, 0.6); /* Робимо їх напівпрозорими поверх карток */
    }
}

@media (max-width: 768px) {
    .nav-btn { display: none; } /* На мобільних гортаємо пальцем */
}

/* Стилі для розширеного тексту Про нас */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; }
}

/* Позиціонування футера */
.footer-content {
    display: flex;
    justify-content: space-between; /* Розносить контакти вліво, а соцмережі вправо */
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-socials {
    text-align: right; /* Вирівнювання тексту по правому краю */
}

.social-icons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 15px;
}

.social-link {
    text-decoration: none;
    color: #fff;
    border: 1px solid #fff;
    padding: 8px 15px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.social-link:hover {
    background: #fff;
    color: #000;
}

/* Адаптація для мобільних */
@media (max-width: 600px) {
    .footer-content { flex-direction: column; text-align: center; }
    .footer-socials { text-align: center; width: 100%; }
    .social-icons { justify-content: center; }
}

/* Контейнер вибору оплати */
.payment-selection {
    margin: 30px 0;
    text-align: left;
}

.payment-selection h3 {
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Приховуємо стандартну радіокнопку */
.payment-option input[type="radio"] {
    display: none;
}

/* Стиль всієї панелі опції */
.payment-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.payment-option:hover {
    border-color: #000;
}

/* Коли кнопка вибрана — міняємо фон та рамку */
.payment-option input[type="radio"]:checked + .custom-radio {
    background: #000;
    border-color: #000;
}

.payment-option input[type="radio"]:checked ~ .option-text strong {
    color: #000;
}

/* Кастомний кружечок (Checkbox) */
.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px; /* Робимо квадратним для ефекту галочки */
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Малюємо білу галочку всередині, коли вибрано */
.payment-option input[type="radio"]:checked + .custom-radio::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Стилізація тексту поруч */
.option-text {
    display: flex;
    flex-direction: column;
}

.option-text strong {
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.option-text span {
    font-size: 11px;
    color: #888;
}

.hidden-payment {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s;
    opacity: 0;
}

.hidden-payment.show {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 20px;
}

.card-info-box {
    background: #fff;
    border: 1px solid #000;
    padding: 20px;
    text-align: left;
    font-family: monospace;
}

.card-number {
    font-size: 18px;
    letter-spacing: 2px;
    margin: 10px 0;
    border-bottom: 1px dashed #ccc;
    display: inline-block;
}

.payment-note {
    font-size: 11px;
    color: #666;
    margin-top: 10px;
}

/* Стилі для фотографій товарів */
.product-img {
    width: 100%;
    height: 250px; /* Фіксована висота для вирівнювання */
    object-fit: cover; /* Фото заповнює область без деформації */
    margin-bottom: 15px;
    filter: grayscale(20%); /* Легкий ефект для стилю */
    border-radius: 2px;
}


/* Оновлення контейнера продукту для гарного вигляду */
.product {
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}


/* Стилізація зображень товарів */
.product-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    margin-bottom: 20px;
    filter: grayscale(40%); /* Легкий ретро-стиль */
    border: 1px solid #f0f0f0;
}

.product:hover .product-img {
    filter: grayscale(0%);
    transform: scale(1.03);
    border-color: #000;
}

/* Красива лінія під заголовками */
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: #000;
    margin: 20px auto 0;
}

.weight-selection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.weight-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.weight-options label {
    flex: 1;
    cursor: pointer;
}

.weight-options input {
    display: none; /* Ховаємо стандартний радіо-баттон */
}

.weight-options span {
    display: block;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 12px;
    transition: 0.3s;
}

.weight-options input:checked + span {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Стилі сторінки магазину */
.shop-page {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: #000;
    transform: translateY(-5px);
}

.product-img-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.product-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 25px;
    text-align: left;
}

.product-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-info .price {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-btns {
    display: flex;
    gap: 10px;
}

/* Сітка товарів для сторінки магазину */
#shop-page {
    padding-top: 50px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 4 в ряд на ПК, 1 на мобільних */
    gap: 40px;
    margin-top: 40px;
}

/* Вирівнювання кнопок всередині картки */
.product-btns {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.product-btns button {
    flex: 1;
    font-size: 10px;
    padding: 10px 5px;
}

.shop-grid .product {
    min-width: 0; /* Вимикаємо обмеження слайдера */
    border: 1px solid #f0f0f0;
    padding: 20px;
}

/* Стиль кнопки підтвердження в кошику */
#order-form .order-submit {
    width: 100%;           /* Розтягує кнопку на всю ширину контейнера */
    display: block;        /* Робить кнопку блочним елементом */
    padding: 18px 0;       /* Збільшує внутрішню висоту для зручності */
    margin-top: 40px;      /* Той самий відступ згори, про який ми домовлялися */
    background: #000;      /* Чорний колір фону */
    color: #fff;           /* Білий колір тексту */
    border: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#order-form .order-submit:hover {
    background: #333;      /* Темно-сірий при наведенні */
}

/* Контейнер для выравнивания */
.delivery-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.delivery-card {
    cursor: pointer;
    flex: 1;
}

.delivery-card input[type="radio"] {
    display: none; /* Прячем стандартный инпут */
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    min-height: 100px;
}

/* Кружочек под галочку */
.checkmark {
    width: 26px;
    height: 26px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-bottom: 12px;
    display: flex;         /* Включаем flex для центровки */
    align-items: center;   /* Центровка по вертикали */
    justify-content: center; /* Центровка по горизонтали */
    transition: 0.2s;
    position: relative;
}

/* Стиль при выборе */
.delivery-card input[type="radio"]:checked + .card-content {
    border-color: #4CAF50;
    background-color: #f9fff9;
}

.delivery-card input[type="radio"]:checked + .card-content .checkmark {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

/* Сама белая галочка */
.delivery-card input[type="radio"]:checked + .card-content .checkmark::after {
    content: "";
    display: block;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px; /* Небольшая корректировка из-за наклона галочки */
}

.text {
    font-weight: 600;
    font-family: sans-serif;
    color: #333;
}

/* Ховер эффект */
.card-content:hover {
    border-color: #bbb; 
}

#toast {
    visibility: hidden;
    min-width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-family: sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#toast.show {
    visibility: visible;
    animation: fadeInOut 3s;
}

@keyframes fadeInOut {
    0% { bottom: 0; opacity: 0; }
    15% { bottom: 30px; opacity: 1; }
    85% { bottom: 30px; opacity: 1; }
    100% { bottom: 0; opacity: 0; }
}