/* Gallery Section */
.gallery-section {
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.gallery-section .section-title {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
}

.gallery-section .section-subtitle {
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
}

.gallery-swiper-container {
    position: relative;
    padding: 0;
    margin: 0 auto;
    max-width: 100%;
    overflow: visible; /* allow arrows to sit outside image bounds */
}

.gallery-swiper {
    width: 100%;
    padding-bottom: 20px;
    padding-top: 30px;
}

.gallery-swiper .swiper-slide {
    padding: 0 15px;
    height: auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding-top: 20px;
}

.gallery-swiper .swiper-wrapper {
    align-items: stretch;
    padding-bottom: 0;
    display: flex;
}

.gallery-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.gallery-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 10px;
    box-shadow: none;
}

.gallery-image img {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    border-radius: 15px;
    box-shadow: none;
}

.gallery-card:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.85), rgba(74, 144, 226, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content {
    text-align: center;
    color: white;
    padding: 1.5rem;
}

.gallery-content h5 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gallery-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.gallery-btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.gallery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

/* Gallery Navigation */
.gallery-button-next,
.gallery-button-prev {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
    top: 50% !important;
    transform: translateY(-50%);
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 1px solid rgba(0,0,0,0.05);
}

.gallery-button-next:hover,
.gallery-button-prev:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-button-next::after,
.gallery-button-prev::after {
    font-size: 18px;
    font-weight: 700;
}

/* Pagination removed: using navigation arrows across viewports */

/* Gallery Responsive Styles */
@media (max-width: 992px) {
    .gallery-section {
        padding: 3rem 1.5rem;
        margin-top: 70px;
    }
    
    .gallery-section .section-title {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }

    .gallery-section .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }
    
    .gallery-swiper .swiper-slide {
        /* padding: 0 12px; */
    }
    
    .gallery-card {
        height: 350px;
    }
    
    .gallery-content h5 {
        font-size: 1.4rem;
    }
    
    .gallery-content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 2.5rem 1rem;
        margin-top: 60px;
    }
    
    .gallery-section .section-title {
        font-size: 2rem;
        margin-bottom: 0.6rem;
    }

    .gallery-section .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .gallery-swiper {
        padding-bottom: 15px;
        padding-top: 10px; /* reduce top gap so arrows sit truly centered */
    }
    
    .gallery-swiper .swiper-slide { padding: 0 10px; padding-top: 0; }
    
    .gallery-card {
    height: 280px;
    }
    
    .gallery-content {
        padding: 1.2rem;
    }
    
    .gallery-content h5 {
        font-size: 1.3rem;
    }
    
    .gallery-content p {
        font-size: 0.9rem;
    }
    
    .gallery-button-prev { left: 6px; right: auto; }
    .gallery-button-next { right: 6px; left: auto; }
    .gallery-button-next,
    .gallery-button-prev {
        display: flex;
        width: 44px;
        height: 44px;
        top: 50% !important;
        transform: translateY(-50%);
    }
    
    .gallery-button-next:hover,
    .gallery-button-prev:hover {
        transform: translateY(-50%) scale(1.1);
    }
    
    .gallery-button-next::after,
    .gallery-button-prev::after {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .gallery-section {
        padding: 2rem 0.8rem;
        margin-top: 50px;
    }
    
    @media (max-width: 576px) {
        .gallery-section {
            padding: 2rem 0.8rem;
            margin-top: 50px;
        }
    
    .gallery-section .section-title {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .gallery-section .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .gallery-swiper {
        padding-bottom: 12px;
        padding-top: 6px; /* further reduce top gap on small phones */
    }
    
    .gallery-swiper .swiper-slide { padding: 0 8px; padding-top: 0; }
    
    .gallery-card {
    min-height: 90vw;
    height: 100%;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    }
    
    .gallery-content {
        padding: 1rem;
    }
    
    .gallery-content h5 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    
    .gallery-content p {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .gallery-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 1.5rem 0.5rem;
        margin-top: 40px;
    }
    
    .gallery-section .section-title {
        font-size: 1.6rem;
        margin-bottom: 0.4rem;
    }

    .gallery-section .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }
    
    .gallery-swiper {
        padding-bottom: 10px;
    }
    
    .gallery-swiper .swiper-slide {
        padding: 0 6px;
        align-items: center;
    }
    
    .gallery-card {
    height: 210px;
    }
    
    .gallery-content {
        padding: 0.8rem;
    }
    
    .gallery-content h5 {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }
    
    .gallery-content p {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .gallery-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .gallery-button-prev { left: 8px; right: auto; }
    .gallery-button-next { right: 8px; left: auto; }
    .gallery-button-next,
    .gallery-button-prev {
        width: 44px; /* maintain >=44px touch area */
        height: 44px;
        top: 50% !important;
        transform: translateY(-50%);
        z-index: 6;
        touch-action: pan-y; /* keep horizontal swipe responsive */
    }
    
    .gallery-button-next:hover,
    .gallery-button-prev:hover {
        transform: translateY(-50%) scale(1.1);
    }
    
    .gallery-button-next::after,
    .gallery-button-prev::after {
        font-size: 12px;
    }
}

/* Gallery Modal Styles */
.gallery-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Modal Dialog Responsive Sizes */
@media (max-width: 992px) {
    .modal-xl {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .modal-dialog-centered {
        min-height: calc(100vh - 2rem);
    }
}

@media (max-width: 576px) {
    .modal-xl {
        max-width: 98%;
        margin: 0.5rem auto;
    }
    
    .modal-dialog-centered {
        min-height: calc(100vh - 1rem);
    }
    
    .gallery-modal-content {
        border-radius: 15px;
    }
}

/* Custom wider modal */
@media (min-width: 1200px) {
    #galleryModal .modal-dialog {
        max-width: 1200px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    #galleryModal .modal-dialog {
        max-width: 900px;
    }
}

.gallery-modal-close-top {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1060;
    background: rgba(44, 62, 80, 0.9) !important;
    color: white !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1 !important;
}

.gallery-modal-close-top::before {
    content: "×";
    font-size: 24px;
    line-height: 1;
    color: white;
}

.gallery-modal-close-top:hover {
    background: rgba(231, 76, 60, 0.9) !important;
    color: white !important;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
    border-color: white !important;
}

.gallery-modal-close-top:hover::before {
    color: white;
}

.gallery-modal-close-top:focus {
    box-shadow: 0 0 0 0.25rem rgba(231, 76, 60, 0.5);
    outline: none;
    background: rgba(44, 62, 80, 0.9) !important;
    color: white !important;
}

.gallery-modal-close-top:focus::before {
    color: white;
}

.gallery-modal-body {
    padding: 2rem;
    background: #f8f9fa;
}

.gallery-modal-image-container {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.gallery-modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    max-height: 400px;
}

.gallery-modal-info {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.gallery-modal-info-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.gallery-modal-info-description {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.gallery-modal-details h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.gallery-modal-features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.gallery-modal-features-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
    color: #333;
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.gallery-modal-features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.gallery-modal-features-list li:last-child {
    border-bottom: none;
}

.gallery-modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-modal-btn {
    flex: 1;
    min-width: 180px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
}

.gallery-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.3);
}

/* Modal Responsive Styles */
@media (max-width: 992px) {
    .gallery-modal-body {
        padding: 1.5rem;
    }
    
    .gallery-modal-image-container {
        margin-bottom: 1.5rem;
    }
    
    .gallery-modal-image {
        max-height: 300px;
    }
    
    .gallery-modal-info {
        padding: 1.5rem;
        margin-top: 0;
    }
    
    .gallery-modal-info-title {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }
    
    .gallery-modal-info-description {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 768px) {
    .gallery-modal-body {
        padding: 1.5rem;
    }
    
    .gallery-modal-close-top {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .gallery-modal-image-container {
        margin-bottom: 1.5rem;
        padding: 0.8rem;
    }
    
    .gallery-modal-image {
        max-height: 250px;
    }
    
    .gallery-modal-info {
        padding: 1.25rem;
        margin-top: 0;
    }
    
    .gallery-modal-info-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .gallery-modal-info-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .gallery-modal-details h6 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    .gallery-modal-features-list li {
        font-size: 0.85rem;
        padding: 0.3rem 0;
    }
    
    .gallery-modal-btn {
        min-width: auto;
        width: 100%;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .gallery-modal-body {
        padding: 1rem;
    }
    
    .gallery-modal-close-top {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .gallery-modal-image-container {
        margin-bottom: 1rem;
        padding: 0.5rem;
    }
    
    .gallery-modal-image {
        max-height: 200px;
    }
    
    .gallery-modal-info {
        padding: 1rem;
        margin-top: 0;
    }
    
    .gallery-modal-info-title {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }
    
    .gallery-modal-info-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
    
    .gallery-modal-details h6 {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }
    
    .gallery-modal-features-list {
        margin-bottom: 1rem;
    }
    
    .gallery-modal-features-list li {
        font-size: 0.8rem;
        padding: 0.25rem 0;
        padding-left: 1.2rem;
    }
    
    .gallery-modal-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-height: 44px; /* Ensure touch-friendly button size */
    }
    
    .gallery-modal-actions {
        gap: 0.5rem;
    }
}
}