/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

:root {
    --primary-color: #0ea5e9;
    --secondary-color: #14b8a6;
    --accent-color: #f97316;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --border-color: #cbd5e1;
    --success-color: #14b8a6;
    --error-color: #ef4444;
    --spacing-unit: 1rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    background-attachment: fixed;
    font-size: 16px;
}

p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    width: 100%;
    overflow: visible;
    transition: box-shadow 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.logo:hover {
    transform: translateY(-2px);
    background: rgba(14, 165, 233, 0.05);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0284c7 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, #0284c7 0%, var(--primary-color) 100%);
}

.logo:hover .logo-icon svg {
    transform: scale(1.1);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    display: block;
}

.logo-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -2px;
}

.logo:hover .logo-main {
    color: #0284c7;
}

.logo:hover .logo-sub {
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem;
    display: block;
}

nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after,
nav a:focus::after,
nav a.active::after {
    width: 80%;
}

nav a:hover,
nav a:focus,
nav a.active {
    color: var(--primary-color);
    outline: none;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: all 0.3s;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 200px);
    margin-top: 90px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    border-radius: 16px;
    margin-bottom: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 20s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    line-height: 1.8;
}

/* Service Tiles */
.service-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.service-tile {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
    overflow: hidden;
}

.service-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.service-tile:hover::before,
.service-tile:focus::before {
    transform: scaleX(1);
}

.service-tile:hover,
.service-tile:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    outline: none;
}

.service-tile h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.service-tile.sprzatanie { 
    border-left: 5px solid #14b8a6;
    background: linear-gradient(to right, rgba(20, 184, 166, 0.05) 0%, transparent 100%);
}
.service-tile.naprawy { 
    border-left: 5px solid #f97316;
    background: linear-gradient(to right, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
}
.service-tile.hydraulik { 
    border-left: 5px solid #0ea5e9;
    background: linear-gradient(to right, rgba(14, 165, 233, 0.05) 0%, transparent 100%);
}
.service-tile.elektryk { 
    border-left: 5px solid #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}
.service-tile.montaz { 
    border-left: 5px solid #8b5cf6;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
}
.service-tile.malowanie { 
    border-left: 5px solid #ec4899;
    background: linear-gradient(to right, rgba(236, 72, 153, 0.05) 0%, transparent 100%);
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.card h3 {
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

/* Checklist */
.checklist {
    list-style: none;
    margin: 1rem 0;
}

.checklist li {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    line-height: 1.6;
}

.checklist li > * {
    margin: 0;
    padding: 0;
}

.checklist li::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.checklist li:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
    background: rgba(14, 165, 233, 0.05);
}

.checklist li:hover::after {
    transform: scaleY(1);
}

.checklist li::before {
    content: "";
    width: 6px;
    height: 6px;
    min-width: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
    margin-top: 0.5em;
    align-self: flex-start;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Regular lists (ul, ol) */
ul:not(.checklist):not(nav ul):not(.sidebar-nav ul):not(.footer-section ul),
ol:not(.checklist) {
    margin: 1rem 0;
    padding-left: 2rem;
    line-height: 1.8;
}

ul:not(.checklist):not(nav ul):not(.sidebar-nav ul):not(.footer-section ul) li,
ol:not(.checklist) li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

ul:not(.checklist):not(nav ul):not(.sidebar-nav ul):not(.footer-section ul) li::marker,
ol:not(.checklist) li::marker {
    color: var(--primary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background: var(--bg-light);
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

.two-column > div:not(.sidebar-nav) {
    margin-left: 0;
    min-width: 0; /* Prevent grid overflow */
}

/* Desktop: sidebar is fixed, content needs margin */
@media (min-width: 1025px) {
    .two-column {
        display: block;
        position: relative;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .sidebar-nav {
        position: fixed;
        top: 100px;
        left: max(1.5rem, calc((100% - 1200px) / 2));
        width: 250px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        z-index: 100;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) var(--bg-light);
    }
    
    /* Content area with left margin for fixed sidebar */
    .two-column > div:not(.sidebar-nav) {
        margin-left: calc(250px + 2rem);
        width: calc(100% - 250px - 2rem);
        padding-right: 1.5rem;
    }
    
    /* Sidebar is fixed, doesn't take space in flow */
    .two-column > aside.sidebar-nav {
        position: fixed;
    }
}

/* Tablet and smaller screens - make sidebar static */
@media (max-width: 1024px) {
    .sidebar-nav {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        z-index: auto !important;
    }
    
    .two-column {
        grid-template-columns: 1fr;
        display: block;
    }
    
    .two-column > div:not(.sidebar-nav),
    .two-column > aside.sidebar-nav {
        width: 100%;
        grid-column: auto;
    }
}

/* Default sidebar styles */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-light);
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

.sidebar-nav ul {
    list-style: none;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-nav a {
    position: relative;
    padding-left: 2rem;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease;
    border-radius: 2px;
}

.sidebar-nav a:hover::before,
.sidebar-nav a:focus::before,
.sidebar-nav a.active::before {
    height: 60%;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus,
.sidebar-nav a.active {
    background: var(--bg-white);
    color: var(--primary-color);
    outline: none;
    font-weight: 600;
}

/* Form */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: var(--error-color);
}

.form-group.error .error {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 120px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #1d4ed8;
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    background: var(--error-color);
}

.toast.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.footer-section a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    transition: transform 0.2s ease;
    border-radius: 0 2px 2px 0;
}

.footer-section a:hover,
.footer-section a:focus {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding-left: 1.25rem;
}

.footer-section a:hover::before,
.footer-section a:focus::before {
    transform: translateY(-50%) scaleX(1);
}

.footer-section a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 2px solid var(--border-color);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.cookie-banner.show {
    display: block;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    color: var(--text-dark);
    flex: 1;
    min-width: 200px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.cookie-banner-buttons .btn {
    flex: none;
    min-width: auto;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    min-height: 36px;
    white-space: nowrap;
}

/* Адаптивность для cookie баннера */
@media (max-width: 1024px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-banner-text {
        flex: none;
        min-width: auto;
    }

    .cookie-banner-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .cookie-banner-buttons .btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        left: 0;
        right: 0;
    }

    .cookie-banner-content {
        gap: 0.75rem;
        width: 100%;
    }

    .cookie-banner-text {
        font-size: 0.9rem;
        line-height: 1.5;
        margin: 0;
    }

    .cookie-banner-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .cookie-banner-buttons .btn {
        width: 100%;
        min-width: auto;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 40px;
        flex: none;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .cookie-banner {
        padding: 0.75rem;
    }

    .cookie-banner-text {
        font-size: 0.85rem;
    }

    .cookie-banner-buttons .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 38px;
    }
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--border-color);
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
}

/* Cookie Settings Modal */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
}

.cookie-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.cookie-category h3 {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.cookie-toggle.active {
    background: var(--primary-color);
}

.cookie-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.cookie-toggle.active::after {
    transform: translateX(24px);
}

.cookie-category p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Content Images */
.content-image {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.content-image img {
    width: 100%;
    display: block;
    box-shadow: var(--shadow-md);
}

/* Links in content */
.card a,
section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.card a:hover,
section a:hover {
    color: #0284c7;
    border-bottom-color: #0284c7;
}

.card a:focus,
section a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        position: relative;
        padding: 1rem;
        overflow: visible;
    }

    .burger-menu {
        display: flex;
        z-index: 100003;
        position: relative;
        pointer-events: auto;
    }

    .logo {
        z-index: 1 !important;
        position: relative;
        pointer-events: auto;
    }
    
    /* Header должен быть поверх меню когда оно открыто, но logo под меню */
    header {
        z-index: 100000 !important;
        pointer-events: auto;
    }
    
    /* Убеждаемся, что burger menu кликабелен */
    .header-container {
        pointer-events: auto;
        position: relative;
        z-index: 100001;
    }
    
    /* Logo текст не должен перекрывать меню */
    .logo-text {
        z-index: 1 !important;
        position: relative;
    }
    
    .logo-main,
    .logo-sub {
        z-index: 1 !important;
        position: relative;
    }

    nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        backdrop-filter: none;
        z-index: 99998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    nav.active {
        opacity: 1;
        visibility: visible;
        pointer-events: all; /* Разрешаем клики для закрытия меню */
        z-index: 99998;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 5rem 0 2rem 0;
        margin: 0;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
        list-style: none;
        z-index: 100002;
        display: flex;
        visibility: visible;
        opacity: 1;
        pointer-events: all;
    }

    nav.active ul {
        transform: translateX(0);
    }
    
    nav li {
        width: 100%;
        display: block;
    }

    nav a {
        padding: 1.25rem 2rem;
        border-bottom: 1px solid var(--border-color);
        display: block;
        width: 100%;
        font-size: 1.1rem;
        transition: all 0.2s;
        position: relative;
    }

    nav a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--primary-color);
        transform: scaleY(0);
        transition: transform 0.2s;
    }

    nav a:hover::before,
    nav a:focus::before,
    nav a.active::before {
        transform: scaleY(1);
    }

    nav a:hover,
    nav a:focus,
    nav a.active {
        background: rgba(14, 165, 233, 0.1);
        color: var(--primary-color);
        padding-left: 2.5rem;
    }

    nav a::after {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .two-column {
        display: block;
        grid-template-columns: 1fr;
        gap: 0;
        margin: 1rem 0;
        padding: 0 1rem;
    }

    .sidebar-nav {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        z-index: auto !important;
        margin-bottom: 2rem;
        margin-left: 0 !important;
    }
    
    .two-column > div:not(.sidebar-nav),
    .two-column > aside.sidebar-nav {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0;
        padding: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .two-column > div:not(.sidebar-nav) {
        width: 100%;
        padding: 0;
    }
    
    main {
        margin-top: 70px;
    }

    /* Cookie banner стили уже определены выше в отдельном медиа-запросе */

    .toast {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}


/* Print Styles */
@media print {
    .cookie-banner,
    .cookie-modal,
    nav,
    .burger-menu {
        display: none !important;
    }
}
