/* Enhanced Products Gallery Section */
.products-gallery-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.products-gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10%;
    width: 40%;
    height: 100%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* Gallery Header */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.gallery-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    animation: slideRight 2s ease-in-out infinite alternate;
}

@keyframes slideRight {
    0% {
        width: 50px;
    }

    100% {
        width: 150px;
    }
}

.header-content h2.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 10px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-content .section-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin: 0;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Unified height for all header controls */
.header-controls .search-dropdown,
.header-controls .sort-filter,
.header-controls .view-toggle {
    height: 58px;
}

/* Make form-select match other controls */
.header-controls .form-select {
    height: 58px !important;
    padding: 12px 18px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.header-controls .form-select:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
    background: rgba(37, 99, 235, 0.05) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
}

.header-controls .form-select:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Ensure searchable dropdown aligns with other header controls */
.header-controls .search-dropdown {
    display: flex;
    align-items: center;
}

.header-controls .searchable-display {
    /* match visual height of filter-btn/view-toggle */
    padding: 12px 18px;
    height: 58px;
    box-sizing: border-box;
}

/* Stronger header-scoped override to ensure exact visual parity with other controls */
.gallery-header .header-controls .search-dropdown .searchable-display {
    height: 58px !important;
    min-height: 58px !important;
    padding: 12px 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

/* Match font-size/line-height to button controls for pixel parity */
.gallery-header .header-controls .search-dropdown .searchable-display .selected-text {
    line-height: 1 !important;
    font-size: 0.95rem !important;
}

/* Extra strong header-scoped parity fixes: ensure icon sizes, chevron and inner spacing exactly match siblings */
.gallery-header .header-controls .search-dropdown {
    display: inline-flex !important;
    align-items: center !important;
}

.gallery-header .header-controls .search-dropdown .searchable-display {
    /* remove extra vertical padding and center content precisely */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.gallery-header .header-controls .search-dropdown .searchable-display .option-icon {
    font-size: 1.05rem !important;
    /* slightly larger so visual weight matches filter icons */
    line-height: 1 !important;
    margin-inline-start: 8px !important;
    margin-inline-end: 8px !important;
}

.gallery-header .header-controls .search-dropdown .searchable-display i.fa-chevron-down,
.gallery-header .header-controls .search-dropdown .searchable-display .fa-chevron-down {
    font-size: 0.95rem !important;
    line-height: 1 !important;
    color: #64748b !important;
}

/* Ensure selected text doesn't stretch the control vertically */
.gallery-header .header-controls .search-dropdown .searchable-display .selected-text {
    max-height: 58px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Tweak for RTL spacing parity (respect start/end) */
.rtl .gallery-header .header-controls .search-dropdown .searchable-display .option-icon {
    margin-inline-start: 8px !important;
    margin-inline-end: 8px !important;
}

.sort-filter {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    height: 58px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    color: #2d3748;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.filter-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.filter-btn:active {
    transform: translateY(0);
}

/* Sort Filter Dropdown Fixes */
.sort-filter .dropdown-menu {
    min-width: 250px;
    max-width: 300px;
    width: auto !important;
    padding: 12px 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 8px;
}

.sort-filter .dropdown-item {
    padding: 12px 20px;
    font-size: 0.95rem;
    color: #2d3748;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-filter .dropdown-item i {
    width: 18px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.sort-filter .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    padding-right: 25px;
}

.sort-filter .dropdown-item:hover i {
    color: #2563eb;
}

.sort-filter .dropdown-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: #2563eb;
    font-weight: 600;
    position: relative;
}

.sort-filter .dropdown-item.active::after {
    content: '✓';
    position: absolute;
    left: 20px;
    font-weight: 700;
    color: #2563eb;
}

.sort-filter .dropdown-item.active i {
    color: #2563eb;
}

.sort-filter .dropdown-divider {
    margin: 8px 0;
    border-color: #e9ecef;
}

/* View Toggle Enhanced */
.view-toggle {
    display: flex;
    gap: 6px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.view-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.view-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.view-btn.active::before,
.view-btn:hover::before {
    opacity: 1;
}

.view-btn.active,
.view-btn:hover {
    color: white;
    transform: scale(1.05);
}

.view-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.view-btn.active i {
    transform: scale(1.1);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    perspective: 1000px;
    transition: all 0.3s ease;
}

/* List View */
.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 20px;
}

.products-grid.list-view .product-card-modern {
    display: flex;
    flex-direction: row;
    max-width: 100%;
}

.products-grid.list-view .product-image-wrapper {
    width: 320px;
    height: 240px;
    flex-shrink: 0;
}

.products-grid.list-view .product-content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-grid.list-view .product-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
    transition: all 0.3s ease;
}

.product-card-modern:hover .product-description {
    background: #f1f5f9;
    border-left-color: #2563eb;
}

.products-grid.list-view .product-title a {
    font-size: 1.25rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.products-grid.list-view .product-features {
    margin-bottom: 20px;
}

.products-grid.list-view .product-footer {
    margin-top: auto;
}

.products-grid.list-view .product-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.products-grid.list-view .price-current {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2563eb;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.products-grid.list-view .price-currency {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 600;
}

.product-card-modern:hover .price-current {
    transform: scale(1.05);
}

.products-grid.list-view .btn-contact {
    padding: 14px 30px;
    font-size: 1rem;
}

/* Modern Product Card */
.product-card-modern {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform-style: preserve-3d;
}

.product-card-modern a,
.product-card-modern button {
    text-decoration: none !important;
}

.product-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card-modern:hover {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card-modern:hover::before {
    opacity: 1;
}

/* Product Image Wrapper */
.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

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

.product-card-modern:hover .product-image {
    transform: scale(1.15) rotate(1deg);
    filter: brightness(1.05);
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.product-badges span {
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: bounceIn 0.5s ease-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.badge-new {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.badge-featured {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    font-weight: 800;
}

.badge-hot {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.badge-discount {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.badge-urgent {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

/* Product Overlay */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1;
    backdrop-filter: blur(0px);
}

.product-card-modern:hover .product-overlay {
    opacity: 1;
    backdrop-filter: blur(2px);
}

.overlay-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    color: #334155;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.product-card-modern:hover .overlay-btn {
    opacity: 1;
    transform: scale(1);
}

.product-card-modern:hover .overlay-btn:nth-child(1) {
    transition-delay: 0.1s;
}

.product-card-modern:hover .overlay-btn:nth-child(2) {
    transition-delay: 0.15s;
}

.product-card-modern:hover .overlay-btn:nth-child(3) {
    transition-delay: 0.2s;
}

.overlay-btn:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.15) translateY(0);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.overlay-btn.favorite-btn:hover {
    background: #ef4444;
    transform: scale(1.15) translateY(0);
    animation: heartBeat 0.5s ease;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1.15);
    }

    25% {
        transform: scale(1.25);
    }

    50% {
        transform: scale(1.15);
    }

    75% {
        transform: scale(1.25);
    }
}

/* Product Content */
.product-content {
    padding: 20px;
}

.product-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #2563eb;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border: 1px solid #93c5fd;
}

.product-category i {
    font-size: 0.85rem;
}

.product-card-modern:hover .product-category {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.product-title {
    margin: 0 0 12px;
}

.product-title a {
    color: #1a202c;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    transition: width 0.3s ease;
}

.product-title a:hover {
    color: #2563eb;
}

.product-card-modern:hover .product-title a::after {
    width: 100%;
}

/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    display: flex;
    gap: 2px;
    color: #ffc107;
    font-size: 0.85rem;
}

.rating-count {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Product Meta */
.product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-divider {
    color: #dee2e6;
}

/* Product Features */
.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #6c757d;
}

.feature i {
    color: #2563eb;
}

/* Product Footer */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2563eb;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.price-old {
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: line-through;
}

.price-currency {
    font-size: 0.9rem;
    color: #6c757d;
}

.price-currency-small {
    font-size: 0.55em;
    font-weight: 700;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-contact:hover::before {
    width: 300px;
    height: 300px;
}

.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-contact:active {
    transform: translateY(-1px);
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 50px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #2563eb;
    border-radius: 15px;
    color: #2563eb;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
}

.btn-load-more::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-load-more:hover::before {
    left: 100%;
}

.btn-load-more:hover {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
    border-color: transparent;
}

.btn-load-more i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-load-more:hover i {
    transform: translateY(5px);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(5px);
    }

    50% {
        transform: translateY(8px);
    }
}

/* Skeleton Loading States */
.product-card-skeleton {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.skeleton-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 20px;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    margin-bottom: 12px;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.title {
    height: 16px;
    width: 80%;
}

.skeleton-line.subtitle {
    height: 12px;
    width: 60%;
}

.skeleton-line.price {
    height: 20px;
    width: 40%;
    margin-top: 20px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .products-gallery-section {
        padding: 30px 0 60px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 25px;
    }

    .header-content h2.section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .products-gallery-section {
        padding: 25px 0 50px;
    }

    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 40px;
    }

    .header-content h2.section-title {
        font-size: 1.75rem;
    }

    .header-content .section-subtitle {
        font-size: 0.95rem;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Maintain consistent heights on tablet */
    .header-controls .form-select {
        height: 44px !important;
        padding: 10px 14px !important;
    }

    .header-controls .searchable-display {
        height: 44px !important;
        padding: 10px 12px !important;
    }

    .filter-btn {
        height: 44px !important;
        padding: 10px 20px !important;
    }

    .view-toggle {
        height: 44px !important;
        padding: 5px !important;
    }

    .view-btn {
        width: 38px !important;
        height: 38px !important;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* List view adjustments for tablets */
    .products-grid.list-view {
        grid-template-columns: 1fr;
    }

    .products-grid.list-view .product-card-modern {
        flex-direction: column;
    }

    .products-grid.list-view .product-image-wrapper {
        width: 100%;
        height: 200px;
    }

    .products-grid.list-view .product-content {
        padding: 16px;
    }

    .products-grid.list-view .product-title a {
        font-size: 1rem;
    }

    .products-grid.list-view .price-current {
        font-size: 1.25rem;
    }

    .product-image-wrapper {
        height: 200px;
    }

    .product-content {
        padding: 16px;
    }

    .product-title a {
        font-size: 0.95rem;
    }

    .btn-contact {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .btn-load-more {
        padding: 16px 40px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .products-gallery-section {
        padding: 20px 0 40px;
    }

    .header-content h2.section-title {
        font-size: 1.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card-modern {
        border-radius: 16px;
    }

    .product-image-wrapper {
        height: 220px;
    }

    /* Maintain consistent heights on mobile */
    .header-controls .form-select {
        height: 40px !important;
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    .filter-btn {
        height: 40px !important;
        padding: 8px 14px !important;
    }

    .filter-btn span {
        display: none;
    }

    .view-toggle {
        height: 40px !important;
        padding: 4px !important;
    }

    .view-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .view-toggle {
        display: flex;
    }

    /* Force grid view on mobile */
    .products-grid.list-view {
        grid-template-columns: 1fr !important;
    }

    .products-grid.list-view .product-card-modern {
        flex-direction: column !important;
    }

    .products-grid.list-view .product-image-wrapper {
        width: 100% !important;
        height: 220px !important;
    }

    /* Touch-friendly interactions for mobile */
    .overlay-btn {
        width: 45px;
        height: 45px;
    }

    /* Show overlay buttons on mobile without hover */
    .product-overlay {
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
        opacity: 1;
        backdrop-filter: none;
    }

    .product-overlay .overlay-btn {
        position: absolute;
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    .product-overlay .overlay-btn:nth-child(1) {
        top: 12px;
        left: 12px;
        transition-delay: 0s;
    }

    .product-overlay .overlay-btn:nth-child(2) {
        top: 12px;
        left: 65px;
        transition-delay: 0s;
    }

    .product-overlay .overlay-btn:nth-child(3) {
        top: 12px;
        left: 118px;
        transition-delay: 0s;
    }

    /* Improve touch targets */
    .btn-contact {
        width: 100%;
        justify-content: center;
    }

    .product-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .btn-load-more {
        width: 90%;
        max-width: 400px;
        justify-content: center;
    }
}

/* Extra small phones (e.g., iPhone 12 Pro ~390px) */
@media (max-width: 400px) {
    .gallery-header {
        gap: 14px;
    }

    .header-controls {
        gap: 10px;
    }

    .header-controls .form-select,
    .header-controls .searchable-display,
    .filter-btn {
        height: 38px !important;
        padding: 8px 12px !important;
    }

    .view-toggle {
        height: 38px !important;
        padding: 4px !important;
    }

    .view-btn {
        width: 34px !important;
        height: 34px !important;
    }

    .products-grid {
        gap: 14px;
    }

    .product-image-wrapper {
        height: 190px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card-modern:hover {
        transform: translateY(-5px);
    }

    .overlay-btn:hover {
        transform: scale(1.1);
    }

    .btn-contact:hover {
        transform: translateY(-2px);
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-modern {
    animation: fadeInUp 0.6s ease-out;
}