/* Техконсулт 2023 — Main Stylesheet */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a365d;
    background: #fff;
    line-height: 1.6;
}

svg, video, canvas {
    max-width: 100%;
    height: auto;
}
iframe {
    max-width: 100%;
}

img {
    max-width: 100%;
}

a, p, li, h1, h2, h3, h4 {
    overflow-wrap: anywhere;
}

/* Utility */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.section-padding { padding: 4rem 1rem; }
.text-center { text-align: center; }

/* Header & Nav */
.site-header {
    background: #1b2d4c;
    color: #fff;
    padding: 0.4rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.site-header .logo { color: #d4a843; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.nav-list { list-style: none; display: flex; gap: 0.8rem; flex-wrap: wrap; }
.nav-link { color: #fff; text-decoration: none; font-size: 1rem; transition: color 0.3s; }
.nav-link:hover { color: #d4a843; }

/* Hero */
.hero {
    background: linear-gradient(rgba(26,54,93,0.85), rgba(26,54,93,0.85));
    min-height: 42vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2.5rem 1rem 2rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.8rem; animation: fadeInDown 0.8s ease-out; }
.hero p { font-size: 1.2rem; margin-bottom: 1.2rem; opacity: 0.9; animation: fadeInUp 0.8s ease-out 0.2s both; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
    cursor: pointer;
    border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn-primary { background: #d4a843; color: #fff; }
.btn-primary:hover { background: #c49933; }
.btn-secondary { background: transparent; color: #d4a843; border: 2px solid #d4a843; }
.btn-secondary:hover { background: #d4a843; color: #fff; }

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}
.card, .service-card, .project-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover, .service-card:hover, .project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.card h3, .service-card h3, .project-card h3 { color: #1a365d; margin-bottom: 0.75rem; }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.step { text-align: center; padding: 1.5rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #d4a843;
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
}

/* Sections */
section h2 { font-size: 2rem; margin-bottom: 1rem; color: #1a365d; }
.section-alt { background: #f0f4f8; }

/* Price highlight */
.price-highlight {
    background: linear-gradient(135deg, #d4a843, #c49933);
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.3rem;
    margin: 2rem 0;
}

/* Contact form */
.contact-form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.contact-form input, .contact-form textarea, .contact-form select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: #d4a843;
}
.contact-form textarea { min-height: 120px; resize: vertical; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid #e2e8f0; }
details summary {
    padding: 1.25rem 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a365d;
    transition: color 0.3s;
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '+ '; color: #d4a843; font-weight: 700; }
details[open] summary::before { content: '− '; }
details[open] summary { color: #d4a843; }
details p { padding: 0 0 1.25rem 1.5rem; color: #4a5568; }

/* Project cards placeholder */
.project-card .placeholder-img {
    background: #e2e8f0;
    height: 180px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}
.project-card .status { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.status-done { background: #c6f6d5; color: #276749; }
.status-progress { background: #fefcbf; color: #975a16; }

/* Footer */
.footer {
    background: #1a365d;
    color: #fff;
    padding: 2rem;
    text-align: center;
}
.footer a { color: #d4a843; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.6s ease-out both; }

/* Responsive */
@media (max-width: 768px) {
    /* Force all containers to respect viewport */
    .container { padding: 0 1rem !important; max-width: 100% !important; }
    section, div, article { max-width: 100vw !important; }
    
    .top-band {
        padding: 0.65rem 1rem !important;
        line-height: 1.5;
    }
    .site-header {
        padding: 0.8rem 1rem;
    }
    .site-header .container {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    .site-header .logo img,
    .site-header a.logo img,
    a.logo img,
    .logo img {
        height: 40px !important;
        max-height: 40px !important;
        width: auto !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .nav-list {
        gap: 0.4rem 0.6rem;
        justify-content: center;
        padding: 0;
    }
    .nav-link {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    .hero {
        min-height: auto !important;
        padding: 2rem 1rem 1.5rem !important;
    }
    .hero h1 { font-size: 1.6rem !important; }
    .hero p { font-size: 0.95rem !important; margin-bottom: 1rem !important; }

    /* Force ALL grids to single column on mobile */
    .cards-grid,
    .cards-grid[style],
    [style*="grid-template-columns"],
    .team-grid,
    .partners-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Force all flex layouts with multiple children to wrap */
    [style*="display:flex"],
    [style*="display: flex"] {
        flex-wrap: wrap !important;
    }

    .steps { grid-template-columns: 1fr !important; }
    .card,
    .service-card,
    .project-card,
    .cards-grid > *,
    [style*="min-width"] {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .section-padding { padding: 1.5rem 1rem !important; }
    .price-highlight,
    .card,
    .service-card,
    .project-card {
        padding: 1.25rem !important;
    }
    #contact-form-card h2 {
        white-space: normal !important;
    }
    
    /* Table scroll wrapper */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 0;
    }

    /* Force inline style grids to collapse */
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(auto-fit"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Fix flex children that have flex: values (contact page cards etc) */
    [style*="flex:"],
    [style*="flex: "] {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    /* Fix any fixed-width elements */
    [style*="width:9"],
    [style*="width:7"] {
        max-width: 100% !important;
    }

    /* Fix inline flex containers from header */
    .site-header .container[style] {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    /* Fix homepage "Ние решаваме проблеми" section */
    [style*="margin-left:1rem"] {
        margin-left: 0 !important;
    }
    
    /* Stat number cards */
    [style*="font-size:2.5rem"] {
        font-size: 1.8rem !important;
    }
    
    /* Hero inner content */
    .hero .container { padding: 0 1rem !important; }
    .hero-inner { padding: 0 !important; }

    /* Footer */
    .footer { padding: 1.5rem 1rem !important; }

    /* Certificates */
    .certs-section { padding: 1rem !important; }
    details img { width: 100% !important; max-width: 280px !important; }
}

@media (max-width: 480px) {
    .top-band {
        font-size: 0.8rem !important;
    }
    .nav-list { gap: 0.3rem 0.5rem; }
    .nav-link { font-size: 0.8rem; }
    .hero h1 { font-size: 1.3rem !important; }
    .hero p { font-size: 0.9rem !important; }
    section h2 { font-size: 1.4rem !important; }
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    .price-highlight,
    .card,
    .service-card,
    .project-card {
        padding: 1rem !important;
    }
    /* Partner photos */
    .partner-photo { flex-direction: column !important; text-align: center !important; }
}

/* Print */
@media print {
    .site-header, .footer, .btn { display: none; }
    body { color: #000; }
    a { text-decoration: underline; }
}
