/* Product Gallery CSS - Enhanced Gallery Styles */

/* ===== GALLERY LAYOUT ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.gallery-grid.featured {
    grid-template-columns: 2fr 1fr;
}

/* ===== GALLERY ITEMS ===== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition-base);
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}

.gallery-item.featured {
    grid-column: span 2;
}

.gallery-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--light-color);
}

.gallery-item.featured .gallery-image-container {
    height: 450px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.08);
}

/* ===== GALLERY OVERLAY ===== */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content {
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.gallery-item:hover .gallery-content {
    transform: translateY(0);
}

.gallery-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-content h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-content p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* ===== GALLERY FILTERS ===== */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition-base);
    cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ===== GALLERY MODAL ===== */
.gallery-modal .modal-dialog {
    max-width: 95vw;
}

.gallery-modal .modal-content {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.gallery-modal .modal-header {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1.5rem;
}

.gallery-modal .modal-body {
    padding: 0;
    background: #000;
}

.gallery-modal .modal-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.gallery-modal .modal-info {
    padding: 2rem;
    background: #fff;
}

.gallery-modal .modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.gallery-modal .modal-description {
    color: var(--secondary-color);
    margin: 1rem 0;
}

.gallery-modal .modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== GALLERY LOADING ===== */
.gallery-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.gallery-loading .spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--light-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== GALLERY ANIMATIONS ===== */
.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

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

/* ===== GALLERY LIGHTBOX ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* ===== GALLERY COUNTER ===== */
.gallery-counter {
    text-align: center;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* ===== GALLERY SHARE ===== */
.gallery-share {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-share {
    opacity: 1;
}

.share-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.share-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: var(--box-shadow);
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-grid.featured {
        grid-template-columns: 1fr;
    }
    
    .gallery-item.featured {
        grid-column: span 1;
    }
    
    .gallery-image-container {
        height: 220px;
    }
    
    .gallery-item.featured .gallery-image-container {
        height: 300px;
    }
    
    .gallery-overlay {
        padding: 1.5rem;
    }
    
    .gallery-content h4 {
        font-size: 1.2rem;
    }
    
    .gallery-content h5 {
        font-size: 1rem;
    }
    
    .gallery-content p {
        font-size: 0.9rem;
    }
    
    .gallery-filters {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .gallery-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .gallery-modal .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }
    
    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .gallery-share {
        opacity: 1;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .share-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-image-container {
        height: 180px;
    }
    
    .gallery-item.featured .gallery-image-container {
        height: 220px;
    }
    
    .gallery-overlay {
        padding: 1rem;
    }
    
    .gallery-content h4 {
        font-size: 1rem;
    }
    
    .gallery-content h5 {
        font-size: 0.9rem;
    }
    
    .gallery-content p {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .gallery-modal .modal-actions {
        flex-direction: column;
    }
    
    .gallery-modal .modal-actions .btn {
        width: 100%;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-image,
    .gallery-overlay,
    .gallery-content,
    .lightbox,
    .lightbox-image {
        animation: none;
        transition: none;
    }
}

.gallery-item:focus,
.filter-btn:focus,
.share-btn:focus,
.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .gallery-filters,
    .gallery-share,
    .gallery-modal,
    .lightbox {
        display: none !important;
    }
    
    .gallery-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .gallery-image {
        max-width: 100%;
        height: auto;
    }
}
