/* ==========================================================================
   STRUCTURAL THEME STYLES - SPECLED
   (Только геометрия, сетки и анимации. Цвета вынесены в custom.css)
   ========================================================================== */

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-header .navbar {
    min-height: 64px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.site-header .nav-link {
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px;
}

.header-icon-btn {
    font-size: 1.15rem;
    padding: 6px 8px;
    border-radius: 8px;
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(40%, -30%);
}

/* ===== TOOLBAR (LANGUAGES + CURRENCIES) ===== */
.header-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switcher-group {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 20px;
    padding: 3px;
}

.switcher-btn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 16px;
    border: none;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ===== SMART SEARCH ===== */
.search-container {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.search-item:hover {
    background-color: #f8f9fa;
}

.search-item-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    padding: 4px;
}

.search-item-info {
    flex-grow: 1;
    min-width: 0;
}

.search-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    color: #000000 !important;
}

.search-item-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: #000000 !important;
}

/* ===== SMART SEARCH SKELETON ===== */
@keyframes skeleton-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.skeleton {
    animation: skeleton-pulse 1.2s infinite ease-in-out;
    background-color: #e2e8f0;
    /* Нейтральный серый для скелетона */
    border-radius: 4px;
    display: block;
}

.skeleton-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px !important;
}

.skeleton-text {
    height: 12px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
    margin-bottom: 0;
}

/* ===== CART (SIDE FLOATING CARD) ===== */
.cart-drawer {
    position: fixed;
    top: 20px;
    right: -420px;
    width: 380px;
    max-height: calc(100vh - 40px);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
}

@media (max-width: 450px) {
    .cart-drawer {
        width: calc(100% - 30px);
        right: -110%;
        top: 15px;
        max-height: calc(100vh - 30px);
    }
}

.cart-drawer.open {
    right: 20px;
}

@media (max-width: 450px) {
    .cart-drawer.open {
        right: 15px;
    }
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1999;
    display: none;
}

.cart-overlay.show {
    display: block;
}

.cart-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 700;
}

/* ===== FOOTER ===== */
.site-footer {
    padding: 3rem 0 0;
}

.footer-links-sm {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-sm li {
    margin-bottom: 6px;
}

.footer-links-sm a {
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-contact-sm p {
    font-size: 0.8rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.logo-text-footer {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.social-icon-footer {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    text-decoration: none;
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
    position: relative;
    z-index: 9999;
}

.footer-bottom-link {
    display: inline-block !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 30px;
}

/* ===== JS ANIMATIONS (CART) ===== */
.btn-added-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
    transition: all 0.3s ease;
}

.fly-to-cart-img {
    position: fixed;
    z-index: 9999;
    object-fit: cover;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in;
}

.cart-bump {
    animation: bumpCart 0.3s ease-out;
}

@keyframes bumpCart {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== WYSIWYG CONTENT (TABLES & IMAGES) ===== */
.table-swipe-hint {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    background:
        linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to left, white 30%, rgba(255, 255, 255, 0)) 100% 0,
        radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)) 100% 0;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

.content-render table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    word-break: normal !important;
    margin-bottom: 1.5rem;
    border-collapse: collapse !important;
    border: 1px solid #dee2e6 !important;
}

.content-render table th,
.content-render table td {
    min-width: 140px;
    vertical-align: top;
    border: 1px solid #dee2e6 !important;
    padding: 0.75rem 1rem !important;
}

.content-render table td:first-child,
.content-render table th:first-child {
    min-width: 90px;
}

.content-render table thead th {
    font-weight: 700 !important;
    border-bottom-width: 2px !important;
}

.content-render img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    margin: 1rem 0;
}

/* Активация зума спустя 1.5 секунды (Zoom-In) */
body.zoom-ready .product-card:hover {
    transform: scale(1.05) !important;
}

/* Mobile Menu Scroll Fix */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
}