/* Express Delivery Scheduler - Konfigurierbar via CSS-Variablen */

#xpds-widget {
    --xpds-radius: 4px;
    --xpds-bg: transparent;
    --xpds-input-bg: #ffffff;
    --xpds-border: #ced4da;
    --xpds-label: #707070;
    --xpds-width: 240px;
    --xpds-pad: 0;

    margin: 6px 0 2px;
    padding: var(--xpds-pad);
    font-size: 0.75rem;
    max-width: var(--xpds-width);
    text-align: left;
    line-height: 1.3;
    background: var(--xpds-bg);
    border-radius: var(--xpds-radius);
}
/* Wenn Hintergrund gesetzt → leichten Rahmen + Padding */
#xpds-widget[style*="--xpds-bg"]:not([style*="transparent"]) {
    border: 1px solid var(--xpds-border);
}

.xpds-field { margin-bottom: 3px; }
.xpds-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--xpds-label);
    margin-bottom: 0;
}

.xpds-input {
    width: 100%;
    height: 26px;
    font-size: 0.75rem;
    border: 1px solid var(--xpds-border);
    border-radius: var(--xpds-radius);
    padding: 1px 6px;
    background: var(--xpds-input-bg);
    color: #525252;
    transition: border-color 0.15s;
}
.xpds-input:focus {
    border-color: #F8BF00;
    outline: 0;
    box-shadow: 0 0 0 1px rgba(248,191,0,0.25);
}
.xpds-input[readonly] { background: var(--xpds-input-bg); cursor: pointer; }

/* PLZ Feedback */
.xpds-plz-feedback {
    font-size: 0.625rem;
    min-height: 0;
    line-height: 1.2;
    display: block;
}
.xpds-plz-feedback:empty { display: none; }
.xpds-plz-feedback--success { color: #1C871E; }
.xpds-plz-feedback--error { color: #b90000; }
.xpds-plz-feedback--warning { color: #a56823; }
.xpds-plz-feedback--loading { color: #999; }

/* Kalender Dropdown */
.xpds-calendar-group { position: relative; }
.xpds-cal-dropdown {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--xpds-radius);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 5px;
    margin-top: 1px;
    width: 210px;
}
.xpds-cal__head { text-align: center; font-size: 0.6875rem; margin-bottom: 2px; display: flex; align-items: center; justify-content: space-between; }
.xpds-cal__nav { cursor: pointer; padding: 2px 6px; font-size: 0.625rem; user-select: none; border-radius: 2px; line-height: 1; }
.xpds-cal__nav:hover { background: #e0e0e0; }
.xpds-cal__nav--disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.xpds-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.xpds-cal__dow { text-align: center; font-size: 0.5rem; font-weight: 600; color: #aaa; padding: 1px 0; }
.xpds-day { text-align: center; padding: 2px 0; font-size: 0.625rem; border-radius: 2px; }
.xpds-day--off { color: #ccc; }
.xpds-day--ok { cursor: pointer; color: #333; }
.xpds-day--ok:hover { background: #FFF3CD; }
.xpds-day--sel { background: #F8BF00 !important; color: #fff !important; font-weight: 700; border-radius: var(--xpds-radius); }
.xpds-day--today { font-weight: 700; }
.xpds-day--we.xpds-day--ok { color: #0066cc; }
.xpds-day--pickup.xpds-day--ok { color: #e67e22; font-style: italic; }
.xpds-day--pickup.xpds-day--ok:hover { background: #fdebd0; }
.xpds-pickup-info { font-size: 0.6rem; color: #666; margin-top: 2px; line-height: 1.3; }

/* Preis + Reset */
.xpds-pricing-group { margin: 0; }
.xpds-pricing__value { font-size: 0.75rem; font-weight: 600; color: #525252; }
.xpds-fade { animation: xF 0.3s ease; }
@keyframes xF { from { opacity: 0.3; } to { opacity: 1; } }
.xpds-reset { font-size: 0.625rem; color: var(--xpds-label); text-decoration: underline; display: inline-block; }
.xpds-reset:hover { color: #333; }

/* NOVA Layout Fix */
.basket-form-inline .col:has(#xpds-widget) {
    flex: 0 0 100%;
    max-width: 100%;
}
.basket-form-inline { flex-wrap: wrap; }

@media (max-width: 768px) {
    #xpds-widget { max-width: 100% !important; }
    .xpds-cal-dropdown { width: 100%; position: relative; }
}
