/* ============================================================
   Pretpot – Donation Button & Card Widget
   File: assets/css/donation-button-and-card.css
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.pdc-widget { position: relative; }

/* ── Trigger Button ──────────────────────────────────────── */
.pdc-trigger-wrap { display: flex; }

.pdc-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #5c3d2e;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 6px 20px rgba(92,61,46,0.35);
    line-height: 1;
}

.pdc-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(92,61,46,0.45);
}

.pdc-trigger-btn:focus-visible {
    outline: 3px solid rgba(92,61,46,0.5);
    outline-offset: 3px;
}

/* ── Popup Overlay ───────────────────────────────────────── */
.pdc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.pdc-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: all;
}

/* remove hidden display:none so we can animate */
.pdc-overlay[hidden] {
    display: flex !important; /* override UA hidden */
    visibility: hidden;
}

.pdc-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 5, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

/* ── Outer Card (glass shell) ────────────────────────────── */
.pdc-outer {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
    transform: scale(0.88) translateY(16px);
}

.pdc-overlay:not([hidden]) .pdc-outer {
    transform: scale(1) translateY(0);
}

/* Inline card: no scale animation, full width by default */
.pdc-inline-wrap .pdc-outer {
    max-width: 100%;
    transform: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: none;
}

/* ── Inner Card ──────────────────────────────────────────── */
.pdc-inner {
    background: #f0ece3;
    border-radius: 20px;
    padding: 28px 28px 24px;
    overflow: hidden;
}

/* ── Title & Subtitle ────────────────────────────────────── */
.pdc-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 6px;
    color: #2a1a10;
}

.pdc-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: #6b4f38;
    margin: 0 0 20px;
}

/* ── Image Area ──────────────────────────────────────────── */
.pdc-image-area {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.04);
}

.pdc-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(60px);
    transition: none;
    pointer-events: none;
}

.pdc-slide.pdc-slide-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Animated entrance/exit (added by JS) */
.pdc-slide.pdc-slide-enter {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.pdc-slide.pdc-slide-exit {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pdc-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder when no image set */
.pdc-slide-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8d5c0, #d4b896);
}

.pdc-coffee-emoji { font-size: 64px; }

/* ── Donation Option Buttons ─────────────────────────────── */
.pdc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.pdc-opt-btn {
    flex: 1 1 auto;
    min-width: calc(50% - 5px);
    padding: 12px 10px;
    background: rgba(255,255,255,0.55);
    border: 2px solid rgba(92,61,46,0.25);
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
    backdrop-filter: blur(4px);
}

.pdc-opt-btn:hover {
    background: rgba(255,255,255,0.85);
    border-color: #5c3d2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(92,61,46,0.18);
}

.pdc-opt-btn.pdc-selected {
    background: #5c3d2e;
    border-color: #5c3d2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92,61,46,0.4);
}

.pdc-opt-btn:focus-visible {
    outline: 3px solid rgba(92,61,46,0.5);
    outline-offset: 2px;
}

.pdc-opt-amount {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2a1a10;
    line-height: 1.1;
    transition: color 0.2s ease;
}

.pdc-opt-btn.pdc-selected .pdc-opt-amount { color: #fff; }

.pdc-opt-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b4f38;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
    transition: color 0.2s ease;
}

.pdc-opt-btn.pdc-selected .pdc-opt-label { color: rgba(255,255,255,0.75); }

/* ── Action Buttons Row ──────────────────────────────────── */
.pdc-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pdc-btn-donate,
.pdc-btn-decline {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.pdc-btn-donate {
    background: #5c3d2e;
    color: #fff;
    box-shadow: 0 4px 16px rgba(92,61,46,0.35);
}

.pdc-btn-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(92,61,46,0.45);
}

.pdc-btn-decline {
    background: #fdecea;
    color: #c0392b;
    border: 2px solid rgba(192,57,43,0.2);
}

.pdc-btn-decline:hover {
    background: rgba(192,57,43,0.12);
    border-color: #c0392b;
    transform: translateY(-1px);
}

.pdc-btn-donate:focus-visible,
.pdc-btn-decline:focus-visible {
    outline: 3px solid rgba(92,61,46,0.5);
    outline-offset: 2px;
}

/* ── Inline Collapsed State ──────────────────────────────── */
.pdc-inline-wrap.pdc-collapsed {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.45s ease, opacity 0.35s ease;
}

.pdc-inline-wrap {
    transition: max-height 0.45s ease, opacity 0.35s ease;
    max-height: 2000px;
    opacity: 1;
}

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

/* Tablet ≤768 px – 2-per-row options */
@media (max-width: 768px) {
    .pdc-opt-btn {
        min-width: calc(50% - 5px);
    }
}

/* Mobile ≤480 px */
@media (max-width: 480px) {
    .pdc-outer { padding: 8px; border-radius: 22px; }
    .pdc-inner { padding: 20px 16px 18px; border-radius: 16px; }
    .pdc-title { font-size: 18px; }

    /* Options: 2 per row on mobile */
    .pdc-options { gap: 8px; }
    .pdc-opt-btn { min-width: calc(50% - 4px); }

    /* Action buttons: horizontal on mobile */
    .pdc-actions {
        flex-direction: row;  /* keep horizontal */
        gap: 8px;
    }

    .pdc-btn-donate,
    .pdc-btn-decline {
        font-size: 13px;
        padding: 12px 10px;
    }

    .pdc-image-area { height: 140px; }
}