/*
 Theme Name: yourtheme
 Theme URI: https://ttj.cz
 Author: Mik
 Author URI: https://ttj.cz
 Description: Modern E-Commerce Affiliate Theme for 81gr.com
 Version: 2.2
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: your-theme
 Domain Path: /languages
*/

/* Design tokens */
:root {
    --yourtheme-accent: #2563eb;
    --yourtheme-accent-dark: #1d4ed8;
    --yourtheme-accent-soft: rgba(37, 99, 235, 0.08);
    --yourtheme-header-gradient-start: #0f172a;
    --yourtheme-header-gradient-end: #1e293b;
    --yourtheme-header-text: #ffffff;
    --yourtheme-header-overlay-opacity: 0.95;
    --yourtheme-body-bg: #f8fafc;
    --yourtheme-surface: #ffffff;
    --yourtheme-border: #e2e8f0;
    --yourtheme-border-subtle: #f1f5f9;
    --yourtheme-text-main: #0f172a;
    --yourtheme-text-muted: #64748b;
    --yourtheme-radius-sm: 8px;
    --yourtheme-radius-md: 12px;
    --yourtheme-radius-lg: 16px;
    --yourtheme-radius-full: 9999px;
    --yourtheme-shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    --yourtheme-shadow-card-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--yourtheme-body-bg, #f8fafc);
    color: var(--yourtheme-text-main, #0f172a);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--yourtheme-accent, #2563eb);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--yourtheme-accent-dark, #1d4ed8);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 14px 0;
    background-color: #0f172a;
    background: linear-gradient(120deg, var(--yourtheme-header-gradient-start, #0f172a), var(--yourtheme-header-gradient-end, #1e293b));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    color: var(--yourtheme-header-text, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 1560px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

/* Site Branding */
.site-branding {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.site-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--yourtheme-accent, #2563eb), #60a5fa);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    flex-shrink: 0;
}

.site-logo-icon svg {
    stroke: #ffffff;
}

.site-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.site-title a {
    color: var(--yourtheme-header-text, #ffffff) !important;
    text-decoration: none;
}

/* Desktop Navigation */
.main-navigation {
    margin: 0;
}

.main-navigation > ul,
.main-navigation > .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    border-radius: var(--yourtheme-radius-full, 9999px);
    transition: all 0.2s ease;
}

.main-navigation a:hover,
.main-navigation li.current-menu-item > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.main-navigation .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: none;
    padding: 8px;
    z-index: 1000;
    border-radius: var(--yourtheme-radius-md, 12px);
    min-width: 180px;
}

.main-navigation li:hover > .sub-menu {
    display: block;
}

.main-navigation .sub-menu a {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: var(--yourtheme-radius-sm, 8px);
    font-size: 0.88rem;
}

.main-navigation .sub-menu a:hover {
    color: #ffffff;
    background: var(--yourtheme-accent, #2563eb);
}

/* Mobile Toggle Button */
.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--yourtheme-radius-sm, 8px);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 0 0 auto !important;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.nav-open .mobile-nav-overlay {
    display: block;
    opacity: 1;
}

/* Page Layout Structure */
.container {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    margin: 0 auto !important;
    max-width: 1560px !important;
    width: 100% !important;
    padding: 32px 24px 60px !important;
    gap: 36px !important;
}

#primary {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

#secondary {
    width: 320px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Article Reset for standard pages and single view */
.page article,
.single article,
article.type-page {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.page .entry-content,
.single .entry-content,
.entry-content {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Sidebar Widgets */
#secondary .widget-area,
.csv-sidebar-widget {
    background: #ffffff !important;
    border: 1px solid var(--yourtheme-border, #e2e8f0) !important;
    border-radius: var(--yourtheme-radius-lg, 16px) !important;
    padding: 24px !important;
    box-shadow: var(--yourtheme-shadow-card) !important;
    position: sticky !important;
    top: 86px !important;
}

.csv-sidebar-widget h3,
.widget-title {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--yourtheme-text-muted, #64748b) !important;
    margin: 20px 0 10px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid var(--yourtheme-border-subtle, #f1f5f9) !important;
}

.csv-sidebar-widget h3:first-of-type {
    margin-top: 0 !important;
}

/* Sidebar Search */
.csv-search-widget {
    margin-bottom: 24px !important;
}

.csv-search-wrap {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
}

.csv-search-field {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    padding: 10px 14px !important;
    border: 1px solid var(--yourtheme-border, #e2e8f0) !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    font-size: 0.88rem !important;
    color: var(--yourtheme-text-main, #0f172a) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.csv-search-field:focus {
    background: #ffffff !important;
    border-color: var(--yourtheme-accent, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.csv-search-btn {
    padding: 10px 16px !important;
    background: var(--yourtheme-accent, #2563eb) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: background 0.2s ease !important;
}

.csv-search-btn:hover {
    background: var(--yourtheme-accent-dark, #1d4ed8) !important;
}

/* Sidebar Lists: Brands and Categories */
.csv-sidebar-widget ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.csv-sidebar-widget ul li {
    margin: 3px 0 !important;
}

.sidebar-item-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 7px 10px !important;
    border-radius: var(--yourtheme-radius-sm, 8px) !important;
    color: #334155 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.sidebar-item-link:hover {
    background: #f1f5f9 !important;
    color: var(--yourtheme-accent, #2563eb) !important;
}

.sidebar-item-link.is-active {
    background: #eff6ff !important;
    color: var(--yourtheme-accent, #2563eb) !important;
    font-weight: 700 !important;
}

.sidebar-item-name {
    flex-grow: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sidebar-item-count {
    flex-shrink: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: #f1f5f9 !important;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    margin-left: 8px !important;
}

.sidebar-item-link:hover .sidebar-item-count {
    background: #e0e7ff !important;
    color: var(--yourtheme-accent, #2563eb) !important;
}

.sidebar-item-link.is-active .sidebar-item-count {
    background: #dbeafe !important;
    color: var(--yourtheme-accent, #2563eb) !important;
}

.csv-sidebar-widget ul ul {
    margin-left: 12px !important;
    padding-left: 8px !important;
    border-left: 2px solid var(--yourtheme-border-subtle, #f1f5f9) !important;
}

/* Sidebar Select Box */
.brand-select {
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid var(--yourtheme-border-subtle, #f1f5f9) !important;
}

.brand-select label {
    display: block !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--yourtheme-text-muted, #64748b) !important;
    margin-bottom: 6px !important;
}

.brand-select select,
.csv-sidebar-widget select {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid var(--yourtheme-border, #e2e8f0) !important;
    border-radius: var(--yourtheme-radius-sm, 8px) !important;
    background-color: #ffffff !important;
    font-size: 0.88rem !important;
    color: #334155 !important;
}

/* Scroll To Top */
#scroll-to-top {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--yourtheme-accent, #2563eb);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#scroll-to-top:hover {
    background: var(--yourtheme-accent-dark, #1d4ed8);
    transform: translateY(-3px);
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 36px 24px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
    margin: 0;
}

footer a {
    color: #cbd5e1;
    font-weight: 500;
}

/* Responsive Media Queries */
@media (max-width: 1080px) {
    .container {
        flex-direction: column !important;
        padding: 24px 16px 40px !important;
        gap: 28px !important;
    }

    #secondary {
        width: 100% !important;
        max-width: 100% !important;
    }

    .csv-sidebar-widget {
        position: static !important;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .site-branding {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        gap: 8px !important;
    }

    .site-title {
        font-size: clamp(0.95rem, 3.8vw, 1.25rem) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .menu-toggle {
        display: inline-flex !important;
        margin-left: 12px !important;
        flex-shrink: 0 !important;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(85vw, 340px);
        height: 100vh;
        background: #0f172a;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 60px 24px 30px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
        z-index: 999;
        transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    .main-navigation.open {
        right: 0;
    }

    .main-navigation > ul,
    .main-navigation > .menu {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        gap: 4px;
    }

    .main-navigation a {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}