/**
 * AHK Konfigurator Wohnmobil - Stylesheet
 *
 * @package AHK_Konfigurator_Womo
 */

/* ========================================
   Container & Layout
   ======================================== */

.ahk-konfigurator {
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
}

/* ========================================
   Section Wrapper (Einzel-Shortcodes)
   ======================================== */

.ahk-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ========================================
   Form Basics (All-in-One Shortcode)
   ======================================== */

.ahk-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ========================================
   Fieldsets / Sections
   ======================================== */

.ahk-fieldset {
    border: none;
    padding: 25px 35px 30px;
    margin: 0;
}

.ahk-fieldset:not(:last-of-type) {
    border-bottom: 1px solid #eaeaea;
}

h3.ahk-section-title {
    font-family: Oswald, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    padding: 0;
    margin: 0 0 18px 0;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

/* ========================================
   Form Fields
   ======================================== */

.ahk-field {
    margin-bottom: 22px;
}

.ahk-field:last-child {
    margin-bottom: 0;
}

.ahk-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.ahk-field label .required {
    color: #e53935;
    margin-left: 3px;
}

.ahk-field input[type="text"],
.ahk-field input[type="number"],
.ahk-field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
    color: #333;
}

.ahk-field input[type="text"]:hover,
.ahk-field input[type="number"]:hover,
.ahk-field textarea:hover,
.ahk-field select:hover {
    border-color: #bbb;
}

.ahk-field select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fafafa !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 10px !important;
    color: #333;
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.ahk-field select:focus {
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%231976D2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") !important;
}

/* Theme-Überschreibung: Verstecke ALLE Dropdown-Pfeile vom Theme */
.ahk-konfigurator-womo .ahk-field select + *:not(input):not(textarea):not(label),
.ahk-konfigurator-womo .ahk-field .select-arrow,
.ahk-konfigurator-womo .ahk-field::after,
.ahk-konfigurator-womo .ahk-field::before,
.ahk-konfigurator-womo select + span,
.ahk-konfigurator-womo select + div,
.ahk-konfigurator-womo select + i {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

.ahk-field select:focus,
.ahk-field input:focus,
.ahk-field textarea:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.12);
    background: #fff;
}

.ahk-field select.ahk-error,
.ahk-field input.ahk-error,
.ahk-field textarea.ahk-error {
    border-color: #e53935;
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.12);
}

.ahk-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #e53935;
}

.ahk-field input.ahk-field-invalid {
    border-color: #e53935;
}

.ahk-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Field */
.ahk-field--checkbox {
    padding: 12px 0;
}

/* Trennlinie */
.ahk-divider {
    border: none;
    border-top: 1px solid #eaeaea;
    margin: 25px 0;
}

.ahk-field--checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.ahk-field--checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #1976D2;
}

/* ========================================
   Radio-Button-Gruppe (Kupplungstypen)
   ======================================== */

.ahk-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ahk-radio-label {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.ahk-radio-label:hover {
    border-color: #bbb;
    background: #f5f5f5;
}

.ahk-radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #1976D2;
    flex-shrink: 0;
}

.ahk-radio-label input[type="radio"]:checked + .ahk-radio-text {
    color: #1976D2;
    font-weight: 600;
}

/* Radio-Button ausgewählt: Hervorhebung */
.ahk-radio-label:has(input[type="radio"]:checked) {
    border-color: #1976D2;
    background: #e3f2fd;
}

.ahk-radio-text {
    font-size: 0.95em;
    color: #333;
}

/* ========================================
   Dynamische Produkt-Optionen (Checkboxen)
   ======================================== */

.ahk-option-item {
    padding: 6px 0;
    margin-bottom: 0;
}

.ahk-option-item label {
    font-weight: 500;
}

/* Field-Label über Radio-Buttons */
.ahk-field-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

/* ========================================
   Buttons
   ======================================== */

.ahk-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 1.05em;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.ahk-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ahk-btn--add-to-cart {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    color: #fff;
    width: 100%;
    font-size: 1.15em;
    padding: 18px 32px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.ahk-btn--add-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #388E3C 0%, #1B5E20 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.ahk-btn--add-to-cart:active:not(:disabled) {
    transform: translateY(0);
}

/* ========================================
   Price Display
   ======================================== */

.ahk-price-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
    padding: 30px 35px;
    border: 1px solid #eaeaea;
}

.ahk-price-breakdown {
    margin-bottom: 20px;
}

.ahk-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.ahk-price-row:last-child {
    border-bottom: none;
}

.ahk-price-row--total {
    border-top: 2px solid #1a1a1a;
    border-bottom: none;
    margin-top: 15px;
    padding-top: 18px;
}

.ahk-price-row--total .ahk-price-label,
.ahk-price-row--total .ahk-price-value {
    font-weight: 800;
    font-size: 1.35em;
    color: #1a1a1a;
}

.ahk-price-label {
    color: #555;
    font-weight: 500;
}

.ahk-price-value {
    font-weight: 700;
    color: #1a1a1a;
}

.ahk-price-note {
    font-size: 0.9em;
    color: #777;
    margin: 20px 0 25px;
    text-align: center;
}

/* ========================================
   Error Display
   ======================================== */

.ahk-error-display {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    padding: 18px 22px;
    margin-top: 25px;
}

.ahk-error-display p {
    margin: 0;
    color: #c62828;
    font-size: 0.95em;
    font-weight: 500;
}

.ahk-success-display {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

.ahk-success-display p {
    color: #2e7d32;
}

/* ========================================
   Loading Indicator
   ======================================== */

.ahk-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px;
    margin-top: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ahk-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #1976D2;
    border-radius: 50%;
    animation: ahk-spin 0.8s linear infinite;
    margin-right: 15px;
}

@keyframes ahk-spin {
    to {
        transform: rotate(360deg);
    }
}

.ahk-loading-text {
    color: #555;
    font-size: 1em;
    font-weight: 500;
}

/* ========================================
   Admin Error (für nicht konfiguriertes Plugin)
   ======================================== */

.ahk-error {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 18px 22px;
    color: #f57f17;
    font-weight: 500;
}

/* ========================================
   Auflastung Option (innerhalb Produkt-Fieldset)
   ======================================== */

.ahk-auflastung-info {
    margin: 4px 0 0 32px;
    font-size: 0.85rem;
    color: #777;
    line-height: 1.5;
    font-weight: 400;
}

/* Auflastung Zeile in Preisübersicht */
.ahk-price-row--auflastung {
    color: #1565C0;
}

.ahk-price-row--auflastung .ahk-price-label::before {
    content: "+ ";
}

/* Rahmenverlängerung Zeile in Preisübersicht */
.ahk-price-row--frame-extension {
    color: #555;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 600px) {
    .ahk-konfigurator {
        padding: 0 10px;
    }

    .ahk-fieldset,
    .ahk-inquiry-form {
        padding: 25px 20px;
    }

    .ahk-fieldset legend {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    .ahk-btn {
        padding: 14px 24px;
    }

    .ahk-price-display {
        padding: 25px 20px;
    }

    .ahk-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .ahk-price-row--total {
        flex-direction: row;
        align-items: center;
    }

    .ahk-price-row--total .ahk-price-label,
    .ahk-price-row--total .ahk-price-value {
        font-size: 1.2em;
    }

    .ahk-auflastung-info {
        margin-left: 0;
        margin-top: 8px;
    }

    .ahk-radio-label {
        padding: 10px 14px;
    }
}

/* ========================================
   WooCommerce Integration
   ======================================== */

/* Warenkorb-Metadaten Styling */
.woocommerce-cart .cart_item dl.variation {
    margin: 10px 0 0;
}

.woocommerce-cart .cart_item dl.variation dt {
    font-weight: 600;
    color: #666;
    display: inline;
}

.woocommerce-cart .cart_item dl.variation dd {
    margin: 0 0 5px;
    display: inline;
}

.woocommerce-cart .cart_item dl.variation dd::after {
    content: "";
    display: block;
}

/* Checkout-Metadaten Styling */
.woocommerce-checkout .cart_item .variation {
    font-size: 0.9em;
    color: #666;
}

/* ========================================
   B2B Rabatthinweis
   ======================================== */

.ahk-discount-note {
    font-size: 0.9em;
    color: #27ae60;
    font-weight: 600;
    margin: 4px 0 0 0;
}

/* ========================================
   Dynamische Artikel-Gruppen (vehicle_articles)
   ======================================== */

.ahk-articles-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ahk-article-group {
    padding: 0;
}

.ahk-article-group-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.ahk-coupling-options,
.ahk-checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Höhenverstellbar immer als letzte Option anzeigen */
.ahk-radio-label[for*="hhenverstellbar"] {
    order: 1;
}

.ahk-checkbox-label {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.ahk-checkbox-label:hover {
    border-color: #bbb;
    background: #f5f5f5;
}

.ahk-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #1976D2;
    flex-shrink: 0;
}

.ahk-checkbox-label input[type="checkbox"]:checked + .ahk-checkbox-text {
    color: #1976D2;
    font-weight: 600;
}

.ahk-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #1976D2;
    background: #e3f2fd;
}

.ahk-checkbox-text {
    font-size: 0.95em;
    color: #333;
}

.ahk-article-description {
    display: block;
    margin: 2px 0 0 0;
    font-size: 0.85em;
    color: #777;
    line-height: 1.4;
    font-weight: 400;
}

.ahk-no-articles {
    padding: 20px;
    color: #777;
    text-align: center;
    font-style: italic;
}

/* ========================================
   Anfrage-Formular
   ======================================== */

.ahk-inquiry-form {
    padding: 25px 35px 30px;
}

.ahk-inquiry-text {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
}

.ahk-inquiry-form .ahk-field input[type="email"] {
    width: 100%;
    box-sizing: border-box;
}

.ahk-btn--inquiry {
    margin-top: 12px;
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    color: #fff;
    border: none;
    width: 100%;
    font-size: 1.15em;
    font-weight: 700;
    padding: 18px 32px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.ahk-btn--inquiry:hover:not(:disabled) {
    background: linear-gradient(135deg, #388E3C 0%, #1B5E20 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.ahk-btn--inquiry:active:not(:disabled) {
    transform: translateY(0);
}

.ahk-btn--inquiry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ahk-inquiry-success {
    margin-top: 16px;
    padding: 12px 16px;
    background: #edfaef;
    border-left: 4px solid #00a32a;
    border-radius: 4px;
}

.ahk-inquiry-success p {
    margin: 0;
    color: #00a32a;
}

.ahk-inquiry-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef0f0;
    border-left: 4px solid #d63638;
    border-radius: 4px;
}

.ahk-inquiry-error p {
    margin: 0;
    color: #d63638;
}

/* ========================================
   Fehlende Teile Warnung
   ======================================== */

.ahk-missing-parts-warning {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff8e1;
    border-left: 4px solid #f0b849;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #6d5300;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .ahk-konfigurator {
        box-shadow: none;
    }

    .ahk-btn {
        display: none;
    }

    .ahk-loading {
        display: none !important;
    }
}
