/* Crave in-app payment (card form + one-click) */
.crave-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.crave-pay-overlay.is-open {
    display: flex;
    animation: cravePayFadeIn 0.28s ease;
}

@keyframes cravePayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.crave-pay-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(92dvh, 720px);
    overflow-y: auto;
    padding: 26px 22px 22px;
    border-radius: 22px;
    background: rgba(27, 27, 27, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow:
        0 16px 56px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    animation: cravePaySlide 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cravePaySlide {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.crave-pay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(240, 240, 240, 0.85);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.crave-pay-close:hover {
    background: rgba(160, 20, 20, 0.35);
    color: #fff;
}

.crave-pay-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f2f0f0;
    font-family: 'Libre Baskerville', Georgia, serif;
}

.crave-pay-price {
    margin: 0 0 16px;
    font-size: 1.65rem;
    font-weight: 700;
    color: #d48484;
}

.crave-pay-subtitle {
    margin: -8px 0 16px;
    font-size: 0.88rem;
    color: rgba(200, 198, 198, 0.72);
    line-height: 1.45;
}

.crave-pay-field {
    margin-bottom: 12px;
}

.crave-pay-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(190, 188, 188, 0.75);
}

.crave-pay-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #f0eeee;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.crave-pay-input:focus {
    border-color: rgba(180, 40, 40, 0.55);
    box-shadow: 0 0 0 3px rgba(140, 20, 20, 0.22);
}

.crave-pay-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.crave-pay-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 10px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(220, 218, 218, 0.88);
}

.crave-pay-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.crave-pay-check-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.crave-pay-check input:checked + .crave-pay-check-box {
    background: rgba(140, 20, 20, 0.55);
    border-color: rgba(220, 60, 60, 0.65);
}

.crave-pay-check input:checked + .crave-pay-check-box::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

.crave-pay-check a {
    color: #d48484;
}

.crave-pay-legal {
    margin: 0 0 16px;
    font-size: 0.76rem;
    line-height: 1.5;
    color: rgba(180, 178, 178, 0.6);
}

.crave-pay-submit {
    width: 100%;
    padding: 15px 18px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, #a30d0d 0%, #6f0808 100%);
    color: #f5f3f3;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
}

.crave-pay-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(160, 20, 20, 0.45);
}

.crave-pay-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.crave-pay-error {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: #ff6b6b;
    text-align: center;
    display: none;
}

.crave-pay-error.is-visible {
    display: block;
}

.crave-pay-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cravePaySpin 0.7s linear infinite;
}

@keyframes cravePaySpin {
    to { transform: rotate(360deg); }
}

.crave-pay-success-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(60, 160, 90, 0.25);
    border: 2px solid rgba(100, 220, 140, 0.85);
    position: relative;
}

.crave-pay-success-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 3px;
    width: 8px;
    height: 12px;
    border: solid rgba(180, 255, 210, 0.95);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.crave-pay-oneclick-desc {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(210, 208, 208, 0.85);
}

.crave-pay-card-hint {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    color: rgba(200, 198, 198, 0.8);
}

.shop-legal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin-top: 8px;
    padding: 0 0 28px;
    font-size: 0.78rem;
}

.shop-legal-footer a {
    color: rgba(169, 169, 169, 0.72);
    text-decoration: none;
}

.shop-legal-footer a:hover {
    color: rgba(201, 167, 106, 0.92);
}
