/* =========================================================
   WC Free PDF Download — Styles
   ========================================================= */

/* ── Free badge (price override) ───────────────────────── */
.wcfpdf-free-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 18px;
    border-radius: 100px;
    line-height: 1.6;
}

/* ── Hide quantity + add-to-cart on free products ───────── */
body.wcfpdf-free-product .quantity,
body.wcfpdf-free-product .single_add_to_cart_button,
body.wcfpdf-free-product form.cart {
    display: none !important;
}

/* ── Download button ─────────────────────────────────────── */
.wcfpdf-download-wrap {
    margin-top: 20px;
}

.wcfpdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff !important;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.wcfpdf-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.5);
}

.wcfpdf-download-btn:active {
    transform: translateY(0);
}

.wcfpdf-btn-icon svg {
    width: 20px;
    height: 20px;
}

.wcfpdf-redownload-note {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

.wcfpdf-redownload-note a {
    color: #0284c7;
    text-decoration: underline;
}

/* ── Overlay ─────────────────────────────────────────────── */
.wcfpdf-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 28, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: wcfpdf-fade 0.25s ease forwards;
}

@keyframes wcfpdf-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.wcfpdf-popup-open {
    overflow: hidden;
}

/* ── Popup card ──────────────────────────────────────────── */
.wcfpdf-popup {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 36px 36px;
    max-width: 500px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.1);
    animation: wcfpdf-popup-in 0.3s cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}

@keyframes wcfpdf-popup-in {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Close button ─────────────────────────────────────────── */
.wcfpdf-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0;
}

.wcfpdf-close:hover {
    background: #e5e7eb;
}

.wcfpdf-close svg {
    width: 16px;
    height: 16px;
    stroke: #374151;
}

/* ── Popup header ─────────────────────────────────────────── */
.wcfpdf-popup-header {
    text-align: center;
    margin-bottom: 28px;
}

.wcfpdf-pdf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    margin: 0 auto 16px;
}

.wcfpdf-pdf-icon svg {
    width: 32px;
    height: 32px;
    stroke: #0284c7;
}

.wcfpdf-popup-header h2,
.wcfpdf-popup #wcfpdf-popup-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 8px !important;
    line-height: 1.3 !important;
}

.wcfpdf-popup .wcfpdf-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 !important;
}

/* ── Form fields ─────────────────────────────────────────── */
.wcfpdf-row {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.wcfpdf-col-2 > .wcfpdf-field {
    flex: 1;
    min-width: 0;
}

.wcfpdf-row:not(.wcfpdf-col-2) .wcfpdf-field {
    flex: 1;
}

.wcfpdf-field {
    display: flex;
    flex-direction: column;
}

.wcfpdf-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.wcfpdf-req {
    color: #ef4444;
}

.wcfpdf-field input {
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    font-size: 14px;
    color: #111827;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.wcfpdf-field input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.wcfpdf-field input.wcfpdf-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── Error message ───────────────────────────────────────── */
.wcfpdf-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

/* ── Submit button ───────────────────────────────────────── */
.wcfpdf-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 11px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}

.wcfpdf-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.wcfpdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wcfpdf-submit-icon svg,
.wcfpdf-spinner svg {
    width: 18px;
    height: 18px;
}

@keyframes wcfpdf-spin {
    to { transform: rotate(360deg); }
}

.wcfpdf-spin {
    animation: wcfpdf-spin 0.8s linear infinite;
}

/* ── My Account re-download section ─────────────────────── */
.wcfpdf-redownload-section {
    margin-top: 30px;
    padding: 24px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
}

.wcfpdf-redownload-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0369a1;
    margin: 0 0 8px;
}

.wcfpdf-redownload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0284c7 !important;
    color: #ffffff !important;
    padding: 11px 22px;
    border-radius: 9px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.15s;
}

.wcfpdf-redownload-btn:hover {
    background: #0369a1 !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .wcfpdf-popup {
        padding: 32px 20px 24px;
    }

    .wcfpdf-row.wcfpdf-col-2 {
        flex-direction: column;
        gap: 0;
    }
}
