/*
 * WC Odstúpenie od zmluvy – štýly formulára aj stĺpca v histórii objednávok.
 * Verzia assetu sa rieši cez WC_ODSTUPENIE_VER v hlavnom PHP súbore (cache-busting).
 */

/* ===========================================================================
   FORMULÁR (shortcode [wc_odstupenie_formular])
   =========================================================================== */
/* ── Reset & základy ── */
.wc-od-wrap *,
.wc-od-wrap *::before,
.wc-od-wrap *::after { box-sizing: border-box; }

.wc-od-wrap {
    font-family: inherit;
    color: #111827;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Spoločné polia ── */
.wc-od-wrap input[type="text"],
.wc-od-wrap input[type="email"],
.wc-od-wrap input[type="date"],
.wc-od-wrap input[type="number"],
.wc-od-wrap textarea,
.wc-od-wrap select {
    width: 100%;
    border: 1px solid #dbe1ea;
    border-radius: 14px;
    padding: 15px 18px;
    font-size: 16px;
    background: #fff;
    margin-bottom: 0;
    font-family: inherit;
    color: #111827;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wc-od-wrap input:focus,
.wc-od-wrap select:focus,
.wc-od-wrap textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.wc-od-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.wc-od-group { margin-bottom: 0; }

.wc-od-section {
    margin-bottom: 24px;
}

.wc-od-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.wc-od-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}

.wc-od-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ── Krok 1: vstupná obrazovka ── */
#wc-od-step-1 {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

#wc-od-step-1 .wc-od-group + .wc-od-group {
    margin-top: 16px;
}

.wc-od-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    margin-top: 20px;
    width: 100%;
}

.wc-od-btn-primary:hover { background: #1d4ed8; }
.wc-od-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* ── Chybová správa ── */
.wc-od-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    color: #b91c1c;
    font-size: 14px;
    margin-top: 14px;
    display: none;
}

.wc-od-error.visible { display: block; }

/* ── Warning: lehota ── */
.wc-od-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 16px;
    color: #92400e;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wc-od-warning-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.4;
}

/* ── Výpočet lehoty pod poľom dátumu doručenia ── */
.wc-od-lehota-info {
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 8px;
}

.wc-od-lehota-info--valid {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.wc-od-lehota-info--expired {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* ── Krok 2: formulár ── */
#wc-od-step-2 { display: none; }

/* ── Dynamické položky ── */
#wc-od-polozky-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.wc-od-polozka-row {
    display: grid;
    grid-template-columns: 1fr 100px 40px;
    gap: 10px;
    align-items: center;
}

.wc-od-polozka-row input { margin-bottom: 0 !important; }

.wc-od-remove-wrap--hidden .wc-od-remove-btn { visibility: hidden; }

.wc-od-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #ef4444;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

.wc-od-remove-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.wc-od-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f6ff;
    color: #2563eb;
    border: 1px dashed #93c5fd;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.wc-od-add-btn:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

/* ── Späť button ── */
.wc-od-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    font-family: inherit;
    transition: color 0.15s;
}

.wc-od-btn-back:hover { color: #111827; }

/* ── GDPR checkbox ── */
.wc-od-gdpr {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.wc-od-gdpr input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
    border-radius: 4px !important;
    padding: 0 !important;
}

.wc-od-gdpr a {
    color: #2563eb;
    text-decoration: none;
}

.wc-od-gdpr a:hover { text-decoration: underline; }

/* ── Turnstile ── */
.wc-od-turnstile { margin-bottom: 18px; }

/* ── Success ── */
.wc-od-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 28px 32px;
    text-align: center;
    color: #166534;
}

.wc-od-success strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.wc-od-success p {
    margin: 0;
    font-size: 15px;
    color: #15803d;
}

/* ── Loading spinner ── */
.wc-od-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wc-od-spin 0.6s linear infinite;
    flex-shrink: 0;
}

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

/* ── Readonly polia (predvyplnené) ── */
.wc-od-readonly {
    background: #f9fafb !important;
    color: #6b7280 !important;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .wc-od-row-3,
    .wc-od-row-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wc-od-polozka-row {
        grid-template-columns: 1fr 80px 36px;
    }
}

/* ===========================================================================
   HISTÓRIA OBJEDNÁVOK – stĺpec „Vrátenie tovaru" (Môj účet → Objednávky)
   =========================================================================== */
.wc-od-acc-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.wc-od-acc-btn:hover { background: #1d4ed8; color: #fff; }
.wc-od-acc-na { color: #9ca3af; }
