/* ===== Optimized eSIM Styles - Reduced !important usage ===== */

/* Use more specific selectors instead of !important where possible */

/* Layout improvements with specificity */
.esim-container .esim-destination-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Currency switcher improvements */
.woocommerce-multi-currency .esim-loading {
    opacity: 0.99;
    pointer-events: none;
}

.esim-currency-switcher .esim-loading {
    opacity: 0.99;
    pointer-events: none;
}

/* Country search improvements */
.esim-country-search-sleek .search-icon,
.esim-country-search .search-icon {
    display: none;
}

/* Product variation styles with better specificity */
.single-product .variations_form .variation-option.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.single-product .variations_form .variation-radio:checked + .variation-content {
    border-color: #3b82f6;
}

/* Destination grid improvements */
.esim-destinations-grid .esim-destination-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Modal styles with better specificity */
.esim-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.esim-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* Queue admin styles */
.wp-admin .esim-queue-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.wp-admin .esim-queue-status.processing {
    color: #d69e2e;
}

.wp-admin .esim-queue-status.completed {
    color: #38a169;
}

.wp-admin .esim-queue-status.failed {
    color: #e53e3e;
}

/* Currency selector positioning - only when inside eSIM shortcode context */
.esim-header-selectors .esim-currency-selector {
    margin-left: auto;
}

/* Button styles with better specificity */
.esim-btn.esim-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.esim-btn.esim-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.esim-btn.esim-btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.esim-btn.esim-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Form improvements */
.woocommerce form.cart .variations select {
    max-width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.woocommerce form.cart .variations select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .esim-container .esim-destination-single {
        padding: 0 0.75rem;
    }
    
    .esim-plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .esim-destination-page-header .esim-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Accessibility improvements */
.esim-skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.esim-skip-link:focus {
    top: 6px;
}

/* Focus styles */
.esim-btn:focus,
.esim-view-btn:focus,
.esim-sort-select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
.esim-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.esim-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Print styles */
@media print {
    .esim-destination-details {
        background: none;
        box-shadow: none;
    }
    
    .esim-btn,
    .esim-view-controls,
    .esim-sort-dropdown {
        display: none;
    }
}