/* ============================================
   Buy Now Modal — Apple-Inspired
   ============================================ */

/* Overlay */
.buy-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 24px;
}

.buy-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Card */
.buy-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 48px 36px 36px;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 80px rgba(0,0,0,0.18);
}

.buy-modal-overlay.active .buy-modal {
    transform: scale(1) translateY(0);
}

/* Close */
.buy-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f7;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #86868b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.buy-modal-close:hover {
    background: #e8e8ed;
    color: #1d1d1f;
}

/* Product badge */
.buy-modal-product {
    text-align: center;
    margin-bottom: 28px;
}

.buy-modal-product-name {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.buy-modal-product-sub {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 400;
}

/* Form */
.buy-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.buy-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.buy-modal-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6e6e73;
    letter-spacing: 0.02em;
}

.buy-modal-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d2d2d7;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    color: #1d1d1f;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.buy-modal-field input:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.buy-modal-field input::placeholder {
    color: #aeaeb2;
}

/* Submit */
.buy-modal-submit {
    margin-top: 8px;
    padding: 14px 24px;
    background: #0071e3;
    color: #fff;
    border: none;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0;
}

.buy-modal-submit:hover {
    background: #0077ed;
}

.buy-modal-submit:active {
    transform: scale(0.97);
}

.buy-modal-submit:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
}

/* Success state */
.buy-modal-success {
    text-align: center;
    padding: 20px 0;
    display: none;
}

.buy-modal-success.show {
    display: block;
}

.buy-modal-success .success-icon {
    width: 56px;
    height: 56px;
    background: #34c759;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.6rem;
    color: #fff;
}

.buy-modal-success h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.buy-modal-success p {
    font-size: 0.95rem;
    color: #86868b;
    line-height: 1.5;
}

/* Error */
.buy-modal-error {
    font-size: 0.8rem;
    color: #ff3b30;
    text-align: center;
    min-height: 18px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .buy-modal {
        padding: 36px 24px 28px;
        border-radius: 16px;
    }

    .buy-modal-product-name {
        font-size: 1.2rem;
    }
}
