/* ================================================================
   KPM Frontend Styles — Kingdom Pricing Tabs Widget
   ================================================================ */

/* ── Wrapper ────────────────────────────────────────────────────── */

.kpm-pricing-wrap {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111827;
    max-width: 100%;
    margin: 0 auto;
}

/* ── Tab Navigation Row ─────────────────────────────────────────── */

.kpm-tabs-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
}

/* ── Arrow Buttons ──────────────────────────────────────────────── */

.kpm-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.kpm-arrow:hover {
    border-color: #38bdf8;
    color: #0ea5e9;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.kpm-arrow:active {
    transform: scale(0.93);
}

.kpm-arrow:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.kpm-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Tab Bar ────────────────────────────────────────────────────── */

.kpm-tabs-bar {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* hidden — arrows handle navigation */
    scroll-behavior: smooth;
    /* Small padding so first/last tabs are never clipped by arrow buttons */
    padding-left: 2px;
    padding-right: 2px;
    scroll-padding-left: 2px;
    cursor: grab;
}

/* Dragging state — set by JS */
.kpm-tabs-bar.kpm-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    /* instant during drag */
    user-select: none;
    -webkit-user-select: none;
}

.kpm-tabs-bar::-webkit-scrollbar {
    display: none;
}

/* ── Tab Button ─────────────────────────────────────────────────── */

.kpm-tab-btn {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.kpm-tab-btn:hover {
    border-color: #38bdf8;
    color: #0ea5e9;
    background: #f0f9ff;
}

.kpm-tab-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.kpm-tab-btn.active {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

/* ── Tab Panel ──────────────────────────────────────────────────── */

.kpm-tab-panel {
    display: none;
    animation: kpmFadeIn 0.28s ease;
}

.kpm-tab-panel.active {
    display: block;
}

@keyframes kpmFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Table Wrapper ──────────────────────────────────────────────── */

.kpm-pricing-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ── Pricing Table ──────────────────────────────────────────────── */

.kpm-pricing-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.kpm-pricing-table thead {
    background: #38bdf8;
}

.kpm-pricing-table thead tr th {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    text-align: left;
}

.kpm-pricing-table .kpm-th-price {
    text-align: right;
    width: 200px;
}

.kpm-pricing-table tbody tr {
    transition: background 0.15s ease;
}

.kpm-pricing-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.kpm-pricing-table tbody tr:hover {
    background: #f0f9ff;
}

.kpm-pricing-table tbody td {
    padding: 13px 20px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.5;
}

.kpm-td-service {
    color: #1f2937;
    font-weight: 450;
}

.kpm-td-price {
    text-align: right;
    color: #0ea5e9;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease;
}

.kpm-pricing-table tbody tr:last-child td {
    border-bottom: none;
}

.kpm-empty {
    text-align: center;
    color: #9ca3af;
    padding: 32px 20px !important;
    font-style: italic;
}

/* ── Mobile Card View ───────────────────────────────────────────── */

.kpm-cards-mobile {
    display: none;
}

/* ── Bottom Bar ─────────────────────────────────────────────────── */

.kpm-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* ── Contact Button ─────────────────────────────────────────────── */

.kpm-contact-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 55%, #7dd3fc 100%);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
    letter-spacing: -0.01em;
}

.kpm-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.38);
    color: #fff;
    text-decoration: none;
}

.kpm-contact-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(14, 165, 233, 0.25);
}

/* Shine sweep animation */
.kpm-contact-shine {
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.22) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: kpmShine 3.5s ease-in-out infinite;
}

@keyframes kpmShine {
    0% {
        left: -75%;
    }

    35% {
        left: 125%;
    }

    100% {
        left: 125%;
    }
}

.kpm-contact-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Currency Switcher ──────────────────────────────────────────── */

.kpm-currency-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px;
}

.kpm-currency-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.kpm-currency-btn:hover {
    color: #374151;
    background: #fff;
}

.kpm-currency-btn.active {
    background: #38bdf8;
    color: #fff;
    box-shadow: 0 2px 6px rgba(56, 189, 248, 0.25);
}

.kpm-currency-flag {
    font-size: 16px;
    line-height: 1;
}

.kpm-currency-divider {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.kpm-rate-badge {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    padding: 0 8px 0 4px;
    white-space: nowrap;
    opacity: 0.85;
    font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 640px) {

    /* Switch to card layout */
    .kpm-pricing-table-wrap {
        display: none;
    }

    .kpm-cards-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .kpm-card {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        transition: box-shadow 0.2s;
    }

    .kpm-card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    }

    .kpm-card-service {
        font-size: 14px;
        font-weight: 500;
        color: #1f2937;
        line-height: 1.45;
    }

    .kpm-card-price {
        font-size: 15px;
        font-weight: 700;
        color: #0ea5e9;
        font-variant-numeric: tabular-nums;
        transition: color 0.2s;
    }

    /* Tabs: smaller on mobile */
    .kpm-tab-btn {
        font-size: 12px;
        padding: 7px 13px;
    }

    .kpm-arrow {
        width: 32px;
        height: 32px;
    }

    /* Bottom bar stacks */
    .kpm-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpm-contact-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Medium screens: horizontal scroll on table ─────────────────── */

@media (min-width: 641px) and (max-width: 900px) {
    .kpm-pricing-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kpm-pricing-table {
        min-width: 540px;
    }
}