/*
Theme Name: SiLSiLA Market
Theme URI: https://silsila.market/
Author: SiLSiLA Market
Description: Самостоятельная тема магазина для плагина My Shop.
Version: 1.0.11
Text Domain: silsila-market
*/

/* Сброс стилей (Reset) остается для корректной работы во всех браузерах */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}
body{line-height:1}
ol,ul{list-style:none}
*{box-sizing:border-box}

/* Ваши кастомные стили пишите ниже */

/* Единые нативные shimmer-заглушки карточек товаров */
.skeleton-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(25, 35, 50, .04);
}

.skeleton-media,
.skeleton-line {
    display: block;
    background: linear-gradient(100deg, #edf0f3 20%, #f8f9fb 42%, #edf0f3 64%);
    background-size: 220% 100%;
    animation: silsila-skeleton-shimmer 1.35s ease-in-out infinite;
}

.skeleton-media {
    flex: 0 0 auto;
    width: calc(100% - 16px);
    aspect-ratio: 3 / 4;
    margin: 8px 8px 0;
    border-radius: 12px;
}

.skeleton-content {
    display: grid;
    gap: 9px;
    padding: 12px;
}

.skeleton-line {
    height: 11px;
    border-radius: 999px;
}

.skeleton-line--title { width: 90%; height: 13px; }
.skeleton-line--short { width: 62%; }
.skeleton-line--price { width: 46%; height: 16px; margin-top: 2px; }
.skeleton-line--button { width: 100%; height: 34px; margin-top: 2px; border-radius: 10px; }

.myshop-grid-state {
    grid-column: 1 / -1;
    padding: 34px 18px;
    color: #747b86;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

@keyframes silsila-skeleton-shimmer {
    to { background-position-x: -220%; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-media,
    .skeleton-line {
        animation: none;
    }
}


/* Основной блок заголовка */
.top-header {
    /* Современный градиент с мягкими цветами */
    background-color: #FF8800;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important;
    width: 100% !important; 
    z-index: 1000 !important; 
    
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;

    /* ВАЖНО: заменяем overflow: hidden на visible */
    overflow: visible !important; 
}

/* Чтобы скругление углов работало при фоне, но не резало выпадашку */
.top-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    z-index: -1; /* Фон уходит назад */
}


/* ИСПРАВЛЕНО: Отступ действует только на страницах, где ЕСТЬ .top-header */
body:has(.top-header) {
    padding-top: 90px !important; 
}


/* Если пользователь авторизован, сдвигаем шапку вниз под админ-бар */
.admin-bar .top-header {
    top: 32px !important; /* В 2026 году стандарт 32px, подправил под актуальный WP */
}

/* На мобильных устройствах (ширина экрана меньше 782px) админ-бар становится выше */
@media screen and (max-width: 782px) {
    .admin-bar .top-header {
        top: 46px !important;
    }
}

/* На очень маленьких экранах админ-панель может вести себя иначе (position: absolute) */
@media screen and (max-width: 600px) {
    #wpadminbar {
        position: fixed !important;
    }
}



/* Скрываем шапку на странице со слагом products */
.path-products .top-header, 
.page-id-products .top-header,
body.page-template-default.page.page-id-XX .top-header { /* замените XX на ID страницы, если слаг не сработает */
    display: none !important;
}

/* Контейнер заголовка */
.top-header .container {
    display: flex !important; 
    flex-wrap: wrap !important; /* ПОЗВОЛЯЕТ АДРЕСУ ВСТАТЬ НАД ПОИСКОМ */
    align-items: center !important; 
    /* РАСПРЕДЕЛЯЕМ ЭЛЕМЕНТЫ С РАВНЫМИ ПРОМЕЖУТКАМИ */
    justify-content: space-between !important; 
    max-width: 1200px; 
    margin: 0 auto; 
    /* Отступ от края экрана до первой/последней иконки (например, 15px) */
    padding: 0 15px !important; 
}

/* ⚡️ СТРОКА АДРЕСА */
.header-delivery-row {
    width: 100% !important;
    order: 1; /* Всегда сверху */
    padding-bottom: 8px; /* Зазор между адресом и поиском */
}

/* Убираем лишние зазоры у элементов внутри */
.top-header h1, 
.top-header p {
    margin: 0 !important;
    color: #fff !important; 
}

/* ⚡️ УВЕДОМЛЕНИЯ (СЛЕВА) */
.notifications-wrapper {
    order: 2;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important; /* Обнуляем лишние отступы */
}

/* ⚡️ ОБЕРТКА ПОИСКА (ЦЕНТР) */
.search-wrapper {
    order: 3;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    /* ОДИНАКОВЫЕ ОТСТУПЫ СЛЕВА И СПРАВА ОТ ПОИСКА */
    margin: 0 15px !important; 
}

/* Контейнер для строки поиска */
.top-header .search-inner {
    position: relative !important;
    width: 100% !important;
}

/* Стили для поля ввода */
.top-header .search-inner input {
    width: 100% !important; 
    padding: 8px 35px 8px 12px !important;  
    font-size: 16px !important; 
    border: 1px solid #ccc !important; 
    border-radius: 8px !important; 
    background: #fff;
    outline: none;
}

/* Кнопка очистки поиска */
.top-header .search-inner .clear-search {
    position: absolute !important;
    right: 45px !important; 
    background: none !important;
    border: none !important;
    font-size: 30px !important; 
    cursor: pointer !important;
    display: block !important; 
}

/* Кнопка отправки поиска (лупа) */
.top-header .search-inner .search-submit {
    background-color: transparent !important; 
    border: none !important;
    padding: 0 10px !important; 
    cursor: pointer !important; 
    font-size: 17px !important; 
    position: absolute !important; 
    right: 0 !important; 
    top: 50% !important; 
    transform: translateY(-50%) !important; 
    z-index: 1 !important; 
    transition: transform 0.2s ease-in-out !important; 
}

/* Иконка лупы */
.top-header .search-inner .search-submit i {
    color: #007AFF !important; 
    font-size: 20px !important; 
    transition: color 0.2s ease-in-out !important; 
}

/* Изменение цвета и размера при наведении */
.top-header .search-inner .search-submit:hover i {
    color: #ff8800 !important; 
    transform: scale(1.1) !important; 
}

/* Плейсхолдер в строке поиска */
.top-header .search-inner input::placeholder {
    color: #333 !important; 
    font-style: normal !important; 
    font-weight: normal !important; 
}

/* ⚡️ КНОПКА МЕНЮ (СПРАВА) */
.menu-toggle {
    order: 4; /* СТАВИТ МЕНЮ ПОСЛЕ ПОИСКА */
    background: none !important;
    border: none !important;
    font-size: 27px !important; 
    color: #ffffff !important; 
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    /* Обнуляем margin, так как gap регулируется через search-wrapper */
    margin: 0 !important; 
    padding: 0 !important;
}

/* Изменение цвета кнопки при наведении */
.menu-toggle:hover {
    color: #ff3300 !important;
}


/* Сброс цвета, если кнопка в фокусе, но меню закрыто */
.menu-toggle:focus {
    outline: none !important;
}

/* Убираем системную синюю/серую рамку при нажатии на смартфонах */
.menu-toggle {
    -webkit-tap-highlight-color: transparent !important;
}

/* Если меню закрыто (нет класса open у шторки), кнопка должна быть белой */
body:not(.menu-open) .menu-toggle {
    color: #ffffff !important;
}


/* Мобильная версия - фиксы расстояний */
@media (max-width: 480px) {
    .top-header .container {
        padding: 0 12px !important;
    }
    .search-wrapper {
        margin: 0 12px !important; /* Уменьшаем зазоры на маленьких экранах */
    }
    .top-header .search-inner input {
        padding-right: 35px !important; 
    }
}



/* Контейнер шторки */
.nav.sidenav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transform: translateX(100%); /* Скрыто справа */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 60px 15px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.nav.sidenav.open { transform: translateX(0); }

/* Оверлей */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 10000;
    visibility: hidden; opacity: 0;
    transition: 0.3s ease;
}
.overlay.open { visibility: visible; opacity: 1; }

/* Элементы управления */
.swipe-handle { width: 40px; height: 5px; background: #eee; border-radius: 10px; margin: -30px auto 20px; }
.nav.sidenav .closebtn { position: absolute; top: 15px; left: 15px; font-size: 26px; color: #999; cursor: pointer; }

/* Стили кнопок */
.myshop-custom-menu a {
    display: flex; align-items: center; padding: 14px 16px;
    background: #f2f2f7; border-radius: 14px; margin-bottom: 8px;
    text-decoration: none; color: #1c1c1e; font-weight: 500;
}
.myshop-custom-menu a i { width: 25px; color: #FF8800; margin-right: 10px; text-align: center; }
.myshop-custom-menu a.menu-user-link i,
.myshop-custom-menu a.menu-login-link i,
.myshop-custom-menu a.menu-logout-link i { color: #007AFF; }
.menu-logout-link { color: #007AFF !important; border-top: 1px solid #eee; margin-top: 10px !important; padding-top: 20px !important; background: transparent !important; }

@media (max-width: 480px) { .nav.sidenav { width: 80%; } }
body.menu-open { overflow: hidden; }












/**
 * KORVON-STLYES: BOTTOM-NAV 2026
 * Путь: style.css
 * Обновление: Исправлена ширина (устранение горизонтальной прокрутки)
 */

/* Контейнер нижнего меню */ 
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0; /* Вместо width: 100% используем привязку к обоим краям */
    width: 100%;
    max-width: 100vw; /* Гарантируем, что не шире экрана */
    background: #ffffff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 9999;
    box-sizing: border-box; /* Важно: padding не увеличивает ширину */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    /* Устранение случайных сдвигов */
    margin: 0;
    overflow: hidden; 
}

.menu-item {
    position: relative;
    text-align: center;
    font-size: 11px; /* Чуть меньше для мобильных 2026 */
    color: #999999; 
    text-decoration: none !important; 
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    outline: none; 
    -webkit-tap-highlight-color: transparent; 
}

.menu-item i {
    display: block;
    font-size: 20px; 
    margin-bottom: 2px; 
}
.bottom-menu .menu-item--button {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
.bottom-menu .menu-shop-link svg {width:20px; height:20px; flex:0 0 auto; margin-bottom:2px;}
.bottom-menu.has-shop-link .menu-item {min-width:0; min-height:44px; font-size:10px;}
.bottom-menu.has-shop-link .menu-item > span {max-width:100%;}

.staff-panel-choice[hidden] { display: none !important; }
.staff-panel-choice {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, .44);
}
.staff-panel-choice__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: transparent;
}
.staff-panel-choice__sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 600px);
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
    border: 1px solid #e7ebf0;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -8px 30px rgba(20, 35, 55, .18);
}
.staff-panel-choice__handle {
    width: 38px;
    height: 4px;
    margin: 0 auto 16px;
    border-radius: 4px;
    background: #d9dee6;
}
.staff-panel-choice__sheet h2 {
    margin: 0 0 14px;
    color: #19212d;
    font-size: 19px;
    font-weight: 700;
}
.staff-panel-choice__sheet > a {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    margin: 0 0 9px;
    padding: 10px 12px;
    border: 1px solid #e7ebf0;
    border-radius: 14px;
    color: #19212d;
    text-decoration: none;
}
.staff-panel-choice__sheet > a > i:first-child {
    width: 22px;
    color: #007aff;
    text-align: center;
}
.staff-panel-choice__sheet > a > i:last-child {
    color: #687384;
    font-size: 13px;
}
.staff-panel-choice__sheet > a span { display: grid; flex: 1; gap: 3px; }
.staff-panel-choice__sheet > a small { color: #687384; font-size: 12px; }
.staff-panel-choice__cancel {
    width: 100%;
    min-height: 46px;
    margin-top: 2px;
    border: 1px solid #e7ebf0;
    border-radius: 12px;
    background: #fff;
    color: #19212d;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
}

/* Активный пункт */
.menu-item.active {
    color: #ff8800 !important; 
    font-weight: 600;
}

.myshop-custom-menu a.menu-core-link i {
    color: #ff8800;
}

/* СТИЛИ ДЛЯ СЧЕТЧИКОВ (Сдвиг зафиксирован) */
.menu-item .wish-count-badge, 
.menu-item .cart-count-badge {
    position: absolute;
    top: -5px; 
    left: 50%;
    transform: translateX(8px); /* Точный сдвиг вправо от центра */
    background: #ff4757; 
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    display: flex; 
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* Овал для двузначных чисел */
    padding: 0 4px;
    z-index: 10;
    border: 2px solid #ffffff; 
    box-sizing: border-box;
    pointer-events: none; /* Чтобы бадж не мешал клику */
}

/* Мобильный фикс для iPhone и Android */
@media (max-width: 480px) {
    .bottom-menu {
        padding-top: 6px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    .menu-item { font-size: 10px; }
}

