/* =========================================
   1. Variables & Design System
   ========================================= */
:root {
    /* Colors */
    --primary: #0284c7;
    /* Sky Blue */
    --primary-dark: #0369a1;
    --secondary: #0f172a;
    /* Slate Dark */
    --secondary-light: #1e293b;
    --accent: #dc2626;
    /* Emergency Red */
    --accent-dark: #b91c1c;
    --success: #22c55e;
    /* Green */

    --text-main: #334155;
    --text-light: #64748b;
    --text-white: #ffffff;

    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-neon: 0 0 15px rgba(2, 132, 199, 0.5);

    /* Typography */
    /* System Stack for Body and Headings */
    --font-heading: system-ui, -apple-system, sans-serif;
    --font-body: system-ui, -apple-system, sans-serif;
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   3. Utilities & Components
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--accent-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--secondary);
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.hidden {
    display: none !important;
}

/* =========================================
   4. Header & Navigation
   ========================================= */
.top-bar {
    background-color: var(--secondary);
    color: #e2e8f0;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
}

.nav-main {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-wrapper {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--secondary);
}

.nav-link:hover {
    color: var(--primary);
}

/* Dropdown */
.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 0.75rem;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem 0;
    border: 1px solid #f1f5f9;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
}

.dropdown-icon {
    color: var(--primary);
    background: rgba(2, 132, 199, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Mobile Menu Button */
#mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--secondary);
    background: none;
    border: none;
    cursor: pointer;
}

/* Middle Mobile Menu Panel */
.mobile-menu {
    background: white;
    border-top: 1px solid #eee;
    padding: 1rem 0;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid #f8fafc;
}

.mobile-menu a:hover {
    color: var(--primary);
    background-color: var(--bg-light);
}

/* =========================================
   5. Hero Section
   ========================================= */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.75)),
        url('../images/santehnik-tallinnas-taust.webp');
    background-size: cover;
    background-position: center;
    color: white;
    padding: clamp(4rem, 10vw, 8rem) 0;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.tagline {
    background: rgba(2, 132, 199, 0.2);
    border: 1px solid rgba(2, 132, 199, 0.4);
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.hero p {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: #cbd5e1;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   6. Services Grid
   ========================================= */
.service-triggers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-img {
    height: 200px;
    position: relative;
}

.service-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.service-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-link {
    margin-top: auto;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   7. About & Features Section
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.feature-list i {
    color: var(--success);
    font-size: 1.25rem;
}

/* =========================================
   8. Contact Form & Footer
   ========================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    color: white;
}

.contact-wrapper {
    background: linear-gradient(135deg, var(--secondary), #1e293b);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.feature-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-box {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

input,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.footer {
    background-color: var(--secondary);
    color: #94a3b8;
    padding: 4rem 0 2rem;
    border-top: 1px solid #1e293b;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* =========================================
   10. FAQ Section
   ========================================= */
.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
    border-color: rgba(2, 132, 199, 0.3);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary);
    list-style: none;
    /* Hide default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 1.5rem 1.25rem;
    color: #64748b;
    margin: 0;
    border-top: 1px solid transparent;
}

.faq-item[open] p {
    border-top-color: #f1f5f9;
    padding-top: 1rem;
}

/* =========================================
   9. Mobile Responsive
   ========================================= */
@media (max-width: 768px) {

    .nav-links,
    .top-bar {
        display: none;
    }

    #mobile-menu-btn {
        display: block;
    }

    .contact-grid,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .feature-list li {
        font-size: 1rem;
    }
}

/* =========================================
   11. Price List (Table)
   ========================================= */
.price-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.price-table th,
.price-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.price-table th {
    background-color: var(--secondary);
    color: white;
    font-weight: 600;
}

.price-table tr:last-child td {
    border-bottom: none;
}

.price-table tr:hover td {
    background-color: var(--bg-light);
}

.price-col-service {
    width: 25%;
    font-weight: 600;
}

.price-col-cost {
    width: 25%;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.price-col-desc {
    width: 50%;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Responsive Table container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

/* =========================================
   12. Mobile Price List (Cards)
   ========================================= */
@media (max-width: 768px) {

    /* Reset Container Styles */
    .table-responsive {
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
        margin-bottom: 0;
    }

    .price-table {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        border: none;
        display: block;
    }

    .price-table thead {
        display: none;
    }

    .price-table tbody {
        display: block;
        width: 100%;
    }

    /* Convert Rows to Cards */
    .price-table tr {
        display: block;
        background: white;
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid #e2e8f0;
    }

    .price-table td {
        display: block;
        padding: 0;
        border: none;
        width: 100% !important;
        /* Force full width */
        text-align: left;
    }

    .price-table tr:hover td {
        background-color: transparent;
    }

    /* Column Specific Styles */

    /* Service Name */
    .price-table td:first-child {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--secondary);
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    /* Price */
    .price-col-cost {
        font-size: 1.125rem;
        color: var(--primary);
        font-weight: 700;
        margin-bottom: 1rem;
        white-space: normal;
        /* Allow wrapping if needed, though usually short */
    }

    /* Description */
    .price-col-desc {
        font-size: 0.95rem;
        color: var(--text-light);
        border-top: 1px solid #f1f5f9 !important;
        /* Force border */
        padding-top: 1rem !important;
        margin-top: 0.5rem;
        line-height: 1.5;
    }
}