/**
 * Quick Compare Modal Styles
 * File: /wp-content/themes/picks-curated-theme/src/quick-compare-modal.css
 */

/* ========================================
   MODAL OVERLAY & CONTAINER
   ======================================== */

.qc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qc-modal-overlay.active {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
}

.qc-modal-container {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.qc-modal-overlay.active .qc-modal-container {
    transform: scale(1) translateY(0);
}

/* ========================================
   MODAL HEADER
   ======================================== */

.qc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.qc-header-content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.qc-header-icon {
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.qc-header-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.qc-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.qc-modal-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.125rem 0 0 0;
}

.qc-close-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: none;
    background: white;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qc-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.qc-close-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ========================================
   MODAL BODY
   ======================================== */

.qc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */

.qc-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.qc-product-card {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.qc-product-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.qc-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qc-product-card:hover .qc-remove-btn {
    opacity: 1;
}

.qc-remove-btn:hover {
    background: #dc2626;
    color: white;
}

.qc-remove-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

.qc-product-rank {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-product-image {
    width: 100px;
    height: 100px;
    margin: 0.5rem auto 0.75rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.qc-product-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    min-height: 2.6em;
}

.qc-product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.qc-star {
    font-size: 0.875rem;
}

.qc-star-full {
    color: #f59e0b;
}

.qc-star-half {
    color: #f59e0b;
    opacity: 0.5;
}

.qc-star-empty {
    color: #d1d5db;
}

.qc-rating-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.25rem;
}

.qc-product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.qc-current-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.qc-original-price {
    font-size: 0.8125rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.qc-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #166534;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.qc-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.qc-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.qc-buy-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ========================================
   QUICK STATS
   ======================================== */

.qc-quick-stats {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.qc-stats-header {
    margin-bottom: 0.75rem;
}

.qc-stats-header h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
}

.qc-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qc-stat-row {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
}

.qc-stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
}

.qc-stat-label svg {
    width: 1rem;
    height: 1rem;
}

.qc-stat-values {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
}

.qc-stat-value {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    position: relative;
}

.qc-stat-value.qc-best {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #166534;
}

.qc-best-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    background: #166534;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    margin-left: 0.375rem;
    vertical-align: middle;
}

/* ========================================
   WINNER SECTION
   ======================================== */

.qc-winner-section {
    margin-top: 1rem;
}

.qc-winner-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
}

.qc-winner-badge {
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.qc-trophy {
    font-size: 0.875rem;
}

.qc-winner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.qc-winner-image {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-winner-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.qc-winner-info {
    flex: 1;
    min-width: 0;
}

.qc-winner-info h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qc-winner-info p {
    font-size: 0.75rem;
    color: #a16207;
    margin: 0;
}

.qc-winner-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    color: white;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.qc-winner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.4);
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.qc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.qc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qc-btn svg {
    width: 1rem;
    height: 1rem;
}

.qc-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.qc-btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.qc-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.qc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 640px) {
    .qc-modal-container {
        max-height: 95vh;
        border-radius: 1rem 1rem 0 0;
        margin-top: auto;
    }
    
    .qc-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .qc-modal-overlay.active .qc-modal-container {
        transform: translateY(0);
    }
    
    .qc-modal-container:not(.active) {
        transform: translateY(100%);
    }
    
    .qc-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .qc-product-image {
        width: 70px;
        height: 70px;
    }
    
    .qc-stat-label {
        min-width: 80px;
        font-size: 0.75rem;
    }
    
    .qc-stat-value {
        font-size: 0.75rem;
    }
    
    .qc-winner-content {
        flex-wrap: wrap;
    }
    
    .qc-winner-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .qc-modal-footer {
        flex-direction: column;
    }
    
    .qc-btn {
        width: 100%;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.qc-modal-body::-webkit-scrollbar {
    width: 6px;
}

.qc-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.qc-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.qc-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}