/* =========================================================
    1. GRUNDLAGEN & VARIABLEN
========================================================= */
:root {
    --primary: #16a085;
    --primary-dark: #117a65;
    --bg-light: #f9f7f4;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* =========================================================
    2. hero-banner 
========================================================= */

/* Hero-Bereich */
.hero-banner {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;

    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--white);
}

.hero-banner .banner {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.6); /* Bild abdunkeln für Text */
}

.hero-banner .hero-overlay {
    text-align: center;
}

/* Hero-Titel */

.hero-banner h1 { 
    font-size: 3rem; /* mobil */ 
    font-weight: 550;     /* klarer, gut lesbar */
    font-style: italic; 
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5); 
    margin-bottom: 0.5rem; 
    color: white;
 }

.hero-banner .underline {
    width: 80px;
    height: 2px;
    background-color: white;
    opacity: 0.8;
    margin: 0 auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}


/* MOBILE HERO – Text & Unterlinie zentrieren */
@media (max-width: 768px) {
    .hero-banner .hero-overlay {
        width: 100%;           /* volle Breite */
        padding: 0;            /* Container-Padding entfernen */
        text-align: center;    /* Text horizontal zentrieren */
        display: flex;
        flex-direction: column;
        justify-content: center;  /* vertikal zentrieren */
        align-items: center;      /* horizontal zentrieren */
    }

    .hero-banner h1 {
        margin: 0 auto;        /* wirklich mittig */
    }

    .hero-banner .underline {
        margin: 10px auto 0 auto; /* unter H1, mittig */
    }
}


@media (min-width: 1024px) {
    .hero-banner h1 {
        font-size: 4.5rem;
    }
}
/* =========================================================
    3. NAVIGATION
========================================================= */

nav {
    background-color: #B0B3B8;
    box-shadow: var(--shadow);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    height: 100px;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 50px;
    width: auto;
    display: block;
}

/* Desktop Menü */
.nav-center ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-center ul li a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
}

.nav-center ul li a:hover {
    color: var(--primary);
}

/* Sprache */
.nav-lang select {
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
}

/* =========================
   HAMBURGER (RESET!)
========================= */

.hamburger {
    all: unset;                 /* 🔴 WICHTIG */
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    z-index: 2000;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #000;
    border-radius: 2px;
}

/* =========================
   MOBILE NAV
========================= */
@media (max-width: 768px) {

    .hamburger {
        display: flex;
        justify-content: space-between; 
        padding: 0 15px;
    }

    .nav-center ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 0;
        width: 33%;
        background: #fff;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        padding: 10px 0;
        z-index: 1500;
    }

    .nav-center ul li {
        padding: 10px 20px;
    }
}


/* =========================================================
    4. SEKTIONEN & CARDS (INFO-BEREICH)
========================================================= */
section { padding: 80px 0; }

h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 60px; height: 3px; background: var(--primary);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

.card {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card h3 { color: var(--primary); margin-bottom: 20px; }
.card ul { margin-bottom: 20px; padding-left: 20px; }

.more-text { display: none; margin-top: 15px; }

button.read-more {
    margin-top: auto;
    background: #16a085;
    color: white;
    border: 1px solid #dcdde1;
    min-width: 150px;
}

/* =========================================================
    5. PRODUKT GRID & KLAPP-FUNKTION
========================================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    max-width: 1100px;
    margin: 40px auto;
    width: 100%;
}

.product-card {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%; 
}

/* Feste Höhe für Überschriften, damit alle Karten gleichmäßig ausgerichtet sind */
.product-card h3 {
    min-height: 3.6em; /* Platz für ca. 2–3 Zeilen, je nach font-size */
    line-height: 1.2em;
    margin-bottom: 10px;
}

/* Bildrahmen */
.image-frame {
    width: 100%;
    height: auto;
    min-height: 200px;
    overflow: hidden;
    border-radius: 10px;
    background: #eee;
}

.image-frame img, .image-frame video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
}

/* Thumbnails */
.thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.thumbs img, .thumbs video { 
    height: 60px; 
    object-fit: cover; 
    border-radius: 4px; 
    cursor: pointer; 
}

/* Varianten Toggle */
.variant-toggle {
    background: #e8f5f2; 
    color: var(--primary); 
    padding: 12px;
    text-align: center; 
    border-radius: 8px; 
    cursor: pointer; 
    margin-top: 15px; 
    font-weight: bold; 
    transition: var(--transition);
}

/* Varianten Zeilen */
.variant-rows { 
    display: none; 
    flex-direction: column; 
    gap: 8px; 
    padding: 15px 5px; 
}

.variant-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 8px 0; 
    border-bottom: 1px solid #eee; 
    flex-wrap: nowrap;
}

/* Checkbox */
.variant-row input[type="checkbox"] {
    width: 30px;           /* gewünschte Breite */
    margin: 0 1px 0 0;     /* minimaler Abstand rechts */
}

/* Text neben Checkbox */
.variant-row label {
    margin-left: 1px;      /* Abstand zwischen Checkbox und Text */
    cursor: pointer;
}

/* Number-Input bleibt unverändert */
.variant-row input[type="number"] {
    width: 60px;           
    padding: 5px 5px;
    margin: 0 2px;
    text-align: right;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.variant-row label {
    margin-left: 1px;      /* Abstand zwischen Checkbox und Text */
    cursor: pointer;
    font-size: 0.85rem;    /* kleiner als Standard, anpassen nach Geschmack */
}

/* =========================================================
    6. FORMULARE & RECHNER (GLOBALER FIX)
========================================================= */
.calculator-wrapper, 
.contact-selection form {
    background: var(--white); 
    max-width: 600px; 
    margin: 0 auto;
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Erzwingt gleiche Breite der Kinder */
}

/* Gilt für alle Inputs in Kontakt UND Kalkulation */
.calculator-wrapper input,
.calculator-wrapper select,
.contact-selection input, 
.contact-selection select, 
.contact-selection textarea {
    width: 100% !important; 
    padding: 12px; 
    margin-bottom: 20px;
    border: 1px solid #ddd; 
    border-radius: 8px;
    font-family: inherit;
    display: block;
}

.calculator-wrapper label,
.contact-selection label {
    align-self: flex-start; /* Beschriftung bleibt links */
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}
/* Spezifisch für Berechnen und Drucken Buttons */
.calculator-wrapper button {
    background: #16a085;
    color: white;
}

/* =========================================================
    7. ANFRAGE TABELLE (DESKTOP) - KOMPAKTIERUNG DER LETZTEN SPALTE
========================================================= */
#anfrage { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

#anfrage table {
    width: 100%; 
    max-width: 900px; 
    border-collapse: collapse;
    background: white; 
    box-shadow: var(--shadow);
    text-align: left; /* default LTR */
    table-layout: auto; /* automatische Spaltenbreite */
}

#anfrage th { 
    background: var(--primary); 
    color: white; 
    padding: 12px 10px; 
    text-align: left; 
    font-weight: normal;
    font-size: 0.95rem;
}

#anfrage td { 
    padding: 8px 10px; 
    border-bottom: 1px solid #eee; 
    font-size: 0.9rem;
}

/* Vierte Spalte (Remove/X) kompakt machen */
#anfrage th:last-child, #anfrage td:last-child {
    width: 1%;          /* zwingt Browser, die Spalte minimal zu halten */
    white-space: nowrap; /* keine Zeilenumbrüche */
    text-align: center;  
    padding: 2px 4px;   /* minimal */
}

/* Entfernen-Button kompakt */
#anfrage td:last-child button {
    background: #e74c3c;
    color: white;
    padding: 1px 4px;   /* sehr kompakt */
    font-size: 0.75rem; /* kleinste gut lesbare Schrift */
    border: 3px;
    cursor: pointer;
    min-width: 0;       /* verhindert, dass Button breiter wird */
}

/* RTL für Persisch / Arabisch */
html[lang="fa"] #anfrage,
html[lang="fa"] #anfrage table {
    direction: rtl;        
}

html[lang="fa"] #anfrage th,
html[lang="fa"] #anfrage td {
    text-align: right;     
}

/* Optional: Print-Button links im RTL */
html[lang="fa"] #anfrage button.print-btn {
    float: left; 
}

/* =========================================================
    8. BUTTON STYLING
========================================================= */
button {
    font-family: inherit; font-size: 0.95rem; font-weight: 600; padding: 12px 28px;
    border-radius: 10px; border: none; cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; width: auto; min-width: 200px; margin: 10px auto;
}

button[type="submit"] {
    background: #16a085;
    color: white; text-transform: uppercase;
}

button.add {
    background: var(--primary); color: white; padding: 8px 15px;
    min-width: 100px; margin: 0; font-size: 0.85rem;
}

/* =========================================================
    9. RESPONSIVE / MOBILE
========================================================= */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    header {
        display: flex;
        justify-content: space-between; /* Hamburger links, Sprache rechts */
        align-items: center;            /* vertikal zentrieren */
        padding: 0 15px;                /* horizontalen Abstand hinzufügen */
    }
    header h1 { font-size: 1.4rem; width: 85%; }


    section .container, .contact-selection, .calculator-wrapper, #anfrage {
        width: 95% !important; margin: 20px auto !important; padding: 20px 15px !important;
    }

    .products-grid {
        grid-template-columns: 1fr !important;
        padding: 0 5px !important;
    }

    .variant-row input { width: 60px; font-size: 14px; }

    /* Fix für Formularfelder auf Mobile */
    .calculator-wrapper input, .contact-selection form input { width: 100% !important; }
}




/* =========================================================
   ANFRAGE – SCREEN (DESKTOP + MOBILE)
========================================================= */
#anfrage {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#anfrage table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: left;
    table-layout: auto;
}

#anfrage th {
    background: var(--primary);
    color: white;
    padding: 12px 10px;
    font-weight: normal;
    font-size: 0.95rem;
}

#anfrage td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

/* letzte Spalte kompakt */
#anfrage th:last-child,
#anfrage td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    padding: 2px 4px;
}

#anfrage td:last-child button {
    background: #e74c3c;
    color: #fff;
    padding: 1px 4px;
    font-size: 0.75rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

/* RTL */
html[lang="fa"] #anfrage,
html[lang="fa"] #anfrage table {
    direction: rtl;
}

html[lang="fa"] #anfrage th,
html[lang="fa"] #anfrage td {
    text-align: right;
}

/* =========================================================
   PRINT – DESKTOP + MOBILE (STABIL, NORMALE RAHMEN)
========================================================= */
@media print {

    /* ========================
       0. Seitenränder
    ========================= */
    @page {
        margin: 15mm;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    /* ========================
       1. Alles Unwichtige ausblenden
    ========================= */
    nav,
    header,
    footer,
    button,
    .no-print,
    .variant-toggle,
    .read-more-btn,
    section:not(#anfrage) {
        display: none !important;
    }

    /* ========================
       2. Anfrage sichtbar machen
    ========================= */
    #anfrage {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ========================
       3. Tabelle stabil drucken
    ========================= */
    #anfrage table {
        width: 100% !important;
        border-collapse: collapse !important; /* keine doppelten Linien */
        table-layout: auto !important;
        border: 1px solid #000 !important;     /* Außenrahmen */
        border-radius: 0 !important;           /* Ecken eckig machen */
    }

    #anfrage thead {
        display: table-header-group !important;
    }

    #anfrage tr {
        display: table-row !important;
        page-break-inside: avoid !important;
    }

    #anfrage th,
    #anfrage td {
        display: table-cell !important;
        border: 1px solid #000 !important;     /* normale schwarze Linien */
        border-radius: 0 !important;           /* Sicherstellen, dass Zellen eckig sind */
        padding: 6px 4px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
        background: transparent !important;
        color: #000 !important;
        word-break: break-word !important;
        vertical-align: middle !important;
    }

    /* ========================
       4. Letzte Spalte X entfernen
    ========================= */
    #anfrage th:last-child,
    #anfrage td:last-child {
        display: none !important;
    }

    /* ========================
       5. RTL Unterstützung Persisch
    ========================= */
    html[lang="fa"] #anfrage,
    html[lang="fa"] #anfrage table {
        direction: rtl !important;
    }

    html[lang="fa"] #anfrage th,
    html[lang="fa"] #anfrage td {
        text-align: right !important;
    }
}
/* <--- DIESE KLAMMER IST ENTSCHEIDEND! Hier endet der Druck-Modus. */

/* Alles was HIERNACH kommt, ist wieder für den normalen Bildschirm */
/* =========================================================
    11. FOOTER
========================================================= */
.site-footer {
    background: #2c3e50; color: #ecf0f1; text-align: center; padding: 40px 20px;
    margin-top: 80px; border-top: 3px solid var(--primary); font-size: 0.9rem;
}
.site-footer a { color: var(--primary); text-decoration: none; margin: 0 10px; }