/* ==============================================
   CATALOG GALLERY STYLE | Instagram-like Design
   ============================================== */

/* Container */
.container-custom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* View Buttons */
.view-btn {
    background: white;
    border-color: var(--color-light-gray);
    color: var(--color-gray);
}

.view-btn.active {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: white;
}

.view-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.view-btn.active:hover {
    background: var(--color-gold-dark);
    border-color: var(--color-gold-dark);
    color: white;
}

/* Product Card - Grid View (Instagram Style) */
.product-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(201, 169, 97, 0.2);
}

/* Product Image Container */
.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(201, 169, 97, 0.95);
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* Product Info */
.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

.product-code {
    font-size: 12px;
    color: var(--color-gray);
    font-family: monospace;
}

/* Product Actions */
.product-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--color-ultra-light);
    display: flex;
    justify-content: center;
}

.product-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-gold);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-view-btn:hover {
    background: var(--color-gold-dark);
    transform: scale(1.05);
}

/* List View */
.products-list .product-card {
    flex-direction: row;
    max-width: 100%;
}

.products-list .product-image-container {
    width: 200px;
    min-width: 200px;
    aspect-ratio: 1;
}

.products-list .product-info {
    padding: 20px;
    flex: 1;
}

.products-list .product-title {
    font-size: 18px;
    min-height: auto;
}

.products-list .product-actions {
    width: auto;
    border-top: none;
    border-left: 1px solid var(--color-ultra-light);
    padding: 20px;
    align-items: center;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
}

.modal-image {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-info {
    margin-top: 24px;
    text-align: center;
    max-width: 600px;
}

/* Modal Progress Bar */
.modal-progress {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.modal-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--color-gold);
    transition: width 0.1s linear;
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    font-weight: 300;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.2);
}

/* Modal Navigation Buttons */
.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: 600;
    color: white;
    background: rgba(201, 169, 97, 0.3);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(201, 169, 97, 0.6);
    transform: translateY(-50%) scale(1.1);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container-custom {
        padding: 0 16px;
    }
    
    /* Product Card Mobile */
    .product-info {
        padding: 12px;
    }
    
    .product-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .product-code {
        font-size: 11px;
    }
    
    .product-actions {
        padding: 10px 12px;
    }
    
    .product-view-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* List View Mobile */
    .products-list .product-card {
        flex-direction: column;
    }
    
    .products-list .product-image-container {
        width: 100%;
        min-width: 100%;
    }
    
    .products-list .product-actions {
        border-left: none;
        border-top: 1px solid var(--color-ultra-light);
        padding: 12px;
    }
    
    /* Modal Mobile */
    .modal-image {
        max-width: 95%;
        max-height: 60vh;
    }
    
    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
    
    .modal-info {
        padding: 0 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideUp 0.4s ease forwards;
}

/* Stagger animation for cards */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }
