/* Gallery page — Montserrat, white theme, square cropped tiles */

:root {
    --bg-white: #ffffff;
    --text-dark: #111111;
    --text-muted: #6b6b6b;
    --border: #ebebeb;
    --radius-xl: 28px;
    --radius-pill: 50px;
    --font: 'Montserrat', sans-serif;
    --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.1);
}

body.page-gallery {
    overflow-x: hidden;
    background: #ffffff;
    font-family: var(--font);
}

.filter-heading {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.gallery-section {
    padding: 3rem 0 5rem;
    background: #ffffff;
}

.gallery-controls {
    text-align: center;
    margin-bottom: 2.5rem;
}

.gallery-controls:not(:has(.search-box)) {
    margin-bottom: 2rem;
}

.gallery-controls:not(:has(.search-box)) .filter-pills {
    margin-top: 0;
}

.search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto 1.25rem;
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: #ffffff;
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--text-dark);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.05);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.filter-pill {
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: #ffffff;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--primary-color, var(--text-dark));
    color: #fff;
    border-color: var(--primary-color, var(--text-dark));
}

/* Uniform square gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.gallery-section .gallery-card {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.gallery-section .gallery-card:hover {
    transform: none;
    box-shadow: none;
}

.gallery-section .gallery-card .card-image-frame {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    min-height: 0;
    background: #f3f3f3;
    border: none;
    border-bottom: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    padding: 0;
}

.gallery-section .gallery-card .image-frame-inner {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    display: block;
}

.gallery-section .gallery-card .card-image-frame img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 0;
}

.gallery-section .gallery-card:hover .card-image-frame img {
    transform: scale(1.04);
}

.gallery-section .gallery-card .card-body-content {
    padding: 0.85rem 0 0;
    background: transparent;
    border: none;
}

.gallery-card {
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    transition: opacity var(--transition);
    animation: fadeUp 0.5s ease backwards;
    display: flex;
    flex-direction: column;
}

.gallery-card--zoom .card-image-frame {
    cursor: zoom-in;
}

.gallery-card--zoom .image-frame-inner {
    position: relative;
}

.gallery-zoom-hint {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-color, var(--text-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.gallery-card--zoom:hover .gallery-zoom-hint {
    opacity: 1;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-family: var(--font);
}

.gallery-empty i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }

.gallery-loader { text-align: center; padding: 2rem; }

.load-more-wrap { text-align: center; margin-top: 2.5rem; }

.btn-load-more {
    padding: 0.8rem 2rem;
    background: var(--primary-color, var(--text-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* Product modal */
.product-modal .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #ffffff;
    font-family: var(--font);
}

.product-modal .modal-dialog { max-width: 960px; }

.btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.modal-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 460px;
}

.modal-gallery {
    position: relative;
    background: #ffffff;
    border-right: 1px solid var(--border);
}

.modal-slider {
    position: relative;
    height: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.modal-slide {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 380px;
}

.modal-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #ffffff;
}

.modal-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}

.modal-slide img:hover { transform: scale(1.03); }

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }

.modal-info {
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--font);
    background: #ffffff;
}

.modal-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.modal-desc {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.65;
    font-size: 0.9rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform var(--transition);
    align-self: flex-start;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    color: #fff;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: min(92vw, calc(100% - 8rem));
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    position: relative;
    z-index: 1;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform var(--transition), box-shadow var(--transition);
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-soft);
}

.lightbox-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

@media (max-width: 991px) {
    .modal-product { grid-template-columns: 1fr; }
    .modal-gallery { border-right: none; border-bottom: 1px solid var(--border); }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .modal-info { padding: 1.5rem; }
    .modal-title { font-size: 1.35rem; }
    .modal-slide,
    .modal-slider { min-height: 280px; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}
