/* ═══════════════════════════════════════════════════════════════
   Quickpay.ge — Button & Gateway Selector Design System v2.1.0
   ═══════════════════════════════════════════════════════════════ */

:root {
    --qp-color:      #EA4C38;
    --qp-color-dark: #C73F2E;
    --qp-text:       #ffffff;
    --qp-radius:     8px;
    --qp-shadow:     0 4px 14px rgba(0, 0, 0, 0.14);
    --qp-shadow-hov: 0 6px 22px rgba(0, 0, 0, 0.20);
    --qp-ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base action button ──────────────────────────────────────── */
.quickpay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.4;
    cursor: pointer;
    transition: transform 0.22s var(--qp-ease),
                box-shadow 0.22s var(--qp-ease),
                background 0.18s ease,
                border-color 0.18s ease;
    text-decoration: none;
    border: 2px solid transparent;
    outline: none;
    box-sizing: border-box;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    background: var(--qp-color);
    color: var(--qp-text);
    border-radius: var(--qp-radius);
    box-shadow: var(--qp-shadow);
    padding: 11px 22px;
    font-size: 14px;
}

/* Shimmer sweep */
.quickpay-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 80%);
    transform: translateX(-110%);
    transition: transform 0.55s ease;
    pointer-events: none;
}

.quickpay-btn:hover:not(:disabled)::before { transform: translateX(110%); }

.quickpay-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--qp-shadow-hov);
    background: var(--qp-color-dark);
}

.quickpay-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--qp-shadow);
}

.quickpay-btn:disabled        { cursor: not-allowed; opacity: 0.4; }
.quickpay-btn:focus-visible   { outline: 3px solid var(--qp-color); outline-offset: 3px; opacity: .85; }

/* ── Size variants ───────────────────────────────────────────── */
.quickpay-btn.qp-size-small  { padding: 8px 16px;  font-size: 12px; }
.quickpay-btn.qp-size-medium { padding: 11px 22px; font-size: 14px; }
.quickpay-btn.qp-size-large  { padding: 14px 30px; font-size: 16px; }

/* ── Outlined variant ────────────────────────────────────────── */
.quickpay-btn.qp-outlined {
    background: transparent;
    color: var(--qp-color);
    border-color: var(--qp-color);
    box-shadow: none;
}
.quickpay-btn.qp-outlined::before { display: none; }
.quickpay-btn.qp-outlined:hover:not(:disabled) {
    background: var(--qp-color);
    color: #fff;
    border-color: var(--qp-color);
    box-shadow: var(--qp-shadow);
}

/* ── Icons inside buttons ────────────────────────────────────── */
.quickpay-btn img,
.quickpay-btn svg {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.quickpay-btn .qp-btn-label { position: relative; z-index: 1; }

/* ── Per-gateway selector grid ───────────────────────────────── */
.quickpay-gateway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 10px 0 6px;
}

.quickpay-gw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 8px 12px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: var(--qp-radius, 8px);
    cursor: pointer;
    transition: border-color 0.2s ease,
                box-shadow 0.2s ease,
                transform 0.2s var(--qp-ease);
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.quickpay-gw-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--qp-gw-color, var(--qp-color));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.quickpay-gw-card:hover:not(.qp-gw-disabled) {
    border-color: var(--qp-gw-color, var(--qp-color));
    box-shadow: 0 4px 16px rgba(0,0,0,0.11);
    transform: translateY(-2px);
}

.quickpay-gw-card:hover:not(.qp-gw-disabled)::before { opacity: 0.05; }

.quickpay-gw-card.qp-gw-selected {
    border-color: var(--qp-gw-color, var(--qp-color));
    box-shadow: 0 0 0 1px var(--qp-gw-color, var(--qp-color)),
                0 4px 14px rgba(0,0,0,0.10);
    background: #fafafa;
    transform: translateY(-1px);
}

/* Check badge */
.quickpay-gw-card.qp-gw-selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 10px;
    font-weight: 800;
    color: var(--qp-gw-color, var(--qp-color));
    line-height: 1;
}

.quickpay-gw-card.qp-gw-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.quickpay-gw-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.14);
    position: relative;
    z-index: 1;
}

.quickpay-gw-name {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.quickpay-gw-card.qp-gw-selected .quickpay-gw-name {
    color: var(--qp-gw-color, var(--qp-color));
}

/* Tags / pills */
.qp-gw-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.4;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.qp-tag-installment { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.qp-tag-gel         { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.qp-tag-free        { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* GEL notice */
.qp-gel-notice {
    font-size: 12px;
    color: #d97706;
    margin: 2px 0 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Product page buttons — wrapper ──────────────────────── */
.quickpay-product-buttons {
    margin: 14px 0;
}

/* ── Single unified button ───────────────────────────────── */
.quickpay-product-buttons .quickpay-btn.qp-pp-single {
    width: 100%;
    gap: 12px;
    padding: 15px 28px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    justify-content: center;
    letter-spacing: 0.3px;
    background: var(--qp-color) !important;
    color: #fff !important;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single:hover:not(:disabled) {
    background: var(--qp-color-dark) !important;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single .qp-pp-logo {
    width: auto;
    height: 26px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* ── Single button — Premium v2 ──────────────────────────── */
.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 {
    width: 100%;
    gap: 14px;
    padding: 10px 24px 10px 10px !important;
    border-radius: 100px !important;
    background: linear-gradient(135deg, #F15D42 0%, #EA4C38 50%, #CF3B27 100%) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    justify-content: flex-start;
    box-shadow: 0 6px 20px rgba(234, 76, 56, 0.38), 0 2px 6px rgba(0,0,0,0.10) !important;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2:hover:not(:disabled) {
    background: linear-gradient(135deg, #E5503A 0%, #D43B28 100%) !important;
    box-shadow: 0 8px 28px rgba(234, 76, 56, 0.52), 0 3px 10px rgba(0,0,0,0.14) !important;
    transform: translateY(-2px);
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 .qp-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 .qp-icon-badge .qp-pp-logo {
    height: 22px;
    width: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.22));
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 .qp-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 .qp-btn-main {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0.2px;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v2 .qp-btn-sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.76);
    letter-spacing: 0.4px;
    line-height: 1.2;
}

/* ── Single button — Swipe-to-pay v3 ─────────────────────── */
@keyframes qp-icon-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-4px) scale(1.06); }
}

@keyframes qp-arrow-pulse {
    0%, 100% { opacity: 0.55; transform: translateX(0); }
    50%       { opacity: 1;    transform: translateX(5px); }
}

@keyframes qp-nudge {
    0%         { transform: translateX(0); }
    25%        { transform: translateX(14px); }
    55%        { transform: translateX(-4px); }
    80%        { transform: translateX(8px); }
    100%       { transform: translateX(0); }
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v3 {
    width: 100%;
    gap: 12px;
    padding: 11px 14px 11px 12px !important;
    border-radius: 100px !important;
    background: linear-gradient(135deg, #F15D42 0%, #EA4C38 50%, #CF3B27 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(234, 76, 56, 0.38), 0 2px 6px rgba(0,0,0,0.10) !important;
    justify-content: flex-start;
    align-items: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v3:hover:not(:disabled) {
    transform: none !important;
    box-shadow: 0 8px 26px rgba(234, 76, 56, 0.46), 0 3px 8px rgba(0,0,0,0.12) !important;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v3.qp-swiping {
    cursor: grabbing;
}

.quickpay-product-buttons .quickpay-btn.qp-pp-single-v3.qp-nudge {
    animation: qp-nudge 0.52s ease;
}

/* Swipe fill — expands right; width set via JS on the element directly */
.qp-v3-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.18);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Loading state: fill 100% while AJAX runs */
.quickpay-product-buttons .quickpay-btn.qp-pp-single-v3.qp-loading .qp-v3-fill {
    width: 100% !important;
    transition: width 0.18s ease;
}

/* Bolt badge */
.qp-v3-bolt {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.26);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.qp-v3-bolt .qp-pp-logo {
    height: 20px;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.22));
}

/* Center text */
.qp-v3-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.qp-v3-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.qp-v3-hint {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
}

.qp-v3-arrow {
    display: inline-block;
    font-size: 13px;
    animation: qp-arrow-pulse 1.5s ease-in-out infinite;
}

/* Right: gateway icons */
.qp-v3-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.qp-v3-gw-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    object-fit: contain;
    background: none;
    padding: 0;
    box-shadow: none;
    display: block;
    flex-shrink: 0;
    animation: qp-icon-float 2.2s ease-in-out infinite;
}

/* ── Express Checkout divider ─────────────────────────────── */
.qp-pp-express-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 14px;
}
.qp-pp-express-line {
    flex: 1;
    height: 1px;
    background: #eaeaea;
    display: block;
}
.qp-pp-express-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #bbb;
    white-space: nowrap;
}

/* ── Separate mode — 2-column grid ───────────────────────── */
.quickpay-product-buttons.qp-pp-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.quickpay-product-buttons.qp-pp-rows.qp-cols-1 {
    grid-template-columns: 1fr;
}
.quickpay-product-buttons.qp-pp-rows.qp-cols-auto {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
/* Last button spans full width when total count is odd */
.quickpay-product-buttons.qp-pp-rows:not(.qp-cols-1) .qp-pp-row-last-odd {
    grid-column: span 2;
}

/* ── Base button ──────────────────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows .quickpay-pp-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 0 18px !important;
    height: 56px !important;
    border-radius: 12px !important;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s ease,
                box-shadow 0.15s ease,
                background 0.15s ease,
                filter 0.15s ease;
    text-decoration: none !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
}
.quickpay-product-buttons.qp-pp-rows .quickpay-pp-row:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── White / Outlined variant ─────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-white .quickpay-pp-row {
    background: #fff !important;
    border: 1.5px solid #e4e4e4 !important;
    box-shadow: none !important;
    color: #111 !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-white .quickpay-pp-row:hover:not(:disabled) {
    border-color: var(--qp-gw-color, #EA4C38) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    background: #fff !important;
    color: #111 !important;
    filter: none;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-white .quickpay-pp-row:active:not(:disabled) {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-white .quickpay-pp-row:focus-visible {
    outline: 3px solid var(--qp-gw-color, #EA4C38);
    outline-offset: 3px;
}

/* ── Brand Color variant ──────────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row {
    background: var(--qp-gw-color, #EA4C38) !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row:hover:not(:disabled) {
    filter: brightness(0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22) !important;
    color: #fff !important;
    text-decoration: none !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row:active:not(:disabled) {
    filter: brightness(0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16) !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row:focus-visible {
    outline: 3px solid var(--qp-gw-color, #EA4C38);
    outline-offset: 3px;
}

/* ── Dark variant ─────────────────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-dark .quickpay-pp-row {
    background: #111827 !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-dark .quickpay-pp-row:hover:not(:disabled) {
    background: #1f2937 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30) !important;
    color: #fff !important;
    text-decoration: none !important;
    filter: none;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-dark .quickpay-pp-row:active:not(:disabled) {
    background: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20) !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-dark .quickpay-pp-row:focus-visible {
    outline: 3px solid #6366f1;
    outline-offset: 3px;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-dark .quickpay-pp-row-logo {
    filter: none;
}

/* ── Logo icon ────────────────────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows .quickpay-pp-row-logo {
    display: block !important;
    height: 26px !important;
    width: auto !important;
    max-width: 64px !important;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row-logo {
    filter: none;
}

/* ── Gateway name ─────────────────────────────────────────── */
.quickpay-product-buttons.qp-pp-rows .quickpay-pp-row-name {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
    text-shadow: none !important;
    letter-spacing: 0 !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-white .quickpay-pp-row-name {
    color: #111 !important;
}
.quickpay-product-buttons.qp-pp-rows.qp-btn-v-brand .quickpay-pp-row-name {
    color: #fff !important;
}

/* ── Installment chips ────────────────────────────────────────── */
.quickpay-installment-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 4px 0 10px;
}
.qp-installment-heading {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.qp-installment-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    background: #fef9eb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.qp-installment-chip:hover { background: #fef3c7; border-color: #f59e0b; }

/* ── Shortcode wrapper ────────────────────────────────────────── */
.quickpay-shortcode-wrap { display: inline-block; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .quickpay-gateway-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
    }
    .quickpay-gw-icon { width: 30px; height: 30px; }
    .quickpay-product-buttons.qp-pp-rows .quickpay-pp-row { height: 50px !important; gap: 8px !important; padding: 0 14px !important; }
    .quickpay-product-buttons.qp-pp-rows .quickpay-pp-row-logo { height: 22px !important; }
    .quickpay-product-buttons.qp-pp-rows .quickpay-pp-row-name { font-size: 12.5px !important; }
}

/* ── Phase 43 — [quickpay_gateway_list] + cart checkout button ──────────────── */
.quickpay-gateway-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.quickpay-gateway-list.qp-gw-list-list { flex-direction: column; align-items: flex-start; }
.quickpay-gateway-list .qp-gw-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff;
}
.quickpay-gateway-list .qp-gw-badge img { width: 28px; height: 28px; object-fit: contain; }
.quickpay-gateway-list .qp-gw-name { font-size: 13px; color: #374151; }

.quickpay-cart-checkout-wrap { margin-top: 8px; }
.quickpay-cart-checkout-btn { margin-top: 8px; }

/* ── Separate-gateway cart buttons ─────────────────────────── */
.quickpay-cart-checkout-separate {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.quickpay-cart-checkout-gw-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 16px !important;
    background: var(--qp-gw-color, #EA4C38) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}
.quickpay-cart-checkout-gw-btn:hover { filter: brightness(1.1); }
.quickpay-cart-gw-icon { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.quickpay-spinner {
    display: inline-block; width: 14px; height: 14px; margin-right: 6px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
    vertical-align: -2px; animation: quickpay-spin .7s linear infinite;
}
@keyframes quickpay-spin { to { transform: rotate(360deg); } }
