/**
 * Semtak Delivery Manager - Contact Buttons (Zadzwoń / Zapytaj o produkt)
 *
 * Visually consistent with .stk-delivery-info-box (same palette, radius,
 * typography). Mobile-first. Zero JS in markup (CSP-safe).
 *
 * @package SemtakDelivery
 */

/* === Buttons row (below delivery box) === */
.stk-contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 20px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
}

@media (min-width: 600px) {
    .stk-contact-buttons {
        flex-direction: row;
    }
}

.stk-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.stk-contact-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.5;
}

/* Call — primary (green, like stk-status-available) */
.stk-contact-call {
    background: #059669;
    border: 1px solid #059669;
    color: #fff !important;
}

.stk-contact-call:hover,
.stk-contact-call:focus {
    background: #047857;
    border-color: #047857;
    color: #fff !important;
    text-decoration: none;
}

/* Ask — secondary (white, like delivery box rows) */
.stk-contact-ask {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.stk-contact-ask:hover,
.stk-contact-ask:focus {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.stk-contact-ask svg {
    color: #E53935;
}

/* === Mobile sticky call bar === */
.stk-sticky-call-bar {
    display: none;
}

@media (max-width: 782px) {
    .stk-sticky-call-bar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9990;
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
        box-sizing: border-box;
    }

    .stk-sticky-call-bar .stk-contact-btn {
        width: 100%;
    }

    /* Make room so the bar does not cover footer content */
    body.single-product {
        padding-bottom: 70px;
    }

    /*
     * Coexistence with the theme mobile bottom bar (.igameble-mobile-bottom-bar):
     * theme bar is fixed bottom, height 60px + safe-area, z-index 9998, and sets
     * body.has-mobile-bottom-bar { padding-bottom: calc(60px + env(...)) !important; }.
     * Lift the call bar above it and reserve room for BOTH bars (60 + 70 = 130px).
     */
    body.has-mobile-bottom-bar .stk-sticky-call-bar {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    body.single-product.has-mobile-bottom-bar {
        padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* === Inquiry modal === */

/* Fallback: browsers without <dialog> support render it as a plain block —
   keep it hidden unless actually opened (JS hides the trigger anyway). */
dialog.stk-inquiry-modal:not([open]) {
    display: none;
}

dialog.stk-inquiry-modal {
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

dialog.stk-inquiry-modal::backdrop {
    background: rgba(0, 0, 0, .5);
}

.stk-inquiry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.stk-inquiry-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.stk-inquiry-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
}

.stk-inquiry-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.stk-inquiry-close svg {
    width: 18px;
    height: 18px;
}

.stk-inquiry-form {
    padding: 16px 20px 20px;
}

.stk-inquiry-field {
    margin: 0 0 12px;
}

.stk-inquiry-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.stk-inquiry-field input,
.stk-inquiry-field textarea,
.stk-inquiry-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
}

.stk-inquiry-field input:focus,
.stk-inquiry-field textarea:focus,
.stk-inquiry-field select:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 1px #059669;
}

.stk-inquiry-field input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

.stk-inquiry-hint {
    margin: -6px 0 12px;
    font-size: 12px;
    color: #6b7280;
}

.stk-inquiry-required {
    color: #dc2626;
}

.stk-inquiry-preferred {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.stk-inquiry-preferred legend {
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.stk-inquiry-preferred label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
    font-size: 13px;
    cursor: pointer;
}

.stk-inquiry-consent {
    margin: 0 0 12px;
}

.stk-inquiry-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
}

.stk-inquiry-consent input {
    margin-top: 2px;
    flex-shrink: 0;
}

.stk-inquiry-consent a {
    color: #E53935;
    text-decoration: underline;
}

/* Honeypot — visually hidden, still focusable for bots that ignore CSS */
.stk-inquiry-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: 0;
}

.stk-inquiry-feedback {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.stk-inquiry-feedback[hidden] {
    display: none;
}

.stk-inquiry-feedback.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.stk-inquiry-feedback.is-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.stk-inquiry-submit {
    width: 100%;
    background: #E53935;
    border: 1px solid #E53935;
    color: #fff;
}

.stk-inquiry-submit:hover,
.stk-inquiry-submit:focus {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.stk-inquiry-submit[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* === Thank-you screen (po udanej wysyłce — oba modale) ===
   JS chowa formularz i pokazuje ten ekran; zamknięcie modala przywraca formularz. */
.stk-inquiry-thanks {
    padding: 28px 24px 24px;
    text-align: center;
}

.stk-inquiry-thanks[hidden],
.stk-inquiry-form[hidden] {
    display: none;
}

.stk-thanks-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    color: #059669;
    stroke-width: 1.5;
}

.stk-thanks-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.stk-thanks-text {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}

.stk-inquiry-thanks form {
    margin: 0;
}

.stk-thanks-close {
    width: 100%;
    background: #059669;
    border: 1px solid #059669;
    color: #fff;
}

.stk-thanks-close:hover,
.stk-thanks-close:focus {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

/* === Callback modal ("Oddzwonimy" — poza godzinami pracy) ===
   Reuses the inquiry modal skin; only the intro message is new. */
.stk-callback-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    font-size: 13px;
    color: #92400e;
}
