/* Импорт шрифта Inter с различными начертаниями */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&display=swap');
/* Golos Text — используется вместо Onest, когда выбран казахский язык (html[lang="kk"],
   см. правило ниже и js/i18n.js applyTranslations()). У Onest формально ЕСТЬ глифы для
   казахских букв (Ә/Ғ/Қ/Ң/Ө/Ұ/Ү/Һ/І — проверено по unicode-range его cyrillic/cyrillic-ext
   подшрифтов), но нарисованы они неаккуратно и на глаз выглядят "кривыми" рядом с обычными
   кириллическими буквами того же слова. Golos Text — шрифт с изначально полноценной
   поддержкой казахской кириллицы. */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: #C0F79A;
    color: #212121;
    min-height: 100vh;
    overflow-x: auto;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    margin: 0;
    /* Киоск: нигде на странице выделение текста не нужно, а без этого лёгкое
       смещение пальца/курсора при нажатии браузер интерпретирует как "выделить
       текст" вместо клика — тап до кнопки/карточки товара просто не доходит.
       Поля ввода (промокод) явно возвращают выделение ниже. */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* Убирает стандартную ~300мс задержку тапа в мобильных браузерах (ждут, не будет ли
       второго тапа для zoom) — без этого КАЖДОЕ нажатие на киоске ощущается с лёгким
       лагом, не только "Добавьте к заказу". touch-action:manipulation разрешает тап и
       скролл, но не двойной тап/пинч-зум, что нам и не нужно на киоске. */
    touch-action: manipulation;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* Казахский язык: перекрываем 'Onest' на Golos Text по всей странице. У десятков
   отдельных правил ниже (.sms-title, #cart-modal и т.д.) свой захардкоженный
   font-family: 'Onest' — вместо правки каждого используем один общий override с
   высокой специфичностью. Иконочные шрифты (material-icons-round) исключены явно,
   иначе вместо иконки показался бы текст её имени. */
html[lang="kk"] :not(.material-icons-round) {
    font-family: 'Golos Text', 'Onest', sans-serif !important;
}

/* Онбординг: управление жестами */
#onboarding-screen {
    touch-action: none;
}

/* Стили карточки товара */
.product-card {
    position: relative;
    width: 380px;
    height: 326px;
    background: #FFFFFF;
    box-shadow: 0px 4px 4px rgba(29, 33, 50, 0.1);
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 0 auto;
    margin: 0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 8px 16px rgba(29, 33, 50, 0.15);
}



/* Сетка товаров */
#products-content {
    text-align: center;
}

.products-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

/* Контейнер для 3D-переворота */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Переворот карточки при классе expanded */
.product-card.expanded .card-inner {
    transform: rotateY(180deg);
}

/* Передняя и задняя стороны карточки */
.product-front,
.product-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08), 0 5px 10px rgba(0, 0, 0, 0.04);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}

.product-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.product-back {
    background-color: white;
    transform: rotateY(180deg);
    z-index: 1;
}

/* Стили основных кнопок */
.btn-primary {
    background-color: #1d4ed8;
    /* blue-700 */
    color: #ffffff;
    padding: 1rem 2rem;
    /* py-4 px-8 */
    border-radius: 0.75rem;
    /* rounded-xl */
    font-weight: 600;
    /* font-semibold */
    font-size: 1.125rem;
    /* text-lg */
    letter-spacing: 0.03em;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
    transform: scale(1);
}

.btn-primary:hover {
    background-color: #1e40af;
    /* blue-800 */
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    transition: background-color .2s ease;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Специальный стиль для кнопки "Добавить" в карточке товара */
.add-to-cart-btn {
    background-color: #16a34a;
    /* green-600 */
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    /* py-3 px-6 */
    border-radius: 0.75rem;
    /* rounded-xl */
    font-weight: 600;
    font-size: 1.125rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.add-to-cart-btn:hover {
    background-color: #15803d;
    /* green-700 */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}


/* Стили вторичных кнопок */
.btn-secondary {
    background-color: #e5e7eb;
    /* gray-200 */
    color: #374151;
    /* gray-700 */
    padding: 0.875rem 1.75rem;
    /* py-3.5 px-7 */
    border-radius: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
    transform: scale(1);
}

.btn-secondary:hover {
    background-color: #d1d5db;
    /* gray-300 */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* Стили модальных окон */
.modal {
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 3.5rem;
    border-radius: 2rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.modal.visible .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Стили заголовков категорий */
.category-heading {
    font-family: 'Onest', sans-serif;
    font-size: 48px;
    font-weight: 600;
    line-height: 60px;
    color: #1D1D1D;
    margin-bottom: 2rem;
    margin-top: 3rem;
}

/* Стиль для текстового плейсхолдера картинки с градиентом */
.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    /* text-2xl */
    border-radius: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--start-color, #a8c0ff), var(--end-color, #3f2b96));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Дополнительные стили для полей ввода */
input[type="tel"],
input[type="text"],
input[type="password"] {
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

input[type="tel"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
    border-color: #2563eb;
}

/* Cart Items Scroll Container */
.cart-items-scroll {
    max-height: 50vh;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #d1d5db transparent;
}

.cart-items-scroll::-webkit-scrollbar {
    width: 4px;
}

.cart-items-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items-scroll::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 20px;
}

.cart-items-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Cart Footer Sticky */
/* Cart Footer Sticky - Fixed */
.cart-footer-sticky {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #ffffff 90%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(8px);
    z-index: 100;
    /* High Z-index */
    padding-bottom: 20px;
    padding-top: 10px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    /* Visual separator */
    margin-top: auto;
    /* Push to bottom if list is short */
}



/* Стиль для секции корзины — старое правило с padding-bottom: 2rem удалено: как
   ID-селектор оно перебивало Tailwind-класс p-[30px] на #cart-section именно для
   нижнего отступа, из-за чего отступы были неравномерными по краям. */

.quantity-btn {
    background-color: #dbeafe;
    /* blue-100 */
    color: #1d4ed8;
    /* blue-700 */
    font-weight: 700;
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    /* text-2xl */
    transition: background-color 0.2s ease-in-out;
}

.quantity-btn:hover {
    background-color: #bfdbfe;
    /* blue-200 */
}

.quantity-btn:active {
    background-color: #93c5fd;
    /* blue-300 */
}

/* Стили для контента задней стороны */
.product-back .product-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #1e3a8a;
}

.product-back .product-description-full {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 300;
    flex-grow: 1;
}

.product-back .product-price-and-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
}

.product-back .product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #7e22ce;
}

.product-back .quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-back .product-quantity {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Админ-панель (оверлей) */
#admin-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
}

#admin-panel {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1200px;
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    max-height: 90vh;
    overflow-y: auto;
}

.admin-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.admin-tab.active {
    background-color: #1d4ed8;
    color: #ffffff;
}

/* Верхний блок: поиск и табы */
.onest {
    font-family: 'Onest', Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#top-container {
    width: min(1180px, 92%);
    margin: 20px auto;
    background: #FFFFFF;
    border-radius: 40px;
    position: relative;
    padding: 24px;
    box-shadow: 0 4px 4px rgba(0, 54, 28, 0.1);
}

#search-bar {
    height: 78px;
    background: #DADBDE;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
}

#search-input {
    flex: 1;
    height: 36px;
    font-family: 'Onest', sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 35px;
    color: #525563;
    border: none;
    outline: none;
    background: transparent;
}

#tabs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.tab-pill {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
    padding: 12px 24px;
    border-radius: 16px;
    background: #E6E7E9;
    color: #212431;
    font-family: 'Onest', sans-serif;
    font-weight: 500;
    font-size: 22px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tab-pill:hover {
    background: #D1D5DB;
}

.tab-pill.active {
    background: #1D1D1D;
    color: #FFFFFF;
    font-weight: 600;
}

/* Модал карточки товара - REMOVED OLD STYLES */
/* Old #product-modal and #pm- styles removed to prevent conflicts */
/* See #product-modal-overlay and #modal- styles below (around line 857+) */

/* Основной контейнер с точными размерами из Figma */
#main-container {
    position: relative;
    width: 1280px;
    min-height: 800px;
    background: #C0F79A;
    border-radius: 30px;
    overflow: visible;
    margin: 0 auto;
}

/* Верхний блок с поиском и табами */
/* Clean Search & Filter Block Rewrite */
#top-section {
    position: relative;
    width: 1180px;
    height: 202px;
    background: #FFFFFF;
    border-radius: 40px;
    margin: 20px auto;
}

/* Поисковая строка */
#search-container {
    position: absolute;
    width: 1132px;
    height: 78px;
    left: calc(50% - 1132px/2);
    top: 24px;
    background: #DADBDE;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* Critical for padding */
}

#search-container:focus-within {
    border-color: #C0F79A;
    box-shadow: 0 4px 20px rgba(192, 247, 154, 0.2);
}

#search-input {
    width: 100%;
    height: 36px;
    font-family: 'Onest';
    font-style: normal;
    font-weight: 500;
    font-size: 28px;
    line-height: 35px;
    color: #525563;
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    padding: 0;
}

#search-input::placeholder {
    color: #9CA3AF;
    opacity: 0.8;
}

/* Табы категорий */
/* Tabs Container */
#tabs-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0;
    position: absolute;
    left: 24px;
    top: 122px;
    height: 56px;
    width: auto;
}

/* Individual Tab */
.category-tab {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
    min-width: 88px;
    padding: 0 24px;

    background: #E6E7E9;
    border-radius: 16px;
    border: none;
    cursor: pointer;

    font-family: 'Onest';
    font-style: normal;
    font-weight: 500;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    color: #212431;

    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex: 0 0 auto;
}

/* Active State */
.category-tab.active {
    background: #043C21;
    color: #FFFFFF;
    font-weight: 600;
}

/* Bold Preservation Trick (prevent jumping) */
.category-tab::after {
    display: block;
    content: attr(data-text);
    font-weight: 600;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

/* Заголовки категорий */
.category-heading {
    font-family: 'Onest';
    font-style: normal;
    font-weight: 600;
    font-size: 42px;
    line-height: 54px;
    color: #1D1D1D;
    margin-bottom: 2rem;
    margin-top: 3rem;
    text-align: center;
}

/* Custom Scrollbar for Cart to match design (hidden or thin) */
.cart-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.cart-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.cart-scrollbar::-webkit-scrollbar-thumb {
    background-color: #E2E2E5;
    border-radius: 3px;
}

.cart-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #E2E2E5 transparent;
}

/* Карточки товаров */
.product-card {
    position: relative;
    width: 380px;
    height: 326px;
    background: #FFFFFF;
    box-shadow: 0px 4px 4px rgba(29, 33, 50, 0.1);
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 0 auto;
    margin: 0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 8px 16px rgba(29, 33, 50, 0.15);
}

.product-image {
    position: absolute;
    width: 269px;
    height: 269px;
    left: calc(50% - 269px/2 + 0.5px);
    top: calc(50% - 269px/2 - 4.5px);
    object-fit: contain;
}

/* Сетка товаров */
#products-content {
    text-align: center;
}

.products-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

/* Модальное окно товара - новая версия внизу экрана */
#product-modal-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    background: transparent;
    z-index: 6500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

#product-modal {
    position: relative;
    width: 100%;
    max-width: 1280px;
    height: 200px;
    background: #FFFFFF;
    box-shadow: 0px -8px 32px rgba(29, 33, 50, 0.15);
    border-radius: 40px 40px 0px 0px;
    pointer-events: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#product-modal-overlay.visible #product-modal {
    transform: translateY(0);
}

/* === AUTH FRAME 19 (поверх корзины) === */
/* Модальное окно авторизации */
#authModal {
    background: rgba(0, 0, 0, 0.5) !important;
}

#auth-frame-19 {
    position: absolute;
    width: 858px;
    height: 464px;
    left: calc(50% - 858px/2);
    top: calc(50% - 464px/2);
    background: #FFFFFF;
    border-radius: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#auth-title {
    position: absolute;
    width: 625px;
    height: 42px;
    left: calc(50% - 625px/2 + 0.5px);
    top: 116px;
    font-family: 'Onest';
    font-style: normal;
    font-weight: 600;
    font-size: 40px;
    line-height: 42px;
    color: #000000;
    text-align: center;
}

#auth-dismiss {
    position: absolute;
    width: 32px;
    height: 32px;
    left: calc(50% - 32px/2 + 357px);
    top: calc(50% - 32px/2 - 160px);
    border: none;
    background: transparent;
    cursor: pointer;
}

#auth-dismiss::before {
    content: '×';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: #3F4355;
}

.auth-btn {
    position: absolute;
    width: 540px;
    height: 104px;
    left: calc(50% - 540px/2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 26px 48px;
    gap: 4px;
    border: none;
    cursor: pointer;
}

.auth-btn .title {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 26px;
    line-height: 24px;
}

.auth-btn .subtitle {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
}

.auth-btn-primary {
    top: 190px;
    background: #043C21;
}

.auth-btn-primary .title {
    color: #FFFFFF;
}

.auth-btn-primary .subtitle {
    color: #C0F79A;
}

.auth-btn-secondary {
    top: 314px;
    background: #C0F79A;
}

.auth-btn-secondary .title {
    color: #043C21;
}

.auth-btn-secondary .subtitle {
    color: #043C21;
}

/* === Стили корзины по макету ===
   Раньше здесь было #cart-modal { width: 743px; height: 540px; ... } — ID-селектор
   побеждает по специфичности ЛЮБЫЕ Tailwind-классы на том же элементе (тот же баг,
   что был у #modal-close — см. историю правок), поэтому сколько бы раз ни менялись
   классы w-full/h-full/max-w-[...] в index.html, реальный размер корзины оставался
   намертво прибит к 743×540px. Убрано полностью — размер и фон/тень теперь только
   через классы на самом элементе (#cart-section/#cart-modal в index.html). */

#cart-title {
    position: absolute;
    left: 20px;
    top: 60px;
    width: 328px;
    height: 42px;
    font-family: 'Onest';
    font-style: normal;
    font-weight: 600;
    font-size: 40px;
    line-height: 42px;
    color: #000000;
}

/* #cart-close: старое правило (position:absolute; left:683px; width/height:40px)
   удалено — та же история, что была с #modal-close и #cart-modal: ID-селектор молчал,
   пока элемента с таким id не было в разметке, а как только он появился (новая кнопка
   "Вернуться в магазин"), тут же задавил её собственные Tailwind-классы по
   специфичности и вынес из потока абсолютным позиционированием на жёстко зашитые
   координаты — отсюда и "прыгающая в середину, обрезанная" кнопка. Стили теперь
   только через классы на самом элементе в index.html. */

.cart-list {
    position: absolute;
    left: 20px;
    top: 132px;
    right: 20px;
    bottom: 140px;
    overflow-y: auto;
    padding-right: 6px;
}

.cart-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    min-height: 110px;
    margin-bottom: 20px;
    position: relative;
    padding-right: 96px;
}

.cart-thumb {
    width: 101px;
    height: 100.63px;
    border: 1px solid #D6D7DB;
    border-radius: 10px;
    flex: none;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.cart-thumb img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    left: 0;
    top: 0;
}

.cart-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.cart-info .name {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 28px;
    line-height: 40px;
    color: #1B1C20;
}

.cart-info .desc {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    color: #525563;
}

.cart-info .price {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 26px;
    line-height: 42px;
    color: #043C21;
}

.cart-qty {
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-qty .box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: #C0F79A;
    border-radius: 10px;
}

.cart-qty .box span {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 26px;
    line-height: 42px;
    color: #043C21;
}

/* === SMS AUTH new design === */
#smsAuthModal {
    z-index: 5000;
}

#smsAuthModal .modal-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
    max-width: none;
    max-height: none;
    overflow: visible;
}

#sms-frame-19 {
    position: absolute;
    width: 1180px;
    height: 790px;
    left: calc(50% - 1180px/2);
    top: calc(50% - 790px/2);
    background: #FFFFFF;
    border-radius: 40px;
}

#sms-title {
    position: absolute;
    width: 550px;
    height: 42px;
    left: calc(50% - 550px/2);
    top: 144px;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 40px;
    line-height: 42px;
    text-align: center;
    color: #000000;
}

#sms-subtitle {
    position: absolute;
    width: 605px;
    height: 52px;
    left: calc(50% - 605px/2 + 0.5px);
    top: 198px;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 22px;
    line-height: 26px;
    text-align: center;
    color: #3F4355;
}

#closeSmsAuthModal {
    position: absolute;
    width: 32px;
    height: 32px;
    left: calc(50% - 32px/2 + 518px);
    top: calc(50% - 32px/2 - 266px);
    border-radius: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
}

#closeSmsAuthModal::before {
    content: '×';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: #3F4355;
}

#sms-back {
    position: absolute;
    width: 133px;
    height: 56px;
    left: 56px;
    top: 56px;
    background: #F0FFE5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 24px 16px 18px;
    cursor: pointer;
}

#sms-back .arrow {
    width: 24px;
    height: 24px;
    position: relative;
}

#sms-back .arrow::before {
    content: '←';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: #043C21;
}

#sms-back .label {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    color: #043C21;
}

#sms-phone,
#sms-name {
    position: absolute;
    width: 620px;
    height: 99px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

#sms-phone {
    left: 280px;
    top: 262px;
}

#sms-name {
    left: calc(50% - 620px/2);
    top: 371px;
}

.sms-label {
    width: 620px;
    height: 24px;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #767984;
}

.sms-input {
    width: 620px;
    height: 68px;
    background: #EEEEF0;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
    border: none;
    outline: none;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 20px;
    color: #3F4355;
}

#sendSmsCodeBtn {
    position: absolute;
    width: 493px;
    height: 76px;
    left: calc(50% - 493px/2);
    top: 688px;
    background: #043C21;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 48px;
    gap: 10px;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 26px;
    color: #FFFFFF;
    /* Устраняем 300ms задержку на планшетах */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* === SMS CODE modal === */
#smsCodeModal {
    z-index: 5000;
}

#smsCodeModal .modal-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
    max-width: none;
    max-height: none;
    overflow: visible;
}

#smscode-frame-19 {
    position: absolute;
    width: 1180px;
    height: 700px;
    left: calc(50% - 1180px/2);
    top: calc(50% - 700px/2);
    background: #FFFFFF;
    border-radius: 40px;
}

#smscode-title {
    position: absolute;
    width: 244px;
    height: 42px;
    left: calc(50% - 244px/2);
    top: 144px;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 40px;
    line-height: 42px;
    text-align: center;
    color: #000;
}

#smscode-subtitle {
    position: absolute;
    width: 548px;
    height: 52px;
    left: calc(50% - 548px/2);
    top: 198px;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 22px;
    line-height: 26px;
    text-align: center;
    color: #3F4355;
}

#closeSmsCodeModal {
    position: absolute;
    width: 32px;
    height: 32px;
    left: calc(50% - 32px/2 + 518px);
    top: calc(50% - 32px/2 - 266px);
    border: none;
    background: transparent;
    cursor: pointer;
}

#closeSmsCodeModal::before {
    content: '×';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: #3F4355;
}

#smscode-back {
    position: absolute;
    width: 133px;
    height: 56px;
    left: 56px;
    top: 56px;
    background: #F0FFE5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 24px 16px 18px;
    cursor: pointer;
}

#smscode-back .arrow {
    width: 24px;
    height: 24px;
    position: relative;
}

#smscode-back .arrow::before {
    content: '←';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: #043C21;
}

#smscode-back .label {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    color: #043C21;
}

#smscode-inputs {
    position: absolute;
    left: calc(50% - 297px/2 + 0.5px);
    top: 282px;
    width: 297px;
    height: 99px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-start;
}

#smscode-inputs .lab {
    width: 38px;
    height: 24px;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #767984;
}

#smscode-digits {
    display: flex;
    gap: 7px;
}

.sms-digit-input {
    width: 69px;
    height: 68px;
    background: #EEEEF0;
    border-radius: 20px;
    border: none;
    outline: none;
    text-align: center;
    font-family: 'Onest';
    font-weight: 500;
    font-size: 24px;
    color: #3F4355;
}

#smsCodeConfirmBtn {
    position: absolute;
    width: 256px;
    height: 76px;
    left: calc(50% - 256px/2);
    top: 510px;
    background: #043C21;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 48px;
    gap: 10px;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 26px;
    color: #FFFFFF;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* === PAYMENT MODAL on top and full overlay === */
#payment-modal {
    z-index: 6000;
}

#payment-modal .modal-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
    max-width: none;
    max-height: none;
    overflow: visible;
}

/* === PAYMENT SUCCESS modal (Frame 20) === */
#paymentSuccessModal {
    z-index: 7000;
}

#paymentSuccessModal .modal-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
    max-width: none;
    max-height: none;
    overflow: visible;
}

#payment-success-frame-20 {
    position: absolute;
    width: 1180px;
    height: 600px;
    left: calc(50% - 1180px/2);
    top: calc(50% - 600px/2);
    background: #FFFFFF;
    border-radius: 40px;
}

#success-back {
    position: absolute;
    width: 133px;
    height: 56px;
    left: 56px;
    top: 56px;
    background: #F0FFE5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 24px 16px 18px;
    cursor: pointer;
}

#success-back .arrow {
    width: 24px;
    height: 24px;
    position: relative;
}

#success-back .arrow::before {
    content: '←';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: #043C21;
}

#success-back .label {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    color: #043C21;
}

#success-stack {
    position: absolute;
    width: 1000px;
    height: auto;
    left: calc(50% - 1000px/2);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#success-check {
    position: relative;
    width: 96px;
    height: 96px;
}

/* Успех (по умолчанию, без .error/.loading) — анимированный SVG: круг с "поп"-появлением
   плюс обводка галочки рисуется через stroke-dashoffset (.checkmark-animation в
   css/animations.css). Раньше здесь была статичная ::before-галочка без анимации. */
#success-check svg {
    display: block;
    width: 100%;
    height: 100%;
    animation: success-check-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes success-check-pop {
    0% { transform: scale(0.4); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

#success-check.error svg,
#success-check.loading svg {
    display: none;
}

#success-check::before {
    content: '';
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 42px;
    box-shadow: 0 10px 25px rgba(4, 60, 33, 0.25);
}

#success-check.error::before {
    content: '\2717';
    display: flex;
    background: #FF3B30;
    color: #fff;
}

#success-check.loading::before {
    content: '';
    display: flex;
    background: transparent;
    border: 6px solid #CACBD0;
    border-top: 6px solid #043C21;
    border-radius: 50%;
    animation: success-spin 1s linear infinite;
}

#success-title {
    width: 1000px;
    height: auto;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 26px;
    line-height: 34px;
    text-align: center;
    color: #043C21;
}

#success-subtitle {
    width: 1000px;
    height: auto;
    font-family: 'Onest';
    font-weight: 800;
    font-size: 48px;
    line-height: 58px;
    text-align: center;
    color: #1B1C20;
    margin-top: 4px;
}

#success-countdown {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 32px;
    line-height: 40px;
    text-align: center;
    color: #FF3B30;
    margin-top: 12px;
}

#success-retry-btn {
    width: 360px;
    height: 68px;
    background: #043C21;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 22px;
    color: #FFFFFF;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    margin-top: 12px;
}

#success-retry-btn:hover {
    background: #032a18;
}

#success-retry-btn:active {
    transform: scale(0.98);
}

#success-retry-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-icon {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: success-spin 1s ease-in-out infinite;
    margin-right: 10px;
    display: none;
}

@keyframes success-spin {
    to { transform: rotate(360deg); }
}

/* Кнопка закрытия карточки товара — раньше та же позиция/размер задавались ЕЩЁ РАЗ
   через Tailwind-классы прямо в разметке (index.html), и из-за неверсионированного
   кэша styles.css старая/новая версия правил чередовались между открытиями модалки —
   визуально это выглядело как "прыжок" кнопки между углом и центром. Теперь единственный
   источник правды для позиции/размера — это правило ниже; в разметке у кнопки не должно
   быть конфликтующих классов позиционирования/размера. */
#modal-close {
    position: absolute;
    width: 52px;
    height: 52px;
    right: 20px;
    top: 20px;
    background: #EEEEF0;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
    #modal-close {
        right: 32px;
        top: 32px;
    }
}

#modal-close::before {
    content: '×';
    font-size: 26px;
    font-weight: 700;
    color: #3F4355;
    line-height: 1;
}

#modal-close:hover {
    background: #C0F79A;
}

/* Иконка назад в экране оплаты */
#payment-back .arrow {
    width: 24px;
    height: 24px;
    position: relative;
}

#payment-back .arrow::before {
    content: '←';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: #043C21;
}

/* Контейнер для контента модального окна */
#modal-content-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 20px 40px;
    gap: 40px;
}

/* Левая часть - информация о товаре */
#modal-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#modal-title {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 22px;
    line-height: 28px;
    color: #1D1D1D;
    margin: 0;
}

#modal-description {
    font-family: 'Onest';
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #767984;
    margin: 0;
    max-width: 600px;
}

#modal-price {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 20px;
    line-height: 26px;
    color: #043C21;
    margin: 0;
}

/* Правая часть - управление количеством и кнопка */
#modal-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

#quantity-stepper {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #F0FFE5;
    border-radius: 20px;
    padding: 8px 16px;
}

.stepper-button {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: none;
    background: #EEEEF0;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 20px;
    color: #3F4355;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.stepper-button:hover {
    background: #C0F79A;
}

#quantity-display {
    min-width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 20px;
    color: #043C21;
}

#add-to-cart-button {
    width: 240px;
    height: 76px;
    background: #043C21;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 26px 32px;
    transition: background 0.2s ease;
}

#add-to-cart-button:hover {
    background: #032a18;
}

#add-to-cart-button:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
}

#add-button-text {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 20px;
    color: #FFFFFF;
}

#add-button-price {
    display: flex;
    align-items: center;
    gap: 4px;
}

#add-button-price .price {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 20px;
    color: #FFFFFF;
}

#add-button-price .currency {
    font-family: 'Onest';
    font-weight: 500;
    font-size: 16px;
    color: #FFFFFF;
}

/* Стили для улучшенной корзины */
.cart-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F0FFE5;
    border-radius: 12px;
    padding: 4px 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #EEEEF0;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 18px;
    color: #3F4355;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: #C0F79A;
}

.qty-display {
    min-width: 40px;
    text-align: center;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 16px;
    color: #043C21;
}

.remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    border: none;
    background: #FFE5E5;
    color: #FF4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #FF4444;
    color: white;
    transform: scale(1.1);
}

/* Плавающая кнопка корзины с улучшенным дизайном */
#floating-cart-button {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 70px !important;
    height: 70px !important;
    background: linear-gradient(135deg, #043C21 0%, #065a31 100%) !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(4, 60, 33, 0.4) !important;
    z-index: 2000 !important;
    transition: transform 0.2s ease !important;
    color: white !important;
}

#floating-cart-button:hover {
    transform: scale(1.05) !important;
}

#floating-cart-button:active {
    transform: scale(0.95) !important;
}

#floating-cart-button svg {
    width: 28px;
    height: 28px;
}

#cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 24px;
    height: 24px;
    background: #DC2626;
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Onest', sans-serif;
    font-weight: 600;
    font-size: 12px;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    border: 2px solid #C0F79A;
}

/* Пустая корзина сообщение */
#empty-cart-message {
    text-align: center;
    color: #767984;
    font-family: 'Onest', sans-serif;
    font-size: 18px;
    font-weight: 500;
    padding: 40px 20px;
}

/* Улучшенные стили для элементов корзины */
.cart-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    background: #F5F5F5;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-info .name {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 16px;
    color: #1D1D1D;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-info .desc {
    font-family: 'Onest';
    font-weight: 400;
    font-size: 14px;
    color: #767984;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-info .price {
    font-family: 'Onest';
    font-weight: 600;
    font-size: 18px;
    color: #043C21;
}

/* Адаптивность */
@media (max-width: 1280px) {
    #main-container {
        width: 100%;
        height: auto;
        min-height: 800px;
    }

    .product-card {
        position: relative;
        margin: 20px;
    }
}

.product-card {
    position: relative;
    margin: 20px;
}

/* === Кастомная цифровая клавиатура (Numpad) === */
#phone-numpad {
    position: absolute;
    width: 620px;
    height: 310px;
    left: 280px;
    top: 360px;
    background: transparent;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    height: 100%;
}

.numpad-key {
    background: #F0FDF4;
    border: 2px solid #D9FFBF;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Onest';
    font-weight: 600;
    font-size: 32px;
    color: #1B1C20;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.numpad-key:active {
    background: #C0F79A;
    transform: scale(0.95);
}

.numpad-key span {
    font-weight: 500;
    font-size: 14px;
    color: #767984;
    margin-top: -4px;
}

.numpad-empty {
    background: transparent;
    border: none;
    cursor: default;
}

.numpad-empty:active {
    background: transparent;
    transform: none;
}

.numpad-backspace {
    background: #F0FDF4;
}

/* === Стили для ручной проверки и кнопок оверлея === */
#payment-manual-check-btn:hover, #timeout-paid-btn:hover {
    background-color: #032a18 !important;
    box-shadow: 0 10px 25px rgba(4, 60, 33, 0.3) !important;
}

#payment-manual-check-btn:active, #timeout-paid-btn:active, #timeout-cancel-btn:active {
    transform: scale(0.97) !important;
}

#payment-manual-check-btn:disabled, #timeout-paid-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

#timeout-cancel-btn:hover {
    background-color: #D32F2F !important;
    box-shadow: 0 10px 25px rgba(255, 59, 48, 0.3) !important;
}
