/**
 * Ovattificio Fortunato - Custom PDF Download Button
 * Classe personalizzata: ovf-pdf-download-btn
 * NO classi WooCommerce/Divi - stile completamente custom
 *
 * @version 4.4.3
 */

/* ============================================
   BOTTONE PRINCIPALE - Classe Custom
   ============================================ */
.ovf-pdf-download-btn {
    /* Reset completo - rimuove tutti gli stili dei temi */
    all: unset;

    /* Layout */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

    /* Spacing */
    padding: 18px 36px !important;
    margin: 20px 0 !important;

    /* Typography */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;

    /* Colors */
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    background-color: #2c3e50 !important;
    color: #ffffff !important;

    /* Border */
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    outline: none !important;

    /* Shadow */
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2),
                0 2px 4px rgba(0, 0, 0, 0.1) !important;

    /* Cursor */
    cursor: pointer !important;

    /* Transition */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;

    /* Position */
    position: relative !important;
    overflow: hidden !important;
    vertical-align: middle !important;
}

/* Hover State */
.ovf-pdf-download-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
    background-color: #34495e !important;
    color: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.3),
                0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Active State */
.ovf-pdf-download-btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25) !important;
}

/* Focus State - Accessibility */
.ovf-pdf-download-btn:focus {
    outline: 3px solid #3498db !important;
    outline-offset: 2px !important;
}

/* Disabled State */
.ovf-pdf-download-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ============================================
   ICONA SVG
   ============================================ */
.ovf-pdf-download-btn svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ovf-pdf-download-btn:hover svg {
    transform: translateY(3px) !important;
    animation: bounce-icon 0.6s ease-in-out !important;
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(3px); }
    50% { transform: translateY(-2px); }
}

/* ============================================
   WRAPPER
   ============================================ */
.wc-pdf-datasheet-wrapper {
    width: 100% !important;
    margin: 20px 0 !important;
    clear: both !important;
}

/* ============================================
   LOADING STATE
   ============================================ */
.wc-pdf-datasheet-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 18px !important;
    background: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    margin: 20px 0 !important;
}

.wc-pdf-datasheet-loading .spinner {
    width: 20px !important;
    height: 20px !important;
    border: 3px solid #dee2e6 !important;
    border-top-color: #2c3e50 !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.wc-pdf-datasheet-loading .loading-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .ovf-pdf-download-btn {
        padding: 16px 28px !important;
        font-size: 15px !important;
        gap: 10px !important;
    }

    .ovf-pdf-download-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    .ovf-pdf-download-btn {
        padding: 14px 24px !important;
        font-size: 14px !important;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .ovf-pdf-download-btn {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
    }

    .ovf-pdf-download-btn:hover {
        background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%) !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .ovf-pdf-download-btn,
    .ovf-pdf-download-btn svg,
    .wc-pdf-datasheet-loading .spinner {
        animation: none !important;
        transition: none !important;
    }

    .ovf-pdf-download-btn:hover {
        transform: none !important;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .ovf-pdf-download-btn,
    .wc-pdf-datasheet-wrapper {
        display: none !important;
    }
}
