/* empty.css */
:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --muted: #64748b;
    --accent: #3b82f6;
    --danger: #ef4444;
    --success: #10b981;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --grad: #575757;
    --primary-price: #f44;
    --wb-price: #970071;
    --saName: #970071;
    --title-transition: #9700718a;
    --semi-transparent: #ffffff80;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    /* overflow-y: scroll; */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: #111;
}


.app-container {
    min-height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    padding: clamp(10px, 2vw, 20px);
}

.app {
    /* justify-content: center; */
    align-items: center;
    width: 100%;
    max-width: 1440px;
    min-width: 300px;
    /* margin: 0 auto; */
    padding-top: 70px;
}


.header {
    max-width: 1440px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 1000;
}

.brand-logo-image {
    margin-left: clamp(2px, 2vw, 8px);
    height: 90%;
    width: auto;
    flex-shrink: 0;
    cursor: pointer;
}

.header-buttons-container {
    display: flex;
    gap: 15px;
}

.faq-button,
.delivery-button,
.about-button {
    background: var(--semi-transparent);
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
}

.faq-button:hover,
.delivery-button:hover,
.about-button:hover {
    background: var(--accent);
}

.cart-btn {
    position: relative;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: clamp(2px, 1vw, 6px);
    margin-right: clamp(4px, 2vw, 10px);
    margin-top: clamp(2px, 2vw, 3px);
}

.cart-badge {
    position: absolute;
    top: -3px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: clamp(10px, 1.2vw, 12px);
    padding: clamp(2px, 0.4vw, 3px) clamp(4px, 0.8vw, 6px);
    border-radius: 999px;
}

.cart-note {
    align-items: flex-end;
    font-size: clamp(11px, 1vw, 13px);
    color: var(--muted);
    text-align: center;
    margin-right: clamp(4px, 2vw, 10px);
}


/* Управление */
.controls {
    display: flex;
    gap: clamp(6px, 1.2vw, 12px);
    margin: clamp(6px, 1.2vw, 12px);
    flex-wrap: wrap;
    /* position: fixed; */
    top: 70px;
}

.select,
.search-input {
    padding: clamp(6px, 1vw, 8px) clamp(10px, 1.5vw, 12px);
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    width: 160px;
    font-size: clamp(0.8rem, 0.8vw, 1rem);
}

.controls-actions {
    display: flex;
    gap: clamp(6px, 1vw, 8px);
    margin-left: auto;
}

.small {
    font-size: clamp(11px, 1vw, 13px);
    padding: clamp(4px, 0.8vw, 6px) clamp(6px, 1vw, 8px);
    border-radius: 8px;
    background: #e6e9ef;
    border: 0;
    cursor: pointer;
}

/* Сетка товаров */
.products-container {
    width: 100%;
}

.products-grid {
    display: grid;
    gap: clamp(10px, 1.5vw, 16px);
    grid-template-columns: repeat(5, 1fr);
    min-height: 100px;
    align-content: start;
}

.no-results {
    min-height: 100px;
    max-width: 1440px;
    width: 100%;
    padding: clamp(6px, 1vw, 8px) clamp(10px, 1.5vw, 12px);
    display: flex;
    justify-content: center;
}

/* Карточка товара */
.card {
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.card-image-container {
    aspect-ratio: 3/4;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Для позиционирования .product-share */
}

.fake-img {
    color: #9ca3af;
    font-size: clamp(10px, 1vw, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Слайдер в карточке товара */
/* Слайдер в карточке товара */
.product-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    touch-action: pan-y;
    /* Позволяет вертикальный скролл страницы, блокирует горизонтальный на слайдере */
}

.slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
    /* Плавный переход */
    will-change: transform;
    /* Оптимизация для анимаций */
}

.slider-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    pointer-events: none;
    /* Отключаем pointer-events на изображении, чтобы события касания шли на wrapper */
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slider-dot.active {
    background-color: white;
}

/* Кнопки навигации (стрелки) - опционально */
/* .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.slider-nav.prev {
    left: 10px;
}

.slider-nav.next {
    right: 10px;
} */

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.product-share {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.share-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: white;
    transform: scale(1.1);
}


.card-content {
    align-items: center;
    justify-content: center;
    padding: clamp(4px, 1vw, 8px);
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 1vw, 4px);
}

/* .card-header {
    align-items: center;
    justify-content: center;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
} */

.saName {
        align-self: flex-start;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    text-overflow: ellipsis;
    border-radius: 4px;
    color: var(--saName);
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.nmId:hover,
.saName:hover {
    background-color: var(--title-transition);
}

.mini-desc {
    font-weight: 600;
    margin-top: 5px;
    display: flex;
    color: var(--text);
    font-size: clamp(0.55rem, 1vw, 0.85rem);
    align-self: flex-start;
}

.nmId {
    font-weight: 600;
    align-self: flex-start;
    font-size: 1.1rem;
    color: var(--saName);
    cursor: pointer;
    border-radius: 4px;
    padding: 2px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.copy-icon {
    margin-left: 2px;
    position: relative;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.square {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid var(--title-transition);
    background: white;
}

.square.offset {
    top: 3px;
    left: 3px;
}

.price {
    font-weight: 650;
    white-space: nowrap;
    font-size: 1.3rem;
    align-self: flex-start;
    color: var(--primary-price);
    display: flex;
    align-items: center;
    gap: 2px;
}

.del-price-container {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.del-price {
    font-size: 0.85rem;
    color: var(--muted);
}

.wb-price-text {
    font-size: 0.6rem;
    color: var(--muted);
    margin-top: 1px;
}

.category {
    margin-top: 5px;
    align-self: flex-start;
    font-size: clamp(0.7rem, 1vw, 1rem);
    color: darkblue;
    font-weight: 600;
}

.card-title {
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    color: var(--muted);
    min-height: calc(3 * 1.3em);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
    flex: 1;
}

.card-actions {
    height: 30px;
    justify-items: center;
    align-items: center;
    gap: clamp(6px, 1vw, 8px);
}

.qty {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.quantity {
    text-align: center;
    width: 30px;
    font-size: 1.2rem;
    color: #970071;
}

.btn {
    padding: clamp(4px, 0.8vw, 6px) clamp(8px, 1.5vw, 12px);
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
}

.add-sub {
    width: 30px;
    height: 30px;
    color: white;
    border-radius: 50%;
    border: 0;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.7);
}

.product-add-sub {
    width: 40px;
    height: 40px;
    color: white;
    border-radius: 50%;
    border: 0;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.7);
}

.btn-add {
    background: var(--success);
}

.btn-sub {
    background: var(--warning);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: 0;
}

.btn-to-cart {
    width: 100px;
    justify-items: center;
    background: var(--accent);
    color: white;
    border: 0;
}

/* Модальное окно */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    display: none;
}

.modal {
    max-width: 800px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
}

.modal-header {
    text-align: center;
    align-content: center;
    margin: clamp(4px, 1.5vw, 8px) 0;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-content {
    /* padding: 15px; */
    max-height: 60vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: clamp(6px, 1vw, 8px);
    margin: clamp(10px, 1.5vw, 16px);
    align-items: center;
    padding: 15px;
    border-top: 1px solid var(--border);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Адаптивность */
@media (min-width: 1440px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .modal {
        width: 800px;
    }
}

@media (max-width: 1439px) and (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 899px) and (min-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 599px) {

    .scroll-top-btn {
        bottom: 40px;
        right: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-logo-image {
        height: 60%;
    }

    .controls-actions {
        margin-left: 0;
        justify-content: center;
    }

    .faq-button,
    .delivery-button,
    .about-button {
        font-size: 10px;
        padding: 2px;
        /* gap: 5px; */
    }

}

/* Floating кнопка "Наверх" */
.scroll-top-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--bg);
    color: rgb(180, 37, 37);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
    transition: all 0.3s ease;
    display: none;
}

.scroll-top-btn:hover {
    background: var(--bg);
    transform: translateY(-2px);
}

/* Стили для просмотра изображений */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    display: none;
}

.image-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.image-viewer .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.image-viewer .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.image-viewer .nav-btn.prev {
    left: 20px;
}

.image-viewer .nav-btn.next {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.dots-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1001;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background: white;
}

/* Анимации */
.flash {
    background-color: var(--title-transition);
    transition: background-color 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading,
.error {
    padding: 2rem;
    text-align: center;
    font-size: 1.2rem;
}

.error {
    color: #dc3545;
}

/* Стили для корзины */
.cart-item {
    margin: 1%;
    display: flex;
    border-radius: 10px;
    justify-content: space-between;
    align-items: center;
    /* padding: clamp(6px, 1vw, 8px) 0; */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
}

.cart-item-left {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    margin: clamp(8px, 1vw, 12px);
}

.cart-item-info {
    min-width: 140px;
}

.cart-item img {
    width: clamp(60px, 15vw, 60px);
    height: clamp(80px, 20vw, 80px);
    object-fit: cover;
    border-radius: clamp(4px, 1vw, 8px);
    flex-shrink: 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    flex-direction: column-reverse;
    gap: clamp(4px, 1.2vw, 8px);
}

.cart-add-sub {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: clamp(6px, 1.2vw, 12px);
    gap: clamp(4px, 1.2vw, 8px);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin: clamp(8px, 1vw, 12px);
}

.empty-cart {
    color: var(--muted);
    padding: clamp(12px, 2vw, 18px) 0;
    text-align: center;
}

/* Анимация тряски */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Стиль для предупреждения о минимальной сумме */
.cart-minimum-warning {
    color: #dc3545;
    /* Bootstrap danger text color */
    text-align: center;
    padding: 10px;
    font-weight: 500;
    background-color: #f8d7da;
    /* Bootstrap danger background */
    border: 1px solid #f5c6cb;
    /* Bootstrap danger border */
    border-radius: 4px;
    margin: 10px 15px;
    /* Отступы сверху/снизу и по бокам модального окна */
}

/* Стиль для отключенной кнопки */
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.btn-disabled:hover {
    opacity: 0.6;
    transform: none !important;
    /* Отменяем возможный hover-эффект */
}

/* Стили для FAQ */
.faq-content {
    padding: 20px;
}

.faq-item {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.faq-question {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text);
}

.faq-answer {
    color: var(--text-light);
}


/* Стили для модального окна оформления заказа */
.checkout-modal {
    max-width: 500px;
}

.order-summary {
    text-align: center;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 1px solid var(--border);
}

.checkout-form {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input.error {
    border-color: var(--danger);
}

.error-text {
    color: var(--danger);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

/* Стили для отключенных кнопок */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.footer {
    background-color: #f5f5f5;
    /* Цвет фона подвала */
    padding: 20px;
    text-align: center;
    bottom: 0;
    /* margin-top: auto; */
    /* Помогает прижать подвал вниз, если нужно */
    border-top: 1px solid #ddd;
    /* Опционально: линия сверху */
    font-size: 0.9em;
    color: #666;
}

.footer-content {
    max-width: 1440px;
    /* Ограничиваем ширину, как в основном контенте */
    margin: 0 auto;
    padding: 0 15px;
}