/* ==========================================================================
   Virtuella Staket — style.css
   Mobile-first responsive stylesheet
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-primary-light: #a5d6a7;
    --color-secondary: #5d4037;
    --color-accent: #f9a825;
    --color-bg: #fafaf6;
    --color-bg-alt: #f0efe8;
    --color-text: #333;
    --color-text-light: #666;
    --color-white: #fff;
    --color-border: #ddd;
    --color-success: #2e7d32;
    --color-error: #c62828;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --max-width: 1140px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

ul { list-style: none; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}
.btn-secondary:hover {
    background: var(--color-white);
    color: var(--color-primary);
    text-decoration: none;
}

.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* --- Header --- */
.site-header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.logo:hover { color: var(--color-primary-dark); text-decoration: none; }

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Nav */
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
}
.main-nav.open { display: block; }

.main-nav ul { display: flex; flex-direction: column; }

.main-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
    text-decoration: none;
}

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, #1b5e20 0%, #388e3c 50%, #2e7d32 100%);
    color: var(--color-white);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-overlay { width: 100%; padding: 3rem 0; }

.hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* --- Page Header --- */
.page-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: var(--color-white);
    padding: 3rem 0 2rem;
}
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { opacity: 0.9; max-width: 700px; }

/* --- Sections --- */
.section { padding: 3rem 0; }
.section-alt { background: var(--color-bg-alt); }

.section-title {
    font-size: 1.6rem;
    color: var(--color-primary-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: var(--color-text-light);
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.5rem; color: var(--color-primary-dark); }
.feature-card p { color: var(--color-text-light); font-size: 0.95rem; }

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--color-bg-alt);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.product-info p {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.product-specs {
    list-style: disc;
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}
.product-specs li { margin-bottom: 0.3rem; }

/* --- Research Grid --- */
.research-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.research-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.research-tag {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.research-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.research-card p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.research-link {
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- About --- */
.about-content { max-width: 800px; margin: 0 auto; }

.about-block { margin-bottom: 2.5rem; }
.about-block h2 {
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.about-block ul {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--color-text-light);
}
.about-block ul li { margin-bottom: 0.4rem; }

/* --- Contact Layout --- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.contact-form-wrapper { order: 1; }
.contact-info-sidebar { order: 2; }

.contact-info-sidebar h2 {
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
}

.contact-detail { margin-bottom: 1.5rem; }
.contact-detail h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.required { color: var(--color-error); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.field-error {
    display: block;
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    min-height: 1.2em;
}

/* --- Alerts --- */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-success {
    background: #e8f5e9;
    color: var(--color-success);
    border: 1px solid var(--color-primary-light);
}

.alert-error {
    background: #ffebee;
    color: var(--color-error);
    border: 1px solid #ef9a9a;
}

/* --- CTA Box --- */
.cta-box {
    text-align: center;
    padding: 2rem;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.cta-box h2 { margin-bottom: 0.5rem; color: var(--color-primary-dark); }
.cta-box p { color: var(--color-text-light); margin-bottom: 1.5rem; }

/* --- Footer --- */
.site-footer {
    background: var(--color-secondary);
    color: #ddd;
    padding: 3rem 0 0;
    margin-top: 2rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-inner h3 {
    color: var(--color-white);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.footer-inner a { color: #ccc; }
.footer-inner a:hover { color: var(--color-white); }

.footer-inner ul li { margin-bottom: 0.4rem; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
}

/* ==========================================================================
   Tablet (600px+)
   ========================================================================== */
@media (min-width: 600px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .research-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Desktop (900px+)
   ========================================================================== */
@media (min-width: 900px) {
    .container { padding: 0 2rem; }

    /* Header desktop nav */
    .hamburger { display: none; }

    .main-nav {
        display: block;
        position: static;
        box-shadow: none;
    }

    .main-nav ul {
        flex-direction: row;
        gap: 0.25rem;
    }

    .main-nav a {
        padding: 0.5rem 1rem;
        border-bottom: none;
        border-radius: var(--radius);
    }
    .main-nav a:hover,
    .main-nav a.active {
        background: rgba(46, 125, 50, 0.08);
    }

    /* Hero */
    .hero { min-height: 70vh; }
    .hero-content h1 { font-size: 3rem; }
    .hero-content p { font-size: 1.25rem; }
    .hero-overlay { padding: 5rem 0; }

    .page-header { padding: 4rem 0 3rem; }
    .page-header h1 { font-size: 2.5rem; }

    .section { padding: 4rem 0; }
    .section-title { font-size: 2rem; }

    .features-grid { grid-template-columns: repeat(4, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .research-grid { grid-template-columns: repeat(2, 1fr); }

    .contact-layout { grid-template-columns: 2fr 1fr; }

    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}
