/**
 * products-modal.css
 * Premium modal for viewing all products
 */

/* ========================================
   MODAL OVERLAY & CONTAINER
   ======================================== */

.products-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.products-modal.open {
    opacity: 1;
    visibility: visible;
}

.products-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================
   MODAL CONTENT
   ======================================== */

.products-modal-content {
    position: relative;
    background: var(--white);
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.products-modal.open .products-modal-content {
    transform: scale(1);
}

/* ========================================
   MODAL HEADER
   ======================================== */

.products-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(245, 245, 247, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
}

.products-modal-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.02em;
}

.close-modal {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: rotate(90deg) scale(1.1);
}

/* ========================================
   MODAL BODY - SCROLLABLE
   ======================================== */

.products-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.products-modal-body::-webkit-scrollbar {
    width: 8px;
}

.products-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.products-modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.products-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ========================================
   PRODUCT GRID IN MODAL
   ======================================== */

#allProductsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

#allProductsGrid .product-card {
    animation: productCardFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes productCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation */
#allProductsGrid .product-card:nth-child(1) {
    animation-delay: 0.05s;
}

#allProductsGrid .product-card:nth-child(2) {
    animation-delay: 0.1s;
}

#allProductsGrid .product-card:nth-child(3) {
    animation-delay: 0.15s;
}

#allProductsGrid .product-card:nth-child(4) {
    animation-delay: 0.2s;
}

#allProductsGrid .product-card:nth-child(5) {
    animation-delay: 0.25s;
}

#allProductsGrid .product-card:nth-child(6) {
    animation-delay: 0.3s;
}

#allProductsGrid .product-card:nth-child(7) {
    animation-delay: 0.35s;
}

#allProductsGrid .product-card:nth-child(8) {
    animation-delay: 0.4s;
}

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

@media (max-width: 1024px) {
    #allProductsGrid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .products-modal-header {
        padding: 24px 32px;
    }

    .products-modal-header h2 {
        font-size: 1.5rem;
    }

    .products-modal-body {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .products-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    #allProductsGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .products-modal-header {
        padding: 20px 24px;
    }

    .products-modal-header h2 {
        font-size: 1.3rem;
    }

    .products-modal-body {
        padding: 24px;
    }

    .close-modal {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 600px) {
    #allProductsGrid {
        grid-template-columns: 1fr;
    }

    .products-modal-header {
        padding: 16px 20px;
    }

    .products-modal-body {
        padding: 20px;
    }
}