/* ============================================================
   tg.stylepoint.de – Stylepoint Konfigurator CSS
   Farben: Blau #006da4 | Grün #7baf42 | Text #333
   ============================================================ */

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

:root {
    --blue: #006da4;
    --green: #7baf42;
    --text: #333333;
    --text-light: #666666;
    --bg: #f5f5f5;
    --white: #ffffff;
    --border: #e0e0e0;
    --radius: 6px;
    --header-h: 52px;
    --footer-h: 36px;
    --sidebar-w: 320px;
    --font-main: 'Open Sans', sans-serif;
    --font-head: 'Montserrat', sans-serif;
}

html { font-size: 15px; overflow-x: hidden; }
body { font-family: var(--font-main); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--green); }

/* ---- Header ---- */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--blue);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    height: var(--header-h);
}

.header-inner {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-text {
    font-family: var(--font-head);
    font-size: 1.25rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}
.logo-text strong { color: var(--green); font-weight: 700; }

.header-title {
    flex: 1;
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-link, .btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue);
    padding: 6px 14px;
    border: 2px solid var(--blue);
    border-radius: 30px;
    transition: all 0.2s;
    white-space: nowrap;
}
.cart-link:hover, .btn-back:hover {
    background: var(--blue);
    color: var(--white);
}

/* ---- Configurator Layout ---- */
.configurator-page main { flex: 1; }

.configurator-main {
    padding: 16px 20px 20px;
}

/* Banner über dem Konfigurator */
.configurator-banner {
    max-width: 1280px;
    margin: 0 auto 12px;
    background: var(--blue);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    line-height: 1.5;
}
.configurator-banner strong { font-weight: 700; }

/* Das Konfigurator-Fenster – Basis (Mobile-first) */
.configurator-window {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    box-shadow: 0 2px 14px rgba(0,0,0,0.10);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Viewer – Basis */
.viewer-area {
    position: relative;
    height: 56vw;
    min-height: 220px;
    max-height: 380px;
    min-width: 0;
    background: #ececec;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* Options – Basis */
.options-area {
    min-width: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}

.options-area .cart {
    display: flex;
    flex-direction: column;
}

#option-container {
    padding: 1rem;
}

.cart-action {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--white);
}

/* ---- Desktop: zweispaltig, Viewer sticky ---- */
@media (min-width: 769px) {
    .configurator-window {
        grid-template-columns: 1fr var(--sidebar-w);
        gap: 1rem;
        align-items: start;
        border-radius: 10px;
        overflow: visible;
        box-shadow: none;
        border: none;
    }

    .viewer-area {
        position: sticky;
        top: calc(var(--header-h) + 16px);
        height: calc(100vh - var(--header-h) - var(--footer-h) - 48px);
        max-height: none;
        min-height: 0;
        border-radius: 10px 0 0 10px;
        border: 1px solid var(--border);
        box-shadow: 0 4px 28px rgba(0,0,0,0.13);
    }

    .options-area {
        border: 1px solid var(--border);
        border-radius: 0 10px 10px 0;
        border-top: 1px solid var(--border);
        box-shadow: 0 4px 28px rgba(0,0,0,0.13);
    }

    .cart-action { border-radius: 0 0 10px 0; }
}

/* Stückzahl-Zeile */
.qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.qty-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
    flex-shrink: 0;
}
.qty-btn:hover { background: var(--border); }

.qty-control input[type="number"] {
    width: 56px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    font-family: var(--font-main);
    color: var(--text);
    -moz-appearance: textfield;
}
.qty-control input[type="number"]::-webkit-outer-spin-button,
.qty-control input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-control input[type="number"]:focus { outline: none; background: #f9f9f9; }

/* Stückzahl im Warenkorb-Item */
.cart-item-qty {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue);
    margin-top: 6px;
}

.cart-hint {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 6px;
    line-height: 1.4;
}

/* Expivi: erstes Element im Option-Container etwas abstand nach oben */
#option-container > *:first-child {
    margin-top: 0.25rem;
}

.expivi-alert {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    height: var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ---- Buttons ---- */
.btn-primary, .btn-add-to-cart, .btn-submit {
    display: inline-block;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 30px;
    padding: 11px 24px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    white-space: nowrap;
}
.btn-primary:hover, .btn-add-to-cart:hover, .btn-submit:hover {
    background: var(--green);
    color: var(--white);
}
.btn-primary:active, .btn-add-to-cart:active, .btn-submit:active { transform: scale(0.98); }

.btn-add-to-cart {
    width: 100%;
    padding: 13px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-cart:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 30px;
    padding: 9px 22px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-secondary:hover { background: var(--blue); color: var(--white); }

.btn-remove {
    font-size: 0.75rem;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 5px 10px;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-remove:hover { background: #dc3545; color: var(--white); }

/* ---- Warenkorb Layout ---- */
.warenkorb-page main { flex: 1; }

.warenkorb-main {
    padding: 28px 20px;
}

.warenkorb-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* ---- Cart Items ---- */
.cart-items-section h2,
.request-section h2 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--blue);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.cart-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-light);
}
.cart-empty p { margin-bottom: 16px; font-size: 1rem; }

.cart-items { display: flex; flex-direction: column; gap: 14px; }

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    align-items: start;
}

.cart-item-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--bg);
    display: block;
}
.no-image {
    width: 120px;
    height: 120px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
}

.cart-item-details h3 {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.config-attributes {
    list-style: none;
    font-size: 0.825rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.config-attributes li { color: var(--text); }
.config-attributes strong { color: var(--text-light); }

.cart-continue { margin-top: 14px; }

/* ---- Request Form ---- */
.request-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.request-intro {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.request-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text);
}

.required { color: #dc3545; }

.form-group input,
.form-group textarea {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.2s;
    background: var(--white);
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,109,164,0.12);
}

.form-check { flex-direction: row; align-items: flex-start; }

.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.825rem;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
}
.checkbox-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.form-note { font-size: 0.75rem; color: var(--text-light); }

/* ---- Responsive: Tablet ---- */
@media (max-width: 1024px) {
    :root { --sidebar-w: 280px; }
    .configurator-main { padding: 12px 14px 16px; }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
    :root {
        --header-h: 48px;
        --footer-h: 32px;
    }

    .configurator-main { padding: 10px 10px 14px; }

    .configurator-banner {
        font-size: 0.8rem;
        padding: 8px 14px;
        margin-bottom: 8px;
    }

    .configurator-window {
        grid-template-columns: 1fr;
        gap: 0;
        align-items: stretch;
    }

    .viewer-area {
        position: relative;
        top: auto;
        height: 56vw;
        min-height: 220px;
        max-height: 380px;
        border-radius: 8px 8px 0 0;
        border: none;
        box-shadow: none;
    }

    .options-area {
        border-radius: 0 0 8px 8px;
        border: none;
        border-top: 1px solid var(--border);
        box-shadow: none;
    }

    .cart-action { border-radius: 0 0 8px 8px; }

    #option-container { padding: 0.75rem; }

    .header-inner { padding: 0 14px; }
    .header-title { display: none; }
    .logo-text { font-size: 1.1rem; }

    .cart-item { grid-template-columns: 90px 1fr; }
    .cart-item-image img, .no-image { width: 90px; height: 90px; }
    .cart-item-actions { grid-column: 1 / -1; }

    .form-row { grid-template-columns: 1fr; }

    .warenkorb-main { padding: 16px 14px; }
    .request-section { padding: 18px 14px; }
}

/* ---- Very small phones ---- */
@media (max-width: 400px) {
    .viewer-area { height: 60vw; max-height: none; }
}
