/* ================================
   ОСНОВНЫЕ ЭЛЕМЕНТЫ (НЕ МЕНЯЮТСЯ)
   ================================ */

/* Прелоадер */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #808080; /* будет перекрыто темой */
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
}
.loader span {
    display: block;
    width: 10px;
    height: 10px;
    background-color: #333; /* будет перекрыто темой */
    border-radius: 50%;
    margin: 0 5px;
    animation: pulse 1.5s infinite alternate;
}
.loader span:nth-child(1) { animation-delay: 0.1s; }
.loader span:nth-child(2) { animation-delay: 0.2s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Основная обёртка магазина */
.store-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    min-height: calc(100vh - 90px);
    overflow-y: auto;
    border: 1px solid #e5e5e5; /* перекроется темой */
    position: relative;
    background-color: #f8f8f8; /* перекроется темой */
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 40px;
    flex: 1 1 auto;
}

/* Общие элементы */
.uk-margin-bottom {
    margin-top: 10px;
}
.back-button-container {
    margin-top: 10px;
}
.uk-flex.uk-flex-between.uk-flex-middle.uk-margin-bottom {
    margin-top: 10px;
}
body.page-product-list .uk-button.uk-button-primary.uk-border-pill,
body.page-product-list .uk-button.uk-button-default {
    margin-top: 15px;
}
h2, h3 {
    font-family: 'Manrope', sans-serif !important;
}
.uk-list-decimal {
    padding-left: 20px;
}
.uk-list-decimal li {
    margin-bottom: 10px;
}

/* Корзина */
.cart-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}
.cart-icon {
    display: inline-block;
    background-color: #ffffff; /* перекроется темой */
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
}
.cart-count {
    background-color: #f0506e;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    min-width: 18px;
    text-align: center;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Уведомление */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: none;
    background: linear-gradient(135deg, #91f086, #48bf53);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1),
               fadeOut 0.75s ease-out 2.25s forwards;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    width: fit-content;
}
.notification:hover {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
@keyframes slideUp {
    from { bottom: -100px; opacity: 0; }
    to { bottom: 20px; opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; transform: translateX(-50%) scale(1); }
    to { opacity: 0; transform: translateX(-50%) scale(0.95); }
}

/* New Arrival Label - Glassmorphism style like dark theme header */
.new-arrival-label {
    background: rgba(30, 30, 30, 0.5) !important;
    color: #fff !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    display: inline-block;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Модальное окно поиска */
#modal-search .uk-modal-dialog {
    max-width: 500px;
    margin: auto;
    z-index: 26000
}
#modal-search .uk-search-input {
    font-size: 1.2em;
}
#message-to-copy {
    user-select: none;
}
#message-to-copy:hover {
    background-color: #f8f8f8; /* перекроется темой */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#message-to-copy:active {
    transform: scale(0.98);
}

/* Хедер и glassmorphism - базовые стили */
header {
    background-color: transparent !important;
    padding: 0;
    text-align: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 25000 !important;
    transform: translateY(0);
}

/* Базовые свойства header-bg без привязки к теме */
.header-bg {
    max-width: 540px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    border-radius: 0 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
    box-shadow: none !important;
}

header *,
header *:before,
header *:after,
.header-bg,
.uk-navbar-container,
.uk-navbar-sticky {
    box-shadow: none !important;
}

/* Стили для светлой темы (по умолчанию) - БЕЗ ТЕНИ */
.header-bg {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.burger-lines span {
    background: #333; /* темные линии для светлой темы */
}

.search-icon-btn,
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    color: #333 !important; /* Темный цвет для светлой темы */
}

.theme-icon-img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: none; /* Обычный цвет для светлой темы */
}

.search-svg-icon {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    filter: none; /* Обычный цвет для светлой темы */
}

/* Стили для темной темы - БЕЗ ТЕНИ */
body.dark-theme .header-bg,
html.dark-theme .header-bg {
    background: rgba(30, 30, 30, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .burger-lines span,
html.dark-theme .burger-lines span {
    background: #fff; /* светлые линии для темной темы */
}

body.dark-theme .search-icon-btn,
body.dark-theme .theme-toggle-btn,
html.dark-theme .search-icon-btn,
html.dark-theme .theme-toggle-btn {
    color: #e0e0e0 !important; /* Светлый цвет для темной темы */
}

body.dark-theme .theme-icon-img,
html.dark-theme .theme-icon-img {
    filter: invert(1) hue-rotate(180deg); /* Инвертированный цвет для темной темы */
}

body.dark-theme .search-svg-icon,
html.dark-theme .search-svg-icon {
    filter: invert(1) brightness(1.2); /* Инвертированный цвет для темной темы */
}

/* Fallback для браузеров без поддержки backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .header-bg {
        background: rgba(255, 255, 255, 0.90);
    }
    body.dark-theme .header-bg,
    html.dark-theme .header-bg {
        background: rgba(30, 30, 30, 0.95);
    }
    .new-arrival-label {
        background: rgba(30, 30, 30, 0.95) !important;
    }
}

/* Навбар */
.uk-cover-container + .uk-card-title { margin-top: 4px; }
.uk-navbar-container {
    margin-bottom: 0 !important;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    border-radius: 0 !important;
}
.uk-navbar-sticky.uk-navbar-sticky-slide {
    opacity: 1;
    transform: translateY(0);
}
.uk-navbar-sticky.uk-navbar-sticky-slide.uk-navbar-sticky-out {
    opacity: 0;
    transform: translateY(-30px);
    pointer-events: none;
}

/* Убедимся, что все дочерние элементы navbar тоже прозрачные */
.uk-navbar, .uk-navbar-left, .uk-navbar-right, .uk-navbar-center {
    background: transparent !important;
    border-radius: 0 !important;
}

/* Нотификации */
.uk-notification-message,
.uk-notification-message-success {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    text-align: center;
}

/* ===== Меню и сайд-меню ===== */
.menu-item {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.menu-item:hover {
    background: #ececec;
    color: #111;
}
.menu-item .menu-icon, 
.menu-item svg.menu-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-item img.menu-icon {
    object-fit: contain;
}

/* Бургер и сайд-меню */
.burger-menu-btn {
    background: none;
    border: none;
    padding: 0 10px;
    outline: none;
    cursor: pointer;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
}
.burger-lines {
    display: block;
    width: 28px; height: 19px;
    position: relative;
}
.burger-lines span {
    display: block;
    position: absolute;
    left: 0; width: 100%; height: 3px;
    border-radius: 3px;
    transition: .3s;
}
.burger-lines span:nth-child(1) { top: 0; }
.burger-lines span:nth-child(2) { top: 8px; }
.burger-lines span:nth-child(3) { top: 16px; }
.burger-menu-btn.active .burger-lines span:nth-child(1) {
    transform: rotate(45deg); top: 8px;
}
.burger-menu-btn.active .burger-lines span:nth-child(2) {
    opacity: 0;
}
.burger-menu-btn.active .burger-lines span:nth-child(3) {
    transform: rotate(-45deg); top: 8px;
}
.side-menu-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: transparent !important;
    z-index: 20001;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.side-menu {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    width: 260px;
    background: transparent; /* Было #1E1E1E, меняем на transparent */
    color: #e0e0e0;
    box-shadow: 2px 0 18px rgba(0,0,0,0.26);
    z-index: 20002;
    transform: translateX(-110%);
    transition: transform 0.25s cubic-bezier(.4,1.2,.4,1.0);
    display: flex;
    flex-direction: column;
    padding-top: 0;
}
.side-menu.open {
    transform: translateX(0);
}
.side-menu .menu-item {
    padding: 0 28px;
    font-size: 1.08em;
}
.side-menu .menu-item:hover {
    background: rgba(41, 45, 56, 0.5); /* Было #292d38, делаем полупрозрачным */
    color: #ffe000;
}
.side-menu .menu-icon {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* Цвет иконки смены темы по умолчанию (желтый) */
.menu-item.theme-menu-item .menu-icon {
    filter: invert(89%) sepia(99%) saturate(2000%) hue-rotate(2deg) brightness(1.2) contrast(1.2);
}
.menu-item.theme-menu-item:hover .menu-icon {
    filter: invert(75%) sepia(85%) saturate(3500%) hue-rotate(2deg) brightness(1.4) contrast(1.4);
}

/* Светлая тема для меню */
html.light-theme .side-menu,
body.light-theme .side-menu {
    background: #fff !important;
    color: #222 !important;
}
html.light-theme .side-menu .menu-item {
    color: #222;
}
html.light-theme .side-menu .menu-icon {
    filter: none !important;
}
html.light-theme .menu-item.theme-menu-item .menu-icon {
    filter: invert(75%) sepia(85%) saturate(3500%) hue-rotate(2deg) brightness(1.35) contrast(1.25);
}
html.light-theme .menu-item.theme-menu-item:hover .menu-icon {
    filter: invert(60%) sepia(99%) saturate(3500%) hue-rotate(2deg) brightness(1.45) contrast(1.45);
}
html.light-theme .side-menu .menu-item:hover {
    background: rgba(0, 0, 0, 0.05); /* Заменено #c2c2c2 на полупрозрачный черный */
    color: #383838;
}

/* Тёмная тема: стили иконок и элементов */
html.dark-theme .menu-item.theme-menu-item .menu-icon {
    filter: invert(1) brightness(1.2) !important;
}
html.dark-theme .menu-item.theme-menu-item:hover .menu-icon {
    filter: invert(1) brightness(1.6) !important;
}
html.dark-theme .menu-item.theme-menu-item {
    background: transparent; /* Заменено #1E1E1E на transparent */
    color: #fff;
}
html.dark-theme .menu-item.theme-menu-item:hover {
    background: rgba(255, 255, 255, 0.1); /* Заменено #fff на полупрозрачный белый */
    color: #fff;
}

/* Кастомные чекбоксы */
.quantity-checkboxes {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.custom-checkbox-label {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding-left: 28px;
    font-size: 16px;
}
.custom-checkbox-label input[type="radio"] {
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    margin: 0;
}
.custom-checkbox {
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    border: 2px solid #666;
    border-radius: 4px;
    background: #fff;
}
.custom-checkbox-label input[type="radio"]:checked + .custom-checkbox {
    border-color: #007bff;
    background: #007bff;
}
.custom-checkbox:after {
    content: '';
    position: absolute;
    display: none;
}
.custom-checkbox-label input[type="radio"]:checked + .custom-checkbox:after {
    display: block;
}
.custom-checkbox-label .custom-checkbox:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: '';
    position: absolute;
}

/* --- Бренд: лого + название --- */
.brand-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 2px;
}
.brand-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: grayscale(100%) brightness(0%) saturate(0%) contrast(1000%);
}
.brand-name {
    font-size: 1rem;
    font-weight: 500;
    color: #222;
    line-height: 1;
    letter-spacing: 0.01em;
}
.uk-modal-title {
    color: #333333 !important;
    background: transparent !important;
}

/* Пагинация */
.uk-pagination { margin: 30px 0 10px 0; }
.uk-pagination li.uk-active span,
.uk-pagination li.uk-active a {
    background: #ffe000;
    color: #1a1a1a;
    border-radius: 5px;
    font-weight: bold;
    padding: 3px 11px;
}
.uk-pagination li a,
.uk-pagination li span {
    padding: 2px 8px;
    color: #222;
    border-radius: 4px;
    text-decoration: none;
}
.uk-pagination li.uk-disabled span {
    color: #bbb;
    cursor: not-allowed;
}

/* Разное */
.uk-text-danger { color: #fe2020; }

@media (max-width: 1000px) {
    html, body, .uk-container, .container, .uk-section, .uk-padding-small, .uk-margin, .main, .content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ======================
   UIKIT SELECT BEAUTY
   ====================== */

/* — Базовые стили для селектов фильтра — */
.uk-select {
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
    font-size: 1em;
    background: #f5f5f5;
    color: #222;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
    margin-bottom: 12px;
    margin-top: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
    padding-right: 38px;
}
.uk-select:focus {
    border-color: red;
    outline: none;
    background: #e6e6e6;
}
.uk-form-label {
    font-size: 1em;
    color: #444;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.01em;
}
.uk-margin {
    margin-bottom: 18px;
}

/* ======================
   СВЕТЛАЯ ТЕМА (по умолчанию)
   ====================== */
body {
    background-color: #f8f8f8;
    color: #222;
    font-family: 'Manrope', sans-serif !important;
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }
h2, h3 { background-color: #f8f8f8; }
header { background-color: transparent !important; }
.cart-icon { background-color: #ffffff; }
#preloader { background: #808080; }
.loader span { background-color: #333; }
.store-container {
    background-color: #f8f8f8;
    border: 1px solid #e5e5e5;
}
.no-underline-link {
    text-decoration: none;
    color: #222;
}
.no-underline-link:hover {
    color: #007bff;
    text-decoration: none;
}
.brand-logo { filter: grayscale(100%) brightness(0%) saturate(0%) contrast(1000%); }
.brand-name { color: #222; }

/* ======================
   ТЁМНАЯ ТЕМА (body.dark-theme)
   ====================== */
html.dark-theme,
body.dark-theme {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
}
body.dark-theme #preloader,
body.dark-theme .store-container,
body.dark-theme .uk-modal-dialog,
body.dark-theme .uk-modal-body {
    background-color: #1e1e1e !important;
}
body.dark-theme .store-container {
    border: 1px solid #333;
}
body.dark-theme header,
body.dark-theme header .uk-navbar-container {
    background-color: transparent !important;
}
body.dark-theme header .uk-navbar-item,
body.dark-theme header .uk-navbar-nav > li > a,
body.dark-theme header .uk-navbar-toggle,
body.dark-theme header .search-icon-btn,
body.dark-theme .theme-toggle-btn,
body.dark-theme header .uk-navbar-container [uk-icon] {
    color: #e0e0e0 !important;
}
body.dark-theme header .uk-navbar-item:hover,
body.dark-theme header .uk-navbar-nav > li > a:hover,
body.dark-theme header .uk-navbar-toggle:hover,
body.dark-theme header .search-icon-btn:hover,
body.dark-theme .theme-toggle-btn:hover,
body.dark-theme header .search-icon-btn:hover [uk-icon] {
    color: #ffffff !important;
}
body.dark-theme #modal-search .uk-modal-dialog,
body.dark-theme #modal-search .uk-modal-dialog.uk-modal-body,
body.dark-theme #modal-search .uk-modal-body {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}
body.dark-theme #modal-search .uk-search-input {
    background-color: #333 !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}
body.dark-theme #modal-search .uk-search-input::placeholder {
    color: #888 !important;
}
body.dark-theme h2,
body.dark-theme h3 {
    background-color: transparent;
    color: #e0e0e0;
}
body.dark-theme #preloader { background: #1e1e1e !important; }
body.dark-theme .loader span { background-color: #e0e0e0; }
body.dark-theme .cart-icon {
    background-color: #2c2c2c;
    box-shadow: 0 2px 5px rgba(255,255,255,0.1);
}
body.dark-theme .uk-button-default {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
}
body.dark-theme .uk-button-default:hover,
body.dark-theme .uk-button-default:focus {
    background-color: #444;
    color: #fff;
    border-color: #666;
}
body.dark-theme .uk-card-default {
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
}
body.dark-theme .uk-card-default .uk-card-title {
    color: #e0e0e0;
}
body.dark-theme .uk-input,
body.dark-theme .uk-select,
body.dark-theme .uk-textarea {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
}
body.dark-theme .uk-select {
    background: #232323;
    color: #f5f5f5;
    border: 1px solid #444;
    background-image: url("data:image/svg+xml;utf8,<svg fill='rgba(245,245,245,0.8)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}
body.dark-theme .uk-select:focus {
    border-color: #ffe000;
    outline: none;
    background: #181818;
}
body.dark-theme .uk-input::placeholder,
body.dark-theme .uk-select::placeholder,
body.dark-theme .uk-textarea::placeholder {
    color: #888;
}
body.dark-theme .uk-form-label { color: #e0e0e0; }
body.dark-theme .uk-select option {
    background: #232323;
    color: #f5f5f5;
}
body.dark-theme .uk-select option:disabled {
    color: #888 !important;
    opacity: 1 !important;
}
body.dark-theme .no-underline-link { color: #e3e3e3; }
body.dark-theme .no-underline-link:hover { color: #4eaaff; }
body.dark-theme .brand-logo { filter: grayscale(100%) brightness(200%) saturate(1000%) contrast(1000%) invert(100%); }
body.dark-theme .brand-name { color: #fff; }
body.dark-theme .uk-pagination li a,
body.dark-theme .uk-pagination li span {
    padding: 2px 8px;
    color: #f2f2f2;
    border-radius: 4px;
    text-decoration: none;
}
body.theme-animating {
    transition: background 0s !important;
}
.theme-switch-svg {
    position: fixed;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 20000;
}
.uk-cover-container.uk-border-rounded,
.uk-cover-container img.uk-border-rounded {
    border-radius: 0 !important;
}

/* Принудительно убираем все border-radius и задаём правильный фон для всех элементов в header */
header *,
header *:before,
header *:after {
    border-radius: 0 !important;
}

/* Убедимся, что все элементы UIKit связанные с навбаром будут прозрачными */
.uk-navbar,
.uk-navbar-container,
.uk-navbar-left,
.uk-navbar-right,
.uk-navbar-center,
.uk-navbar-nav,
.uk-navbar-sticky,
[class*="uk-navbar"] {
    background: transparent !important;
    box-shadow: none !important;
}

/* === Стили для просмотра фотографий на странице товара === */

/* Контейнер для всей галереи */
.detail-gallery-container {
    position: relative;
    max-width: 300px; /* Соотношение сторон 3:4 */
    margin: 0 auto 16px;
}

/* Стиль галереи с glassмorphism - соотношение сторон 3:4 */
.detail-gallery {
    position: relative;
    width: 100%;
    height: 400px; /* Соотношение 3:4 (300px ширина : 400px высота) */
    border-radius: 8px;
    overflow: hidden;
}

/* Стиль стекломорфизма для галереи - без тени */
.glassmorphism {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: none; /* Убрана тень */
}

/* Тёмная тема для галереи */
body.dark-theme .glassmorphism {
    background: rgba(30, 30, 30, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Стили для слайдов - исправлено: занимают 100% пространства */
.detail-gallery .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Занимает всю ширину */
    height: 100%; /* Занимает всю высоту */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-gallery .slide.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    z-index: 1;
}

.detail-gallery .slide img.detail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.detail-gallery .slide img.detail-image:hover {
    transform: scale(1.03);
}

/* Стрелки навигации - без круглого фона */
.gallery-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: transparent; /* Прозрачный фон */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: none; /* Без тени */
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-nav-arrow span[uk-icon] {
    color: rgba(0, 0, 0, 0.7);
    filter: drop-shadow(0px 0px 2px rgba(255, 255, 255, 0.8));
}

.gallery-nav-arrow:hover span[uk-icon] {
    color: rgba(0, 0, 0, 0.9);
}

/* Тёмная тема для стрелок */
body.dark-theme .gallery-nav-arrow span[uk-icon] {
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5));
}

/* Счетчик текущего изображения */
.slide-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 15px;
    z-index: 2;
}

/* Миниатюры */
.thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.thumbnails img.thumbnail-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s, opacity 0.2s;
}

.thumbnails img.selected {
    opacity: 1;
    border-color: #007bff;
}

body.dark-theme .thumbnails img.selected {
    border-color: #4eaaff;
    box-shadow: 0 0 5px rgba(78, 170, 255, 0.5);
}

/* Полноэкранный просмотр */
.fullscreen-gallery {
    position: relative;
    width: 95vw;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Кнопка закрытия полноэкранного режима - исправлен отступ сверху */
.fullscreen-close {
    position: absolute;
    top: 80px; /* Увеличен отступ сверху, чтобы не перекрывалась шапкой */
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.fullscreen-close:hover {
    background: rgba(0, 0, 0, 0.5);
}

.fullscreen-close span[uk-icon] {
    color: white;
}

/* Полноэкранные стрелки навигации - без круглого фона */
.fullscreen-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: transparent; /* Прозрачный фон */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.fullscreen-prev {
    left: 30px;
}

.fullscreen-next {
    right: 30px;
}

.fullscreen-arrow span[uk-icon] {
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.5));
}

.fullscreen-arrow:hover span[uk-icon] {
    filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.7));
}

/* Кнопка "добавить в корзину" со стилем стекломорфизма */
.cart-btn-glass {
    display: block;
    width: 260px;
    margin-top: 20px;
    background: rgba(30, 30, 30, 0.7); /* Полупрозрачный фон */
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    padding: 13px 0;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-btn-glass:hover,
.cart-btn-glass:focus {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* Версия кнопки для светлой темы */
body:not(.dark-theme) .cart-btn-glass {
    background: rgba(0, 123, 255, 0.7); /* Синеватый полупрозрачный фон */
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body:not(.dark-theme) .cart-btn-glass:hover,
body:not(.dark-theme) .cart-btn-glass:focus {
    background: rgba(0, 105, 217, 0.85);
}

/* Центрирование модального окна с выбором размеров */
#size-modal .uk-modal-dialog {
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
    width: 100%;
    max-width: 320px;
    transform: translateY(0);
    top: 50%;
    transform: translateY(-50%);
}

/* Улучшенное центрирование и стилизация модального окна */
.uk-modal-dialog {
    border-radius: 8px;
    padding: 20px;
}

body.dark-theme .uk-modal-dialog {
    background: #1e1e1e;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Цвет заголовка в модальном окне для темной темы */
body.dark-theme .uk-modal-title {
    color: #ffffff !important;
}

/* Для адаптивности на мобильных устройствах */
@media (max-width: 640px) {
    .detail-gallery-container {
        max-width: 270px;
    }
    
    .detail-gallery {
        height: 360px; /* Сохраняем соотношение 3:4 (270px : 360px) */
    }
    
    .gallery-nav-arrow {
        width: 36px;
        height: 36px;
    }
    
    .fullscreen-arrow {
        width: 40px;
        height: 40px;
    }
    
    .fullscreen-prev {
        left: 10px;
    }
    
    .fullscreen-next {
        right: 10px;
    }
    
    .fullscreen-close {
        top: 70px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .cart-btn-glass {
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    #size-modal .uk-modal-dialog {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Увеличение отступа для кнопок фильтра на мобильных устройствах */
@media (max-width: 640px) {
    #filter-modal .uk-margin.uk-margin-large-top {
        margin-top: 30px !important;
    }
    
    /* Если предыдущий селектор не работает, используйте этот, более общий */
    #filter-modal form > div:last-child {
        margin-top: 30px !important;
        padding-top: 15px !important;
    }
    
    /* Дополнительные селекторы для лучшего охвата */
    input[name="price_to"],
    input.price-to-input,
    .filter-form-price-to,
    .price-inputs input:last-of-type,
    .filter-form .input-wrapper:last-child input {
        margin-bottom: 25px !important;
    }
    
    /* Стили для кнопок в фильтрах */
    .filter-buttons-container,
    .filter-form-actions,
    .form-actions,
    form > .uk-grid:last-child {
        margin-top: 55px !important;
        padding-top: 15px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Специфические стили для кнопок в мини-приложении Telegram */
    .telegram-webview form > [style*="display: flex"]:last-child {
        margin-top: 25px !important;
    }
}

/* Добавьте эти стили в ваш CSS файл */
body {
    -webkit-user-select: none;  /* Safari */
    -ms-user-select: none;      /* IE 10+ и Edge */
    user-select: none;          /* Стандартный синтаксис */
}
/* =============================================
   РЕШЕНИЕ ДЛЯ ИКОНОК В ПОЛНОЭКРАННОМ РЕЖИМЕ
   ============================================= */

/* СВЕТЛАЯ ТЕМА: черные иконки на светлом фоне */

/* Фон кнопки закрытия в светлой теме + тень для читаемости */
html:not(.dark-theme) .fullscreen-close {
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
}

html:not(.dark-theme) .fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.9) !important;
}

/* Делаем иконки черными в светлой теме */
html:not(.dark-theme) .fullscreen-close span[uk-icon],
html:not(.dark-theme) .fullscreen-arrow span[uk-icon],
html:not(.dark-theme) .zoom-controls span[uk-icon],
html:not(.dark-theme) .zoom-in-btn span[uk-icon],
html:not(.dark-theme) .zoom-out-btn span[uk-icon],
html:not(.dark-theme) .zoom-rotate-btn span[uk-icon] {
    color: #000 !important;
}

/* Более сильные селекторы для всех иконок в полноэкранном режиме в светлой теме */
html:not(.dark-theme) #fullscreen-modal .uk-icon svg,
html:not(.dark-theme) #fullscreen-modal span[uk-icon] svg,
html:not(.dark-theme) #fullscreen-modal .uk-icon path,
html:not(.dark-theme) #fullscreen-modal .uk-icon line,
html:not(.dark-theme) #fullscreen-modal .uk-icon circle,
html:not(.dark-theme) #fullscreen-modal .uk-icon polyline {
    stroke: #000 !important;
    color: #000 !important;
    fill: none !important;
}

/* Также добавим тень для стрелок в светлой теме, чтобы были более заметны */
html:not(.dark-theme) .fullscreen-arrow span[uk-icon] {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5)) !important;
}

/* Стили для фона элементов управления увеличением в светлой теме */
html:not(.dark-theme) .zoom-controls > div {
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
}

html:not(.dark-theme) .zoom-controls > div:hover {
    background: rgba(255, 255, 255, 0.9) !important;
}

/* Специальные стили для конкретных элементов управления зумом */
html:not(.dark-theme) .zoom-in-btn,
html:not(.dark-theme) .zoom-out-btn,
html:not(.dark-theme) .zoom-rotate-btn {
    background: rgba(255, 255, 255, 0.0) !important;
}

html:not(.dark-theme) .zoom-in-btn:hover,
html:not(.dark-theme) .zoom-out-btn:hover,
html:not(.dark-theme) .zoom-rotate-btn:hover {
    background: rgba(255, 255, 255, 0.0) !important;
}

/* Уровень зума в светлой теме */
html:not(.dark-theme) .zoom-controls .zoom-level {
    color: #000 !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* ТЕМНАЯ ТЕМА: белые иконки на темном фоне */

/* Фон кнопки закрытия в темной теме */
html.dark-theme .fullscreen-close,
body.dark-theme .fullscreen-close {
    background: rgba(0, 0, 0, 0.7) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
}

html.dark-theme .fullscreen-close:hover,
body.dark-theme .fullscreen-close:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Делаем иконки белыми в темной теме */
html.dark-theme .fullscreen-close span[uk-icon],
body.dark-theme .fullscreen-close span[uk-icon],
html.dark-theme .fullscreen-arrow span[uk-icon],
body.dark-theme .fullscreen-arrow span[uk-icon],
html.dark-theme .zoom-controls span[uk-icon],
body.dark-theme .zoom-controls span[uk-icon],
html.dark-theme .zoom-in-btn span[uk-icon],
body.dark-theme .zoom-in-btn span[uk-icon],
html.dark-theme .zoom-out-btn span[uk-icon],
body.dark-theme .zoom-out-btn span[uk-icon],
html.dark-theme .zoom-rotate-btn span[uk-icon],
body.dark-theme .zoom-rotate-btn span[uk-icon] {
    color: #fff !important;
}

/* Более сильные селекторы для всех иконок в полноэкранном режиме в темной теме */
html.dark-theme #fullscreen-modal .uk-icon svg,
body.dark-theme #fullscreen-modal .uk-icon svg,
html.dark-theme #fullscreen-modal span[uk-icon] svg,
body.dark-theme #fullscreen-modal span[uk-icon] svg,
html.dark-theme #fullscreen-modal .uk-icon path,
body.dark-theme #fullscreen-modal .uk-icon path,
html.dark-theme #fullscreen-modal .uk-icon line,
body.dark-theme #fullscreen-modal .uk-icon line,
html.dark-theme #fullscreen-modal .uk-icon circle,
body.dark-theme #fullscreen-modal .uk-icon circle,
html.dark-theme #fullscreen-modal .uk-icon polyline,
body.dark-theme #fullscreen-modal .uk-icon polyline {
    stroke: #fff !important;
    color: #fff !important;
    fill: none !important;
}

/* Стили для фона элементов управления в темной теме */
html.dark-theme .zoom-controls > div,
body.dark-theme .zoom-controls > div {
    background: rgba(0, 0, 0, 0.7) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
}

html.dark-theme .zoom-controls > div:hover,
body.dark-theme .zoom-controls > div:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Уровень зума в темной теме */
html.dark-theme .zoom-controls .zoom-level,
body.dark-theme .zoom-controls .zoom-level {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Добавление теней для лучшей видимости элементов на разном фоне */
html.dark-theme .fullscreen-arrow span[uk-icon],
body.dark-theme .fullscreen-arrow span[uk-icon] {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.7)) !important;
}

/* Fix list divider color in dark theme to match light theme */
body.dark-theme .uk-list-divider > li {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .uk-list-divider > li:first-child,
html.dark-theme .uk-list-divider > li:first-child {
    border-top: none !important;
}

/* Also fix border color for card dividers and other common dividers */
body.dark-theme .uk-divider-small::after,
html.dark-theme .uk-divider-small::after {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .uk-divider-icon::before,
body.dark-theme .uk-divider-icon::after,
html.dark-theme .uk-divider-icon::before,
html.dark-theme .uk-divider-icon::after {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Fix other border elements in dark theme */
body.dark-theme .uk-card,
body.dark-theme .uk-card-default,
html.dark-theme .uk-card,
html.dark-theme .uk-card-default {
    border-color: rgba(255, 255, 255, 0.1) !important;
}