/**
 * eSIM Product Selector V2 Styles
 */

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */

.esim-v2-product-selector {
    max-width: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

/* ============================================================================
   HEADER SECTION
   ============================================================================ */

.esim-v2-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* Calculator Section */
.esim-v2-calculator-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.esim-v2-calculator-text {
    font-size: 14px;
    color: #6b7280;
    flex: 1;
}

.esim-v2-calculator-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esim-v2-calculator-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.esim-v2-calculator-btn svg {
    width: 16px;
    height: 16px;
}

/* Product Info */
.esim-v2-product-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.esim-v2-product-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.esim-v2-product-price {
    font-size: 24px;
    font-weight: 700;
    color: #3B82F6;
}

/* Details Button */
.esim-v2-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esim-v2-details-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.esim-v2-details-btn:not(:disabled):hover {
    background: #e5e7eb;
}

.esim-v2-details-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   ACTIONS SECTION
   ============================================================================ */

.esim-v2-actions-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Quantity Controls */
.esim-v2-quantity-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.esim-v2-quantity-wrapper label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.esim-v2-quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.esim-v2-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f9fafb;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esim-v2-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.esim-v2-qty-btn:not(:disabled):hover {
    background: #f3f4f6;
}

#esim-v2-quantity {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    background: white;
}

/* Action Buttons */
.esim-v2-action-buttons {
    display: flex;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.esim-v2-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    justify-content: center;
}

.esim-v2-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.esim-v2-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Primary Button */
.esim-v2-primary {
    background: #3B82F6;
    color: white;
}

.esim-v2-primary:not(:disabled):hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Secondary Button */
.esim-v2-secondary {
    background: #EA580C;
    color: white;
}

.esim-v2-secondary:not(:disabled):hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ============================================================================
   DAYS SELECTION
   ============================================================================ */

.esim-v2-days-section {
    margin-bottom: 24px;
}

.esim-v2-days-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.esim-v2-days-section label svg {
    width: 20px;
    height: 20px;
    color: #3B82F6;
}

.esim-v2-select-wrapper {
    position: relative;
}

.esim-v2-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    color: #111827;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.esim-v2-select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.esim-v2-select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
}

/* ============================================================================
   PRODUCTS CONTAINER
   ============================================================================ */

.esim-v2-products-container {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #f9fafb;
    margin-bottom: 24px;
}

.esim-v2-product-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.esim-v2-product-card:last-child {
    margin-bottom: 0;
}

.esim-v2-product-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.esim-v2-product-card.selected {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.02);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Product Card Header */
.esim-v2-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.esim-v2-card-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}

.esim-v2-card-radio.checked {
    border-color: #3B82F6;
    background: #3B82F6;
}

.esim-v2-card-radio.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.esim-v2-package-badge {
    padding: 4px 12px;
    background: #3B82F6;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.esim-v2-discount-badge {
    padding: 4px 8px;
    background: #059669;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Product Card Body */
.esim-v2-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.esim-v2-card-info {
    flex: 1;
}

.esim-v2-card-data {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.esim-v2-card-duration {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.esim-v2-card-features {
    display: flex;
    gap: 8px;
    align-items: center;
}

.esim-v2-feature-icon {
    width: 20px;
    height: 20px;
    padding: 2px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* Product Card Pricing */
.esim-v2-card-pricing {
    text-align: right;
}

.esim-v2-card-original-price {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.esim-v2-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.esim-v2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: #6b7280;
}

.esim-v2-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: esim-v2-spin 1s linear infinite;
}

@keyframes esim-v2-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   MOBILE STICKY BAR
   ============================================================================ */

.esim-v2-mobile-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.esim-v2-sticky-content {
    max-width: 600px;
    margin: 0 auto;
}

.esim-v2-sticky-info {
    margin-bottom: 12px;
}

.esim-v2-sticky-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.esim-v2-sticky-price {
    font-size: 18px;
    font-weight: 700;
    color: #3B82F6;
}

.esim-v2-sticky-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.esim-v2-sticky-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.esim-v2-sticky-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.esim-v2-sticky-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.esim-v2-sticky-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.esim-v2-sticky-qty-btn:not(:disabled):hover {
    background: #f3f4f6;
}

.esim-v2-sticky-qty-display {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    min-width: 20px;
    text-align: center;
}

.esim-v2-sticky-buttons {
    display: flex;
    gap: 8px;
}

.esim-v2-sticky-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.esim-v2-sticky-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .esim-v2-product-selector {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 80px; /* Space for sticky bar */
    }
    
    .esim-v2-calculator-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .esim-v2-calculator-text {
        font-size: 13px;
    }
    
    .esim-v2-calculator-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .esim-v2-product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .esim-v2-product-title {
        font-size: 16px;
    }
    
    .esim-v2-product-price {
        font-size: 20px;
    }
    
    .esim-v2-actions-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .esim-v2-action-buttons {
        justify-content: stretch;
    }
    
    .esim-v2-action-btn {
        flex: 1;
        min-width: auto;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .esim-v2-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .esim-v2-card-pricing {
        text-align: left;
        width: 100%;
    }
    
    /* Show mobile sticky bar */
    .esim-v2-mobile-sticky.show {
        display: block !important;
    }
    
    /* Hide desktop action buttons on mobile when sticky is active */
    .esim-v2-mobile-sticky.show ~ .esim-v2-product-selector .esim-v2-actions-section {
        display: none;
    }
}

@media (max-width: 480px) {
    .esim-v2-product-selector {
        padding: 12px;
    }
    
    .esim-v2-card-header {
        margin-bottom: 8px;
    }
    
    .esim-v2-sticky-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .esim-v2-sticky-quantity {
        justify-content: center;
    }
    
    .esim-v2-sticky-buttons {
        justify-content: stretch;
    }
    
    .esim-v2-sticky-btn {
        flex: 1;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
}

.modal-coupon-restriction {
    font-size: 11px;
    color: #ef4444;
    line-height: 1.5;
    margin-top: 4px;
}

.modal-coupons-loading,
.modal-no-coupons {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .esim-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .esim-modal-body {
        padding: 16px;
    }
    
    #modal-product-details {
        flex-direction: column;
        gap: 16px;
    }
    
    .modal-left-content {
        padding-right: 0;
    }
    
    .modal-right-sidebar {
        width: 100%;
        position: relative;
        order: -1;
    }
    
    .modal-product-title {
        font-size: 20px;
    }
    
    .modal-price-amount {
        font-size: 24px;
    }
    
    .modal-action-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .modal-action-button {
        flex: 1;
        padding: 10px 16px;
        font-size: 13px;
    }
}

.esim-v2-select:focus,
.esim-v2-qty-btn:focus,
.esim-v2-action-btn:focus,
.esim-v2-calculator-btn:focus,
.esim-v2-details-btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.esim-v2-product-card:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Screen reader only */
.esim-v2-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}