/**
 * Preorder Accordion Styles
 */

/* Container */
.preorder-accordion-item {
    overflow: hidden;
    margin-bottom: var(--stk--preset--spacing--30, 0.67rem) !important;  
    transition: box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1); /* Standard-Rahmen falls bgColor nicht greift */
}

/* Titel-Bereich (Summary) */
.preorder-accordion-title {
    padding: 18px 24px;
    cursor: pointer;
    list-style: none;
    outline: none;
    font-family: var(--theme-font-family);
    
    /* Flexbox für Ausrichtung */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; /* Zentriert Headline, Datum und Chevron vertikal */
    justify-content: flex-start !important; /* Hält Inhalt links, Chevron schieben wir mit margin-left */
    gap: 12px !important;
}

/* Versteckt den Standard-Browser-Pfeil */
.preorder-accordion-title::-webkit-details-marker {
    display: none;
}

/* Die Headline im Accordion */
.preorder-accordion-title h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.3em;
    text-align: start;
    display: inline-block !important;
    line-height: 1.2;
}

/* Das befreite Datum (außerhalb h3) */
.preorder-header-dates {
    font-weight: 400 !important;
    font-size: 0.8em !important;
    color: #666 !important;
    text-transform: none !important;
    white-space: nowrap;
    font-style: normal !important;
    letter-spacing: normal !important;
    line-height: 1;
}

/* Der SVG Chevron */
.preorder-accordion-title::after {
    content: "";
    flex-shrink: 0;
    margin-left: auto; /* Schiebt den Chevron ganz nach rechts */
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.preorder-accordion-item[open] .preorder-accordion-title::after {
    transform: rotate(180deg);
}

/* Inhaltsbereich & Animation */
.accordion-content {
    padding: 25px;
    background: #f1f1f1;
    border-top: 1px solid rgba(0,0,0,0.05);
    animation: accordionSlideIn 0.4s ease-out;
}

@keyframes accordionSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Formular Styling */
.preorder-form-wrapper {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Pflichtfeld-Sternchen */
.form-group label .required {
    color: #d63638;
    font-weight: bold;
    margin-left: 3px;
}

/* AJAX Resultate */
.preorder-result {
    margin-top: 25px;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1.5;
    display: none;
    animation: preorderSlideIn 0.3s ease-out;
}

@keyframes preorderSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Resultat-Zustände */
.preorder-result.error {
    background-color: #fcf2f2;
    border: 1px solid #d63638;
    color: #d63638 !important;
}

.preorder-result.success {
    background-color: #f0f9f1;
    border: 1px solid #46b450;
    color: #46b450 !important;
}

/* Lade-Zustand & Spinner */
.preorder-form.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.preorder-form button[disabled] {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.8;
}

.preorder-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: preorder-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes preorder-spin {
    to { transform: rotate(360deg); }
}