/* ====================
   BUY NOW BUTTONS - ALL PAGES
   ==================== */

/* 1. Single Product Page Buy Now Button */
.buy-now-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    border: none !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3) !important;
    margin-left: 10px !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.buy-now-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.4) !important;
    color: white !important;
}

/* 2. Shop/Archive Pages Buy Now Button */
.buy-now-button-shop {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3) !important;
    margin-top: 8px !important;
    position: relative !important;
    overflow: hidden !important;
}

.buy-now-button-shop:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4) !important;
    color: white !important;
}

/* Shop page button with flash icon */
.buy-now-button-shop:before {
    content: "⚡ ";
    margin-right: 5px;
    animation: flash 2s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 3. Special product states on shop pages */
/* Featured products */
.products .product.featured .buy-now-button-shop {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%) !important;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3) !important;
}

.products .product.featured .buy-now-button-shop:hover {
    background: linear-gradient(135deg, #ff5722 0%, #ff9800 100%) !important;
    box-shadow: 0 6px 15px rgba(255, 152, 0, 0.4) !important;
}

/* Sale products */
.products .product.on-sale .buy-now-button-shop {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3) !important;
}

.products .product.on-sale .buy-now-button-shop:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4) !important;
}

/* Out of stock products */
.products .product.outofstock .buy-now-button-shop {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* ====================
   DIRECT DOWNLOAD CONTAINER
   ==================== */

.direct-download-container {
    background: #f8f8f8;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    margin: 25px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.direct-download-container h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.direct-download-container p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

/* Shine animation for download container */
.direct-download-container:before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(76, 175, 80, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Thank you page specific styling */
.woocommerce-thankyou-order-details + .direct-download-container {
    background: #e8f5e8;
    border-left-color: #4CAF50;
}

/* Order details page styling */
.woocommerce-order-details ~ .direct-download-container {
    margin-top: 30px;
}

/* My Account page styling */
.woocommerce-MyAccount-content .direct-download-container {
    margin-top: 20px;
}

/* ====================
   PDF ACTION BUTTONS
   ==================== */

/* PDF action buttons container */
.pdf-action-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* View PDF button (opens in browser) */
.view-pdf-button {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3) !important;
}

.view-pdf-button:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4) !important;
    color: white !important;
}

/* Download PDF button */
.direct-download-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
}

.direct-download-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4) !important;
    color: white !important;
}

/* Pulsing animation for download button */
.direct-download-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* PDF instructions */
.pdf-instructions {
    margin-top: 15px !important;
    font-style: italic;
    color: #666;
    text-align: center;
}

.pdf-instructions small {
    display: inline-block;
    animation: pulseText 2s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ====================
   AUTO-PDF PROCESSING STYLES
   ==================== */

/* Auto-process indicator */
#pdf-auto-process {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 20px 0;
    animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* PDF spinner */
.pdf-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

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

/* Thank you page enhancements */
.woocommerce-order-received .entry-content {
    animation: fadeIn 0.8s ease-out;
}

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

/* ====================
   SHOP PAGE PRODUCT CARDS
   ==================== */

/* Product card hover effects */
.products .product {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.products .product:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Buy Now button visibility on hover */
.products .product .buy-now-button-shop {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.products .product:hover .buy-now-button-shop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Product image overlay for Buy Now */
.products .product .woocommerce-loop-product__link {
    position: relative;
    display: block;
    overflow: hidden;
}

.products .product .woocommerce-loop-product__link:after {
    content: "BUY NOW";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.products .product:hover .woocommerce-loop-product__link:after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Price styling */
.products .product .price {
    display: block;
    margin-bottom: 10px;
    font-size: 18px !important;
    font-weight: bold;
    color: #ff6b6b;
}

/* Button container on product cards */
.products .product .button-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

/* Standard Add to Cart button on shop pages */
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .button.product_type_simple {
    display: none;
    width: 100% !important;
    margin-bottom: 0 !important;
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 2px solid #e9ecef !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.woocommerce ul.products li.product .add_to_cart_button:hover,
.woocommerce ul.products li.product .button.product_type_simple:hover {
    background: #e9ecef !important;
    border-color: #dee2e6 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ====================
   ANIMATIONS & EFFECTS
   ==================== */

/* Pulse animation for featured products */
@keyframes featuredPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.products .product.featured .buy-now-button-shop {
    animation: featuredPulse 2s infinite;
}

/* Slide-in animation for shop buttons */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.products .product .buy-now-button-shop {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.products .product:nth-child(1) .buy-now-button-shop { animation-delay: 0.1s; }
.products .product:nth-child(2) .buy-now-button-shop { animation-delay: 0.2s; }
.products .product:nth-child(3) .buy-now-button-shop { animation-delay: 0.3s; }
.products .product:nth-child(4) .buy-now-button-shop { animation-delay: 0.4s; }
.products .product:nth-child(5) .buy-now-button-shop { animation-delay: 0.5s; }
.products .product:nth-child(6) .buy-now-button-shop { animation-delay: 0.6s; }

/* ====================
   RESPONSIVE STYLES
   ==================== */
   


@media (max-width: 768px) {
    /* Single product page */
    .single_add_to_cart_button.buy-now-button {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    /* Direct download container */
    .direct-download-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    /* PDF action buttons */
    .pdf-action-buttons {
        flex-direction: column;
    }
    
    .view-pdf-button,
    .direct-download-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    /* Shop page buttons */
    .buy-now-button-shop {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }
    
    .woocommerce ul.products li.product .buy-now-button-shop {
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 8px !important;
    }
    
    /* Hide image overlay text on mobile */
    .products .product .woocommerce-loop-product__link:after {
        display: none;
    }
    
    /* Shop page Add to Cart button */
    .woocommerce ul.products li.product .add_to_cart_button,
    .woocommerce ul.products li.product .button.product_type_simple {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* ====================
   WOOCOMMERCE OVERRIDES
   ==================== */

/* Ensure our buttons don't get overridden by theme */
.single-product div.product form.cart .button.buy-now-button,
.woocommerce .button.direct-download-button,
.woocommerce .button.view-pdf-button,
.woocommerce .button.buy-now-button-shop {
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
}

/* List view adjustments for shop pages */
.woocommerce ul.products li.product .buy-now-button-shop {
    display: inline-block !important;
    width: auto !important;
    margin-left: 10px !important;
}

@media (max-width: 768px) {
    .woocommerce ul.products li.product .buy-now-button-shop {
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Quick view modal adjustments */
.quick-view-content .buy-now-button {
    margin-top: 15px !important;
    width: 100% !important;
    text-align: center !important;
}

/* ====================
   PRINT STYLES
   ==================== */

@media print {
    .direct-download-container,
    .buy-now-button,
    .buy-now-button-shop {
        display: none !important;
    }
}