/* Kupi 1 Klik – frontend styles */

.k1k-btn {
    margin-top: 10px;
    background: #e44;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 3px;
    display: inline-block;
    transition: background 0.2s;
}

.k1k-btn:hover,
.k1k-btn:focus {
    background: #c00;
    color: #fff;
}

/* Overlay */
.k1k-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.k1k-overlay[hidden] {
    display: none;
}

/* Popup box */
.k1k-popup {
    background: #fff;
    border-radius: 6px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Popup header + close button */
.k1k-popup__header {
    display: flex;
    justify-content: flex-end;
    /* on desktop this header is just a thin row housing the absolute-ish button */
    height: 0;
    overflow: visible;
}

.k1k-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    /* on desktop sit in the top-right corner without disturbing layout */
    position: relative;
    top: 8px;
    right: -8px;
}

.k1k-close:hover,
.k1k-close:focus {
    color: #000;
    background: rgba(0, 0, 0, 0.06);
    outline: none;
}

/* Body wrapper (scrollable on mobile, static on desktop) */
.k1k-popup__body {
    padding: 0; /* desktop: padding comes from the popup box itself */
}

/* Product preview */
.k1k-popup__product {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.k1k-popup__img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.k1k-popup__name {
    font-size: 1.1rem;
    margin: 0 0 6px;
    font-weight: 600;
}

.k1k-cod-notice {
    margin: 0;
    font-size: 0.85rem;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.k1k-cod-icon {
    font-style: normal;
}

/* Form layout */
.k1k-form__row {
    display: flex;
    gap: 16px;
}

.k1k-form__row--half > .k1k-form__field {
    flex: 1;
    min-width: 0;
}

.k1k-form__field {
    margin-bottom: 14px;
}

.k1k-form__field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.k1k-required {
    color: #c00;
}

.k1k-form__field input,
.k1k-form__field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.k1k-form__field input:focus,
.k1k-form__field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

.k1k-form__field input.k1k-invalid {
    border-color: #c00;
}

/* Message */
.k1k-form__msg {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.k1k-form__msg[hidden] {
    display: none;
}

.k1k-form__msg--error {
    background: #fdecea;
    border: 1px solid #c00;
    color: #c00;
}

.k1k-form__msg--success {
    background: #edf7ed;
    border: 1px solid #3a7d44;
    color: #2a5e31;
}

/* Submit */
.k1k-submit {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    cursor: pointer;
    background: #e44;
    color: #fff;
    border: none;
    border-radius: 4px;
    transition: background 0.2s;
    margin-top: 4px;
}

.k1k-submit:hover:not(:disabled) {
    background: #c00;
}

.k1k-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .k1k-overlay {
        align-items: flex-end;
        padding: 0;
    }

    /* Bottom-sheet style popup */
    .k1k-popup {
        border-radius: 12px 12px 0 0;
        max-height: 92vh;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden; /* popup box itself does NOT scroll */
    }

    /* Header stays fixed at top, never scrolls away */
    .k1k-popup__header {
        height: auto;
        flex-shrink: 0;
        display: flex;
        justify-content: flex-end;
        padding: 8px 8px 0;
        background: #fff;
        border-radius: 12px 12px 0 0;
    }

    /* Large, round, easy-to-tap close button */
    .k1k-close {
        position: static;
        top: auto;
        right: auto;
        min-width: 48px;
        min-height: 48px;
        font-size: 1.8rem;
        border-radius: 50%;
        background: #f0f0f0;
        color: #333;
    }

    .k1k-close:hover,
    .k1k-close:focus {
        background: #ddd;
    }

    /* Scrollable content lives here */
    .k1k-popup__body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 16px 32px;
        flex: 1;
    }

    .k1k-form__row {
        flex-direction: column;
        gap: 0;
    }
}
