/* Main Content */
.main-content {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    padding-top: 100px;
}

/* Hero Section */
.gallery-hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 59, 111, 0.95), rgba(0, 0, 0, 0.9));
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.gallery-hero h1 {
    font-family: var(--font-primary);
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideInUp 1s ease-out;
}

.gallery-hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: slideInUp 1s ease-out 0.2s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Section */
.filter-section {
    padding: 40px 0;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(0, 174, 239, 0.2);
    border-bottom: 1px solid rgba(0, 174, 239, 0.2);
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-white);
}

.search-bar {
    position: relative;
    max-width: 400px;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(0, 174, 239, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    color: var(--color-white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-white);
    font-size: 1.2rem;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 1rem 2rem;
    border: 2px solid rgba(0, 174, 239, 0.3);
    border-radius: 50px;
    background: transparent;
    color: var(--color-white);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-tab.active::before,
.filter-tab:hover::before {
    left: 0;
}

.filter-tab.active {
    border-color: var(--color-primary);
    box-shadow: 0 8px 25px rgba(0, 174, 239, 0.3);
}

/* Sort and View Options */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-label {
    color: var(--color-white);
    font-weight: 500;
}

.sort-select {
    padding: 0.8rem 1.5rem;
    border: 2px solid rgba(0, 174, 239, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select option {
    background: rgba(0, 59, 111, 0.9);
    color: var(--color-white);
    transition: all 0.1s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(0, 174, 239, 0.3);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 45px;
    height: 45px;
    border: 2px solid rgba(0, 174, 239, 0.3);
    border-radius: 12px;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.3);
}

/* Gallery Grid */
.gallery-section {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 59, 111, 0.8));
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.compact-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid rgba(0, 174, 239, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    cursor: pointer;
    transform-style: preserve-3d;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover::before {
    opacity: 0.1;
}

.product-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 30px 60px rgba(0, 174, 239, 0.3);
    border-color: var(--color-primary);
}

.product-image {
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 25px 25px 0 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.product-icon {
    position: absolute;
    font-size: 3rem;
    color: var(--color-primary);
    z-index: 2;
    animation: float 3s ease-in-out infinite;
    text-shadow: 0px 0px 8px #000000;
    transition: all 0.3s ease;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-accent);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(255, 108, 0, 0.4);
    transition: all 0.3s ease;
}

.product-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.product-category {
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: rgba(0, 174, 239, 0.2);
    color: var(--color-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(0, 174, 239, 0.3);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.price-current {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
    text-shadow: 0 2px 10px rgba(255, 108, 0, 0.3);
}

.price-original {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.stars {
    display: flex;
    gap: 0.2rem;
}

.stars i {
    color: #ffc107;
    font-size: 1rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.rating-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
    z-index: 10;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(45deg, var(--color-accent), #ff8533);
    color: var(--color-white);
    padding: 1rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 108, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 1rem;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 174, 239, 0.3);
}

/* List View Styles */
.product-card.list-view {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.product-card.list-view .product-image {
    width: 150px;
    height: 120px;
    flex-shrink: 0;
    margin-right: 2rem;
    border-radius: 15px;
}

.product-card.list-view .product-content {
    flex: 1;
    padding: 0;
}

/* Mobile responsive for gallery section */
@media (max-width: 768px) {

    .gallery-container {
        padding: 0 1rem;
    }

    .products-grid {
        justify-content: center;
    }

    .product-card {
        max-width: 100vw;
    }

    /* General product card tweaks */
    .product-content {
        padding: 1rem;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* --- LIST VIEW --- */
    .products-grid.list-view {
        grid-template-columns: 1fr;
    }

    .product-card.list-view {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .product-card.list-view .product-image {
        width: 100%;
        height: 200px;
        margin: 0 0 1rem 0;
        border-radius: 12px;
    }

    .product-card.list-view .product-content {
        padding: 0;
        width: 100%;
    }

    /* Hide some less-important info for mobile readability */
    .product-card.list-view .product-features {
        display: none;
    }

    /* --- COMPACT VIEW --- */
    .products-grid.compact-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .product-card.compact-view .product-image {
        height: 140px;
    }

    .product-card.compact-view .product-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .product-card.compact-view .product-description {
        display: none;
        /* Hide description to save space */
    }

    .product-card.compact-view .product-features {
        display: none;
        /* Too cluttered for compact */
    }

    .product-card.compact-view .product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .product-card.compact-view .product-price .price-current {
        font-size: 1.2rem;
    }

    .product-card.compact-view .product-actions {
        flex-direction: row;
        margin-top: 0.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 4rem;
}

.pagination-btn {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 174, 239, 0.3);
    border-radius: 12px;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.pagination-btn.active {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.3);
}

.pagination-btn:hover:not(.active) {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* Loading Animation */
.loading-products {
    display: none;
    text-align: center;
    padding: 4rem 0;
}

.loading-products.active {
    display: block;
}

.loader-3d {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.loader-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 174, 239, 0.3);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-3d::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 4px solid rgba(255, 108, 0, 0.3);
    border-bottom: 4px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-hero h1 {
        font-size: 2.5rem;
    }

    .filter-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        max-width: 100%;
    }

    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.product-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-tab {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-secondary {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-actions .btn-primary {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced hover effects for product cards */
.product-card:hover .product-icon {
    transform: translateY(-10px) scale(1.1);
    text-shadow: 0 15px 40px rgba(0, 174, 239, 0.4);
}

.product-card:hover .product-badge {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 108, 0, 0.6);
}

/* Smooth transitions for view changes */
.products-grid {
    transition: all 0.3s ease;
}

.product-card {
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced loading animation */
.loading-products {
    transition: all 0.3s ease;
}

.loading-products p {
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Enhanced pagination styles */
.pagination-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pagination-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 174, 239, 0.3);
}

/* Enhanced focus states for accessibility */
.search-input:focus,
.sort-select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 174, 239, 0.3);
}

/* Product card tilt effect on hover */
.product-card {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.product-card:hover {
    animation: card-tilt 0.4s ease-out forwards;
}

@keyframes card-tilt {
    0% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }

    50% {
        transform: translateY(-10px) rotateX(3deg) rotateY(3deg);
    }

    100% {
        transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    }
}

/* Enhanced filter tab animations */
.filter-tab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 174, 239, 0.4);
}

/* Staggered animation for product grid */
.product-card:nth-child(1) {
    animation-delay: 0ms;
}

.product-card:nth-child(2) {
    animation-delay: 100ms;
}

.product-card:nth-child(3) {
    animation-delay: 200ms;
}

.product-card:nth-child(4) {
    animation-delay: 300ms;
}

.product-card:nth-child(5) {
    animation-delay: 400ms;
}

.product-card:nth-child(6) {
    animation-delay: 500ms;
}

.product-card:nth-child(7) {
    animation-delay: 600ms;
}

.product-card:nth-child(8) {
    animation-delay: 700ms;
}

.product-card:nth-child(9) {
    animation-delay: 800ms;
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
    .product-card:hover {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }

    .product-card:active {
        transform: scale(0.98);
    }
}