/* Product Page Styles */

/* Product Grid Layout */
.gallery-section {
    padding: 0;
    margin-top: 93px; /* Add margin to account for fixed header height */
    background-color: #000;
    width: 100%;
}

.product-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 300px;
    gap: 20px;
}

.product-item {
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    width: 100%;
    height: 100%;
    border-radius: 0; /* Explicitly remove any border radius */
}

/* Make anchor tags fill the entire product item */
.product-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.product-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important; /* Force stretch regardless of aspect ratio */
    display: block !important; /* Removes any potential gaps */
    transition: none !important; /* Remove any hover animations */
    min-height: 100% !important; /* Force minimum height */
    max-height: 100% !important; /* Restrict maximum height */
    /* Override any inline styles */
    margin: 0 !important;
    padding: 0 !important;
}

/* Override any hover effects */
.product-item:hover img {
    transform: none;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.product-item:hover .product-overlay {
    transform: translateY(0);
}

.product-overlay h3 {
    font-size: 22px;
    margin-bottom: 5px;
}

.product-overlay p {
    font-size: 14px;
    color: #ccc;
}

/* Special layout items */
.product-item.large-1 {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
    height: 100%; /* Ensure consistent height */
}

.product-item.large-1 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important; /* Force image to stretch */
}

.product-item.large-2 {
    grid-column: 2 / span 2;
    grid-row: 5 / span 2;
    height: 100%; /* Ensure consistent height */
}

.product-item.large-2 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important; /* Force image to stretch */
}

/* Force all images to have the same height aspect */
.product-grid-container img {
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Pagination styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    background-color: #505050;
    width: 100%;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 10px;
}

.pagination li {
    display: inline-block;
}

.pagination a, .pagination span {
    display: block;
    padding: 8px 15px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.pagination a:hover, .pagination .active span {
    background-color: #000;
}

.pagination .disabled span {
    background-color: #666;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-section {
        margin-top: 60px; /* Reduced margin for smaller screens */
    }
}

@media (max-width: 992px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-item.large-1 {
        grid-column: 1 / span 2;
        grid-row: 1 / span 1;
    }

    .product-item.large-2 {
        grid-column: 1 / span 2;
        grid-row: 5 / span 1;
    }
}

@media (max-width: 576px) {
    .product-grid-container {
        grid-template-columns: 1fr;
    }

    .product-item.large-1,
    .product-item.large-2 {
        grid-column: 1;
        grid-row: auto;
    }

    .pagination {
        gap: 5px;
    }

    .pagination a, .pagination span {
        padding: 6px 12px;
    }
}