



/* Gallery Page Styles - Mobile First */
.gallery-section {
    padding: 80px 0 40px;
    background-color: #f9f9f9;
}

/* Base styles for all screen sizes */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0 auto 40px;
    width: 100%;
    padding: 0 15px;
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    color: #333;
    font-size: 1.1rem;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 15px 30px;
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.gallery-filters::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
    width: 0;
    height: 0;
}

.filter-btn {
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #f2cbde;
    color: #fff;
    border-color: #f2cbde;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 0 auto 60px;
    max-width: 1200px;
    width: 100%;
}

.gallery-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Before/After Slider */
.before-after-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: none;
    background: #f0f0f0; /* Fallback background */
}

.before-after-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Before/After containers */
.before,
.after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.before {
    width: 50%;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.before img,
.after img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    /* Ensure consistent sizing */
    min-width: 100%;
    min-height: 100%;
    max-width: 100%;
    max-height: 100%;
    /* Ensure images load properly */
    background: #f0f0f0;
}

.slider-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Labels */
.label {
    position: absolute;
    bottom: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 20px;
    z-index: 5;
    pointer-events: none;
}

.before .label {
    left: 20px;
}
.after .label {
    right: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (min-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .before-after-slider {
        height: 350px;
    }
}

@media (min-width: 768px) {
    .gallery-section {
        padding: 100px 0 60px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        padding: 0 20px;
        max-width: 1200px;
    }

    .before-after-slider {
        height: 450px;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Labels */
.label {
    position: absolute;
    bottom: 20px;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10;
    border-radius: 20px;
    pointer-events: none;
}

.before .label {
    left: 20px;
}

.after .label {
    right: 20px;
}

/* Slider Handle */
.slider-handle {
    position: absolute;
    top: 0;
    left: calc(50% - 2px);
    width: 4px;
    height: 100%;
    background: #fff;
    z-index: 5;
    cursor: ew-resize;
    touch-action: none;
}

.slider-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.slider-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #f2cbde;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Active state */
.before-after-slider.active .slider-handle {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f2cbde;
}

.before-after-slider.active .slider-handle::before {
    transform: translate(-50%, -50%) scale(1.1);
}

.before-after-slider.active .slider-handle::after {
    opacity: 1;
}

/* Touch device optimizations */
@media (hover: none) {
    .slider-handle::before {
        width: 50px;
        height: 50px;
    }

    .slider-handle::after {
        width: 12px;
        height: 12px;
    }

    .label {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

.gallery-caption {
    padding: 20px;
    text-align: center;
}

.gallery-caption h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.gallery-caption p {
    color: #666;
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #f2cbde, #333);
    padding: 60px 20px;
    border-radius: 15px;
    text-align: center;
    color: #fff;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.05)" d="M0,0 L100,0 L100,100 L0,100 Z"></path></svg>');
    opacity: 0.5;
    z-index: 1;
}

.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cta-section p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 25px;
    position: relative;
    z-index: 2;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: #fff;
    color: #f2cbde;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #f2cbde;
    color: #fff;
    border-color: #fff;
}

@media (max-width: 768px) {
    .cta-section {
        padding: 50px 20px;
    }

    .cta-section h2 {
        font-size: 1.8rem;
    }

    .cta-section p {
        font-size: 1rem;
    }

    .cta-button {
        padding: 10px 30px;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 0 20px;
    }

    .before-after-slider {
        height: 350px;
    }
}

@media (max-width: 767.98px) {
    /* Touch-friendly adjustments */
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .gallery-item {
        border-radius: 8px;
    }

    .before-after-slider {
        height: 300px;
    }

    .gallery-filters {
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .before-after-slider {
        height: 300px;
    }

    .gallery-caption {
        padding: 15px;
    }

    .gallery-caption h3 {
        font-size: 1.1rem;
    }

    .gallery-caption p {
        font-size: 0.85rem;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
}
