/**
 * eSIM Consolidated Styles
 * Combined CSS for better performance - includes destinations, cards, and common elements
 * Generated to reduce HTTP requests while maintaining functionality
 */

/* ========================================
   DESTINATIONS OVERVIEW PAGE STYLING
   ======================================== */

/* Main overview container */
.esim-destinations-page {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 70vh;
    position: relative;
}

.esim-destinations-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
    pointer-events: none;
}

/* Legacy container support */
.esim-destinations-overview {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 70vh;
}

.esim-destinations-container,
.esim-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Enhanced header section */
.esim-destinations-header {
    text-align: center;
    margin-bottom: 56px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.esim-destinations-header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.esim-destinations-header p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 40px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Enhanced controls section */
.esim-controls,
.esim-search-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.esim-search-wrapper,
.esim-search-box {
    position: relative;
    flex: 1;
    max-width: 450px;
}

.esim-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.2s ease;
}

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

.esim-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

/* ========================================
   CARD CUSTOMIZATIONS & BADGES
   ======================================== */

/* Sale Badge - Contained within card */
.esim-sale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(255, 59, 48, 0.3);
    z-index: 2;
}

/* Label Badge - Compact */
.esim-label-badge {
    display: inline-block;
    background: #0066cc;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 16px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Service Highlight */
.esim-service-highlight {
    color: #0066cc;
    font-weight: 600;
}

/* Provider Info - Compact */
.esim-provider-info {
    margin: 8px 0;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
}

.esim-provider-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

/* ========================================
   DESTINATION DETAILS STYLING
   ======================================== */

.esim-details-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ct-text-color, #475569);
}

.esim-details-text p {
    margin-bottom: 16px;
}

.esim-details-text p:last-child {
    margin-bottom: 0;
}

.esim-details-text h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ct-headings-color, #1e293b);
    margin: 24px 0 12px 0;
}

.esim-details-text h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ct-headings-color, #334155);
    margin: 20px 0 10px 0;
}

.esim-details-text ul,
.esim-details-text ol {
    margin: 16px 0;
    padding-left: 24px;
}

.esim-details-text li {
    margin-bottom: 8px;
}

.esim-details-text strong {
    font-weight: 600;
    color: var(--ct-text-color, #1e293b);
}

/* ========================================
   MODAL STYLES
   ======================================== */

.esim-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esim-modal[aria-hidden="false"],
.esim-modal.esim-modal-active,
.esim-modal.show {
    opacity: 1;
    visibility: visible;
}

.esim-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.esim-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.esim-modal[aria-hidden="false"] .esim-modal-content,
.esim-modal.esim-modal-active .esim-modal-content,
.esim-modal.show .esim-modal-content {
    transform: scale(1);
}

.esim-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.esim-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.esim-modal-body {
    padding: 24px;
    background: #fff;
    color: #1f2937;
    border-radius: 0 0 12px 12px;
}

.esim-modal-close {
    background: #f3f4f6;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.esim-modal-close:hover {
    color: #1e293b;
    background: #e5e7eb;
}

/* Modal open body styles */
body.modal-open {
    overflow: hidden;
}

/* Enhanced Coverage Modal Styles */
.coverage-details {
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

/* Enhanced Info Modal Styles */
.esim-info-details {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

.esim-info-details .product-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.esim-info-details .product-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    text-align: center;
}

.esim-info-details .product-description {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.esim-info-details .product-description h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.esim-info-details .description-content {
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

.esim-info-details .description-content p {
    margin-bottom: 12px;
}

.esim-info-details .description-content p:last-child {
    margin-bottom: 0;
}

.esim-info-details .description-content ul,
.esim-info-details .description-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.esim-info-details .description-content li {
    margin-bottom: 6px;
}

.esim-info-details .description-content strong {
    font-weight: 600;
    color: #1f2937;
}

.esim-info-details .esim-info-section {
    margin-bottom: 20px;
}

.esim-info-details .info-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 6px;
}

/* Buy Now Modal HTML Content Support */
.fallback-modal .description-content p {
    margin-bottom: 12px !important;
}

.fallback-modal .description-content p:last-child {
    margin-bottom: 0 !important;
}

.fallback-modal .description-content ul,
.fallback-modal .description-content ol {
    margin: 12px 0 !important;
    padding-left: 20px !important;
}

.fallback-modal .description-content li {
    margin-bottom: 6px !important;
}

.fallback-modal .description-content strong {
    font-weight: 600 !important;
    color: #1f2937 !important;
}

.fallback-modal .description-content em {
    font-style: italic !important;
}

.fallback-modal .description-content h1,
.fallback-modal .description-content h2,
.fallback-modal .description-content h3,
.fallback-modal .description-content h4,
.fallback-modal .description-content h5,
.fallback-modal .description-content h6 {
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 16px 0 8px 0 !important;
    line-height: 1.3 !important;
}

.fallback-modal .description-content h1 { font-size: 18px !important; }
.fallback-modal .description-content h2 { font-size: 16px !important; }
.fallback-modal .description-content h3 { font-size: 15px !important; }
.fallback-modal .description-content h4 { font-size: 14px !important; }
.fallback-modal .description-content h5 { font-size: 13px !important; }
.fallback-modal .description-content h6 { font-size: 12px !important; }

.fallback-modal .description-content a {
    color: #3b82f6 !important;
    text-decoration: underline !important;
}

.fallback-modal .description-content a:hover {
    color: #1e40af !important;
}

.coverage-details h3 {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    margin: 0;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.coverage-details h4 {
    background: #ffffff;
    border-bottom: 2px solid #e5e7eb;
    margin: 0;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-coverage {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.country-coverage:last-child {
    border-bottom: none;
}

.country-flag {
    width: 24px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.network-coverage {
    padding: 0 20px 20px 20px;
}

.network-coverage strong {
    color: #374151;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.network-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.network-list li {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.network-list li:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.network-list li strong {
    color: #1e293b;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.network-type {
    background: #3b82f6;
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Destination list styling for fallback */
.destination-list {
    padding: 20px;
    background: white;
}

.destination-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.destination-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.destination-item:last-child {
    margin-bottom: 0;
}

.destination-item .country-flag {
    width: 20px;
    height: auto;
}

.destination-item span {
    font-weight: 500;
    color: #374151;
}

/* Coverage modal specific improvements */
#coverage-modal .esim-modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

#coverage-modal .esim-modal-content {
    max-width: 600px;
    width: 95%;
}

/* Responsive coverage modal */
@media (max-width: 640px) {
    .network-list {
        grid-template-columns: 1fr;
    }
    
    .network-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .coverage-details h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        text-align: left;
    }
}

/* Button styles for modals and cards */
.esim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
    line-height: 1.4;
    min-height: 44px;
}

/* Product card specific button styles */
.esim-btn-coverage,
.esim-btn-info {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 13px;
}

.esim-btn-select,
.esim-btn-buy {
    padding: 10px 16px;
    min-height: 40px;
    font-weight: 600;
}

.esim-btn-buy {
    background: #0066cc;
    color: #fff;
}

.esim-btn-buy:hover {
    background: #0052a3;
    color: #fff;
}

.esim-btn-select {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.esim-btn-select:hover {
    background: #e2e6ea;
    color: #495057;
}

.esim-btn-coverage {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.esim-btn-coverage:hover {
    background: #e2e6ea;
    color: #495057;
}

.esim-btn-info {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.esim-btn-info:hover {
    background: #e2e6ea;
    color: #495057;
}

.esim-btn-primary {
    background: #0066cc;
    color: #fff;
}

.esim-btn-primary:hover {
    background: #0052a3;
    color: #fff;
}

.esim-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.esim-btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.esim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Confirmation styles */
.esim-confirmation-section {
    margin: 20px 0;
    padding: 16px;
    background: #f0f8ff;
    border: 2px solid #0066cc;
    border-radius: 8px;
}

.esim-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.esim-checkbox-wrapper input[type="checkbox"] {
    margin: 0;
    transform: scale(1.3);
    cursor: pointer;
    accent-color: #0066cc;
}

.esim-checkbox-wrapper .checkbox-label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}

/* Loading states */
.esim-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #6b7280;
}

.esim-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   CUSTOM FIELD STYLES
   ======================================== */

.esim-custom-field {
    margin-bottom: 12px;
}

.esim-custom-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.esim-custom-field input,
.esim-custom-field select,
.esim-custom-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.esim-custom-field input:focus,
.esim-custom-field select:focus,
.esim-custom-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

@media (max-width: 768px) {
    .esim-destinations-header h1 {
        font-size: 2.5rem;
    }
    
    .esim-destinations-header p {
        font-size: 1.125rem;
    }
    
    .esim-controls,
    .esim-search-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .esim-search-wrapper {
        max-width: none;
    }
    
    .esim-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .esim-destinations-page {
        padding: 40px 0;
    }
    
    .esim-destinations-header {
        margin-bottom: 40px;
        padding: 0 16px;
    }
    
    .esim-destinations-header h1 {
        font-size: 2rem;
    }
    
    .esim-destinations-container,
    .esim-container {
        padding: 0 16px;
    }
    
    .esim-controls,
    .esim-search-section {
        padding: 16px;
        margin-bottom: 24px;
    }
}

/* ========================================
   LOADING STATES
   ======================================== */

.esim-loading {
    opacity: 0.7;
    pointer-events: none;
}

.esim-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #64748b;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* ========================================
   LIST VIEW AND GRID VIEW STYLES
   ======================================== */

/* Plans grid container */
#plans-grid {
    display: grid;
    gap: 20px;
    transition: all 0.3s ease;
}

/* Default grid view */
#plans-grid:not(.list-view) {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* List view layout - ULTRA COMPACT CONTAINER */
.esim-plans-grid[data-view="list"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important; /* Tight gap between cards */
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 10px !important;
}

/* List view card styling - COMPACT ROWS WITH TEXT ACCOMMODATION */
.esim-plans-grid[data-view="list"] .esim-plan-card {
    display: grid !important;
    grid-template-columns: 3fr 1.5fr 1.2fr 2fr !important;
    grid-template-areas: "header data price actions" !important;
    gap: 16px !important;
    align-items: center !important;
    padding: 12px 18px !important;
    min-height: 75px !important;
    max-height: 90px !important;
    height: auto !important; /* Allow height to adjust for content */
    overflow: hidden !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* List view card sections - ULTRA COMPACT */
.esim-plans-grid[data-view="list"] .esim-plan-header {
    grid-area: header !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important; /* HORIZONTAL for space efficiency */
    gap: 8px !important;
    align-items: center !important;
    overflow: hidden !important;
}

.esim-plans-grid[data-view="list"] .esim-plan-details {
    grid-area: data !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-align: center !important;
}

.esim-plans-grid[data-view="list"] .esim-plan-actions {
    grid-area: actions !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

/* List view price display */
.esim-plans-grid[data-view="list"] .esim-plan-price {
    grid-area: price !important;
    text-align: center !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.esim-plans-grid[data-view="list"] .esim-price-main {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #059669 !important;
    line-height: 1.2 !important;
}

/* List view typography adjustments - ALLOW TEXT WRAP */
.esim-plans-grid[data-view="list"] .esim-plan-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    color: #111827 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* Allow max 2 lines */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* CRITICAL: Prevent any child element from expanding the card */
.esim-plans-grid[data-view="list"] .esim-plan-card * {
    max-height: 100% !important;
    overflow: hidden !important;
}

/* OVERRIDE conflicting styles from esim-destinations.css */
.esim-plans-grid[data-view="list"] .esim-plan-card {
    height: auto !important; /* Override height: 100% */
    flex-direction: row !important; /* Override flex-direction: column */
    min-height: 75px !important; /* Override various min-heights */
}

/* CRITICAL MOBILE OVERRIDE - Prevent vertical stacking from esim-destinations.css line 1076 */
@media (max-width: 600px) {
    .esim-plans-grid[data-view="list"] .esim-plan-card {
        grid-template-columns: 2fr 0.8fr 0.8fr 1fr !important; /* NEVER single column */
        grid-template-areas: "header data price actions" !important; /* Keep horizontal */
        min-height: 70px !important;
        max-height: 85px !important;
        height: auto !important;
        padding: 10px 12px !important;
        text-align: left !important;
    }
}

.esim-plans-grid[data-view="list"] .esim-data-amount {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
}

.esim-plans-grid[data-view="list"] .esim-validity {
    font-size: 12px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* List view actions layout - COMPACT */
.esim-plans-grid[data-view="list"] .esim-actions-secondary,
.esim-plans-grid[data-view="list"] .esim-actions-primary {
    display: flex !important;
    gap: 6px !important;
    justify-content: center !important;
    width: 100% !important;
}

.esim-plans-grid[data-view="list"] .esim-actions-secondary {
    margin-bottom: 6px !important;
}

/* List view button sizing - COMPACT */
.esim-plans-grid[data-view="list"] .esim-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    flex: 1 !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    text-align: center !important;
    border-radius: 6px !important;
}

.esim-plans-grid[data-view="list"] .esim-btn-buy {
    padding: 8px 12px !important;
    font-weight: 600 !important;
    min-height: 36px !important;
    background: #0066cc !important;
    color: #fff !important;
}

/* View switching transition */
#plans-grid.view-switching {
    opacity: 0.7;
    pointer-events: none;
}

/* Mobile responsiveness for list view - COMPACT WITH TEXT ACCOMMODATION */
@media (max-width: 768px) {
    .esim-plans-grid[data-view="list"] .esim-plan-card {
        grid-template-columns: 2fr 1fr 1fr 1.3fr !important;
        grid-template-areas: "header data price actions" !important;
        gap: 10px !important;
        padding: 10px 14px !important;
        min-height: 70px !important;
        max-height: 85px !important;
        height: auto !important;
        align-items: center !important;
    }
    
    /* FIXED: Keep grid areas assigned properly */
    .esim-plans-grid[data-view="list"] .esim-plan-header {
        grid-area: header !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-plan-details {
        grid-area: data !important;
        flex-direction: row !important; /* FIXED: Keep horizontal, not vertical */
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-plan-price {
        grid-area: price !important;
        text-align: center !important; /* FIXED: Center align for better mobile layout */
    }
    
    .esim-plans-grid[data-view="list"] .esim-plan-actions {
        grid-area: actions !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-actions-secondary,
    .esim-plans-grid[data-view="list"] .esim-actions-primary {
        justify-content: center !important; /* FIXED: Center align actions */
        flex-direction: row !important;
        gap: 4px !important;
    }
    
    /* Mobile typography adjustments */
    .esim-plans-grid[data-view="list"] .esim-plan-title {
        font-size: 13px !important;
        line-height: 1.2 !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-data-amount {
        font-size: 12px !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-validity {
        font-size: 10px !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-price-main {
        font-size: 13px !important;
    }

    /* Compact mobile buttons */
    .esim-plans-grid[data-view="list"] .esim-btn {
        max-width: 65px !important;
        font-size: 9px !important;
        padding: 4px 6px !important;
        min-height: 26px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Additional mobile rules for smaller screens */
@media (max-width: 480px) {
    .esim-plans-grid[data-view="list"] .esim-plan-card {
        grid-template-columns: 2fr 0.8fr 0.8fr 1fr !important;
        padding: 10px 12px !important;
        gap: 6px !important;
        min-height: 65px !important;
        max-height: 80px !important;
        height: auto !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-plan-title {
        font-size: 11px !important;
        line-height: 1.1 !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-data-amount {
        font-size: 10px !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-validity {
        font-size: 9px !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-price-main {
        font-size: 11px !important;
    }
    
    .esim-plans-grid[data-view="list"] .esim-btn {
        max-width: 50px !important;
        font-size: 8px !important;
        padding: 3px 4px !important;
        min-height: 22px !important;
    }
    
    /* Add container padding for edge protection */
    .esim-plans-grid[data-view="list"] {
        padding: 0 12px !important;
        margin: 0 auto !important;
        gap: 8px !important;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

.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;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .esim-destinations-header h1 {
        background: none;
        -webkit-text-fill-color: initial;
        color: #000;
    }
    
    .esim-controls,
    .esim-search-section {
        border: 2px solid #000;
        background: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .esim-modal,
    .esim-modal-content,
    .esim-search-input,
    .spinner {
        transition: none;
        animation: none;
    }
}