/**
 * Product Available - Frontend Styles
 * Professional styling for unavailable products and enhanced UI
 */

/* Hide add to cart button when product is unavailable */
.pa-unavailable-product-wrapper ~ .cart .single_add_to_cart_button,
.pa-unavailable-product-wrapper ~ .cart .add_to_cart_button,
.pa-unavailable-product-wrapper ~ form.cart .single_add_to_cart_button,
.pa-unavailable-product-wrapper ~ form.cart .add_to_cart_button {
    display: none !important;
}

/* Ensure our unavailable button is visible */
.pa-unavailable-product-wrapper {
    display: block !important;
}

/* Unavailable Product Wrapper */
.pa-unavailable-product-wrapper {
    margin: 20px 0;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Unavailable Button */
.pa-unavailable-btn {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #657786;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    justify-content: center;
}

.pa-unavailable-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pa-unavailable-btn:active {
    transform: translateY(0);
}

/* Clock Icon */
.pa-icon-clock {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iOCIgc3Ryb2tlPSIjNjU3Nzg2IiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTEwIDZ2NGwzIDMiIHN0cm9rZT0iIzY1Nzc4NiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+') no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.pa-unavailable-text {
    flex: 1;
    text-align: center;
}

/* Countdown Timer */
.pa-countdown-timer {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 25px 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

.pa-countdown-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pa-time-unit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: bold;
    color: #fff;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.pa-time-unit:hover {
    transform: scale(1.05);
}

.pa-time-unit span {
    display: block;
    font-size: 18px;
    line-height: 1;
}

.pa-countdown-text {
    color: #657786;
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

/* Waitlist Section */
.pa-waitlist-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.pa-waitlist-section h4 {
    color: #495057;
    font-size: 16px;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.pa-waitlist-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    min-width: 140px;
}

.pa-waitlist-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.pa-waitlist-btn:active {
    transform: translateY(0);
}

.pa-waitlist-btn.pa-on-waitlist {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.pa-waitlist-btn.pa-on-waitlist:hover {
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.pa-waitlist-login {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.pa-waitlist-login a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.pa-waitlist-login a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pa-countdown-timer.pa-urgent {
    animation: pulse 2s infinite;
    border-color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pa-unavailable-product-wrapper {
        margin: 15px 0;
        padding: 20px 15px;
    }
    
    .pa-unavailable-btn {
        min-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .pa-countdown-display {
        gap: 10px;
    }
    
    .pa-time-unit {
        min-width: 50px;
        padding: 10px 12px;
    }
    
    .pa-time-unit span {
        font-size: 16px;
    }
    
    .pa-waitlist-btn {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .pa-countdown-display {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .pa-time-unit {
        width: 100%;
        max-width: 120px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pa-unavailable-product-wrapper {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pa-unavailable-btn {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pa-countdown-timer {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pa-waitlist-section {
        border-color: #4a5568;
    }
    
    .pa-waitlist-section h4 {
        color: #e2e8f0;
    }
    
    .pa-countdown-text {
        color: #a0aec0;
    }
    
    .pa-waitlist-login {
        color: #a0aec0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .pa-unavailable-btn {
        border-width: 3px;
        border-color: #000;
    }
    
    .pa-countdown-timer {
        border-width: 2px;
        border-color: #000;
    }
    
    .pa-time-unit {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pa-unavailable-btn,
    .pa-waitlist-btn,
    .pa-time-unit {
        transition: none;
    }
    
    .pa-countdown-timer {
        animation: none;
    }
    
    .pa-countdown-timer.pa-urgent {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .pa-unavailable-product-wrapper {
        background: #fff !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
    
    .pa-unavailable-btn {
        background: #f0f0f0 !important;
        border: 2px solid #000 !important;
        color: #000 !important;
    }
    
    .pa-countdown-timer {
        background: #fff !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .pa-waitlist-section {
        display: none;
    }
}
