/* Gallery Styles */
.main-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 30px;
    background: #f8f9fa;
    /* border-bottom: 3px solid #e9ecef; */
}

.main-category {
    padding: 5px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #495057;
    position: relative;
    /* width: 200px; */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-image {
    width: 150px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-category:hover .category-image img {
    transform: scale(1.1);
}

.category-name {
    padding: 8px 0;
    font-size: 1em;
}

.main-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.main-category.active {
    background: linear-gradient(135deg,rgb(192 1 19 / 82%) 0%, rgb(192 1 19 / 82%) 100%);
    color: white;
    border-color:rgb(192 1 19 / 82%);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.main-category.active .category-image {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sub-categories {
    max-height: 0;
    overflow: hidden;
    padding: 0 30px;
    /* background: #ffffff; */
    border-bottom: 2px solid #e9ecef;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.sub-categories.active {
    max-height: max-content;
    padding: 25px 30px;
    opacity: 1;
}

.sub-category-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    animation: slideDown 0.4s ease;
}

.sub-category {
padding: 10px 20px;
  background: #d0d0d0;
  border: 2px solid #9f9f9f;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  color: #000;
  font-weight: bold;
}

.sub-category:hover {
    color: white;
    background: rgb(192 1 19);
    border-color: rgb(192 1 19);
    transform: scale(1.05);
}

.sub-category.active {
    background: rgb(192 1 19);
    color: white;
    border-color: rgb(192 1 19);
}

.gallery {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.gallery.active {
    max-height: 10000px;
    padding: 30px;
    opacity: 1;
}

.gallery-title {
    text-align: center;
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.5em;
    animation: fadeIn 0.5s ease;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0;
    animation: zoomIn 0.5s ease forwards;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    font-weight: bold;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.lightbox-title {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-categories {
        padding: 20px;
    }
    .main-category {
        padding: 5px 8px;
        font-size: 1em;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    .gallery-item img {
        height: 200px;
    }
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .sub-category {
        font-size: 0.85em;
        padding: 8px 15px;
    }
}