/* =========================================================================
   Order process - base stylesheet (default theme)
   Hand-written CSS, no build step.

   Design tokens live in /css/variables.css (loaded first).
   Per customer override the tokens in /css/theme.css (loaded last).
   ========================================================================= */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    /* fallback for older browsers */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: var(--line-height);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-secondary);
}

/* ---------- Layout ---------- */
.site-header {
    background: var(--header-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}
.site-header .container {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}
.logo {
    height: var(--logo-height);
    width: auto;
    display: block;
}

.site-main {
    flex: 1;
}
.site-main .container {
    padding-top: var(--space-lg);
    padding-bottom: 40px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-sm);
    text-decoration: none;
    margin-bottom: var(--space-md);
}
.back-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.page-title {
    color: var(--color-heading);
    font-size: var(--page-title-size);
    font-weight: var(--heading-weight);
    margin: 0 0 var(--space-lg);
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--card-padding);
}
@media (min-width: 640px) {
    .card {
        padding: var(--card-padding-lg);
    }
    .page-title {
        font-size: var(--page-title-size-lg);
    }
}

.lead {
    color: var(--color-muted);
    margin: 0 0 var(--space-lg);
}

/* ---------- Layout with sidebar ---------- */
.layout-with-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}
.layout-with-aside .aside-main {
    flex: 1;
    min-width: 0;
}
.aside-card {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}
@media (min-width: 900px) {
    .layout-with-aside {
        flex-direction: row;
        align-items: flex-start;
    }
    .aside-card {
        flex: 0 0 300px;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

/* Full-width blocks stacked above the card (product box, address box) */
.before-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}
.before-card .address-bar {
    margin-bottom: 0;
}

.aside-label {
    color: var(--color-muted);
    font-size: var(--font-size-xs);
}
.aside-product {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-top: 2px;
}
.aside-change-btn {
    margin-top: 18px;
}
.aside-specs {
    margin-top: 18px;
}
.aside-spec {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}
.aside-spec .lbl {
    color: var(--color-label);
}
.aside-spec .val {
    color: var(--color-secondary);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    font-size: var(--font-size-sm);
}
.site-footer .container {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}
.site-footer p {
    margin: 2px 0;
}
.site-footer .footer-name {
    color: #fff;
    font-weight: 600;
}
.site-footer a {
    color: var(--color-primary);
}

/* ---------- Forms ---------- */
.form {
    display: block;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr;          /* mobile: 1 column (everything 100%) */
    gap: var(--form-grid-gap);
}
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);   /* tablet: 2 columns */
    }
    .span-street {
        grid-column: span 2;             /* Straße full on tablet, 50% on desktop */
    }
    .form-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid.cols-2 .col-full {
        grid-column: span 2;
    }
}
@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(4, 1fr);   /* desktop: 4 columns */
    }
    .span-half {
        grid-column: span 2;             /* PLZ, Ort, Straße = 50% */
    }
}

.field {
    display: block;
}
.label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-label);
    margin-bottom: var(--space-xs);
}
.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--input-font-size);
    font-family: inherit;
    color: var(--color-text);
    background: var(--input-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 2px var(--input-focus-ring);
}
.textarea {
    resize: vertical;
}

/* Custom select arrow with the same right padding as the left text padding (symmetric) */
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: var(--color-text);
    -webkit-text-fill-color: var(--color-text); /* Safari: keep select text black, not system blue */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23333333' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--input-padding-x) center;
    background-size: 12px 8px;
    padding-right: calc(var(--input-padding-x) * 2 + 12px);
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .20);
}
.error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    margin: 4px 0 0;
}
.hint {
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}
.req {
    color: var(--color-primary);
}
.billing-heading {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-heading);
    margin: 4px 0 12px;
}
.js-billing-block {
    margin-top: 4px;
}

/* Privacy consent checkbox */
.consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    cursor: pointer;
}
.consent input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}
.consent a {
    color: var(--color-primary);
}

/* ---------- Autocomplete (text input + suggestions below) ---------- */
.ac-field {
    position: relative;
}
.ac-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 30;
    margin: 0;
    padding: var(--space-xs);
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    max-height: 240px;
    overflow-y: auto;
    display: none;
}
.ac-list.is-open {
    display: block;
}
.ac-item {
    padding: var(--space-sm) 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-base);
}
.ac-item.is-active, .ac-item:hover {
    background: #eaf0f7;
    color: var(--color-secondary);
}
.ac-empty {
    padding: var(--space-sm) 10px;
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: var(--btn-radius);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-size: var(--btn-font-size);
    line-height: 1.5;
    font-weight: var(--btn-font-weight);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .15s ease;
}
.btn:disabled, .btn.is-submitting {
    opacity: .6;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}
.btn-primary:hover {
    background: var(--btn-primary-bg-hover);
}
.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover);
}
.btn-navy {
    background: var(--color-secondary);
    color: #fff;
}
.btn-navy:hover {
    background: var(--color-secondary-hover);
}
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: var(--space-sm);
}
.actions.end {
    justify-content: flex-end;
}
@media (max-width: 639px) {
    .actions, .actions.end {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---------- Boxes / notices ---------- */
.notice {
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}
.notice-warning {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning-text);
}
.notice-danger {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    color: var(--color-danger-text);
}

.address-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    background: #eaf0f7;
    border: 1px solid #c7d6e8;
    border-left: 4px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md) 18px;
    font-size: 18px;
    color: var(--color-secondary);
    margin-bottom: var(--space-lg);
    word-break: break-word;
}
.address-bar strong {
    color: var(--color-secondary);
    font-weight: 700;
}
.address-bar a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ---------- Product rows ---------- */
.product-row {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) 26px;
    margin-bottom: 18px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.product-row:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-hover);
}
.product-row.is-selected {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 1px var(--color-secondary);
}

.product-row__header {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
@media (min-width: 760px) {
    .product-row__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.product-card__name {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.2;
}
.product-row .product-card__name {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.product-card__speed {
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    margin-top: 6px;
}
.product-card__speed strong {
    color: var(--color-secondary);
}

.product-row__pricebox {
    flex-shrink: 0;
}
@media (min-width: 760px) {
    .product-row__pricebox {
        text-align: right;
        min-width: 230px;
    }
}
.product-row__caption {
    color: var(--color-muted);
    font-size: var(--font-size-xs);
    max-width: 260px;
}
@media (min-width: 760px) {
    .product-row__caption {
        margin-left: auto;
    }
}
.product-row__price {
    font-size: 30px;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 6px 0 12px;
}
.product-row__price span {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-muted);
}

/* Spec: full-width divider, content only in the left half */
.product-specs {
    margin-top: var(--space-lg);
    font-size: var(--font-size-base);
}
.spec {
    border-top: 1px solid var(--color-border);
}
.spec__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 4px;
}
.spec__label {
    color: var(--color-label);
}
.spec__value {
    color: var(--color-secondary);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
@media (min-width: 760px) {
    .spec__inner {
        max-width: 50%;
    }
}

/* Product description (Erklärsatz under the name) */
.product-card__desc {
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    line-height: 1.45;
    margin-top: 6px;
    max-width: 52ch;
}

/* "inkl. 19 % Mehrwertsteuer" notes near prices */
.vat-note {
    color: var(--color-label);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin: -4px 0 12px;
}
.vat-inline {
    color: var(--color-label);
    font-weight: 600;
    font-size: var(--font-size-xs);
}

/* Promo banner (Aktion – jetzt schnell sein) — eye-catching */
.product-aktion {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: var(--space-md);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-left: 4px solid var(--color-primary);
    color: var(--color-warning-text);
    font-size: var(--font-size-sm);
    line-height: 1.45;
}
.product-aktion__badge {
    flex: 0 0 auto;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.product-aktion__text {
    flex: 1;
    font-weight: 500;
}

/* ---------- Summary ---------- */
.summary-section {
    margin-bottom: var(--space-lg);
}
.summary-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-muted);
    margin: 0 0 var(--space-sm);
}
.summary-change {
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: underline;
}
.summary-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    color: var(--color-label);
}
.summary-box .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Confirmation ---------- */
.confirm {
    text-align: center;
    padding: var(--space-lg) 0;
}
.confirm-icon {
    margin: 0 auto 20px;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--color-success-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-icon .check {
    width: 40px;
    height: 40px;
    background-color: var(--color-success);
    -webkit-mask: url('../img/check.svg') no-repeat center / contain;
    mask: url('../img/check.svg') no-repeat center / contain;
}
.confirm h2 {
    color: var(--color-secondary);
    font-size: 22px;
    margin: 0 0 var(--space-sm);
}
.confirm p {
    color: var(--color-muted);
    max-width: 520px;
    margin: 0 auto;
}
.confirm .order-no {
    margin-top: var(--space-md);
    font-size: var(--font-size-sm);
}

/* ---------- Error pages ---------- */
.error-page {
    min-height: 100vh;
    /* fallback for older browsers */
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: var(--space-lg);
}
.error-box {
    width: 100%;
    max-width: 520px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border-top: 4px solid var(--color-primary);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    padding: 40px var(--card-padding-lg);
    text-align: center;
}
.error-logo {
    height: 46px;
    width: auto;
    margin-bottom: var(--space-lg);
}
.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--color-secondary);
    line-height: 1;
}
.error-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-secondary);
    margin: var(--space-sm) 0 12px;
}
.error-message {
    color: var(--color-muted);
    margin: 0 0 28px;
}

/* ---------- Helper classes ---------- */
.mt-8 {
    margin-top: var(--space-xl);
}
