/**
 * ProTech Solutions - Project & Equipment Showcase Gallery Stylesheet
 * Responsive grid, category filtering, CAD blueprint watermarks, and Lightbox modal.
 */

/* ==========================================================================
   1. Canvas & Hero Showcase Section
   ========================================================================== */

.gallery-page-main {
    position: relative;
    background: #ffffff;
    min-height: 100vh;
}

.gallery-hero-section {
    position: relative;
    padding: 70px 24px 44px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Background Technical CAD Blueprint Canvas */
.gallery-bg-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.gallery-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
}

.gallery-bg-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(248, 206, 36, 0.14) 1.5px, transparent 1.5px);
    background-size: 72px 72px;
    background-position: 18px 18px;
}

.gallery-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.glow-top-left {
    width: 440px;
    height: 440px;
    background: rgba(248, 206, 36, 0.13);
    top: -120px;
    left: -100px;
}

.glow-top-right {
    width: 400px;
    height: 400px;
    background: rgba(30, 41, 59, 0.08);
    top: -80px;
    right: -80px;
}

.gallery-watermark {
    position: absolute;
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
}

.watermark-left {
    top: 50%;
    left: -140px;
    transform: translateY(-50%);
}

.watermark-right {
    top: 50%;
    right: -160px;
    transform: translateY(-50%);
}

/* Hero Content */
.gallery-hero-container {
    position: relative;
    z-index: 2;
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
}

.gallery-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(248, 206, 36, 0.14);
    border: 1px solid rgba(171, 135, 0, 0.34);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: #876a00;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.badge-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f8ce24;
    box-shadow: 0 0 0 3px rgba(248, 206, 36, 0.28);
    animation: galleryDotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes galleryDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.gallery-hero-title {
    font-size: clamp(30px, 4.6vw, 46px);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin: 0 0 16px;
}

.gallery-hero-title span {
    background: linear-gradient(135deg, #ab8700 0%, #876a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-hero-desc {
    font-size: 16.5px;
    line-height: 1.65;
    color: #475569;
    max-width: 780px;
    margin: 0 auto 30px;
}

/* Trust & Stats Ribbon */
.gallery-trust-ribbon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ribbon-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.ribbon-pill svg {
    color: #876a00;
    flex-shrink: 0;
}

/* ==========================================================================
   2. Category Filter Navigation Bar
   ========================================================================== */

.gallery-filter-section {
    position: sticky;
    top: 72px; /* just below main header */
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.gallery-filter-container {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

.gallery-filter-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 4px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE & Edge */
    cursor: grab;
    user-select: none;
}

.gallery-filter-tabs:active {
    cursor: grabbing;
}

.gallery-filter-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.gallery-filter-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.22s ease;
}

.gallery-filter-btn svg {
    color: #64748b;
    transition: color 0.2s ease;
}

.gallery-filter-btn .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
    transition: all 0.2s ease;
}

.gallery-filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.gallery-filter-btn.active {
    background: #f8ce24;
    color: #151618;
    border-color: #f8ce24;
    box-shadow: 0 4px 12px rgba(248, 206, 36, 0.28);
}

.gallery-filter-btn.active svg {
    color: #151618;
}

.gallery-filter-btn.active .filter-count {
    background: rgba(21, 22, 24, 0.14);
    color: #151618;
}

.gallery-counter-status {
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.gallery-counter-status strong {
    color: #0f172a;
}

/* ==========================================================================
   3. Gallery Grid & Cards
   ========================================================================== */

.gallery-content-section {
    padding: 48px 24px 80px;
    max-width: 1240px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    transition: opacity 0.25s ease;
}

.gallery-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.gallery-card.hidden {
    display: none !important;
}

/* Card Thumbnail Frame */
.gallery-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0f172a;
}

.gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Top Floating Pill Badge */
.gallery-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    padding: 5px 12px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Top Floating Zoom Button */
.gallery-card-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.22s ease;
}

.gallery-card:hover .gallery-card-zoom-btn {
    background: #f8ce24;
    color: #151618;
    transform: scale(1.08);
}

/* Card Body Content */
.gallery-card-content {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-card-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #876a00;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.gallery-card-cat svg {
    color: #876a00;
}

.gallery-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 10px;
    transition: color 0.2s ease;
}

.gallery-card:hover .gallery-card-title {
    color: #876a00;
}

.gallery-card-desc {
    font-size: 14px;
    line-height: 1.55;
    color: #64748b;
    margin: 0 0 18px;
    flex-grow: 1;
}

/* Highlights Grid */
.gallery-card-highlights {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.card-highlight-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.card-hl-key {
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}

.card-hl-val {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

/* Card Action Footer */
.gallery-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13.5px;
    font-weight: 700;
    color: #876a00;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.gallery-card:hover .gallery-card-action span {
    text-decoration: underline;
}

.gallery-card-action svg {
    transition: transform 0.2s ease;
}

.gallery-card:hover .gallery-card-action svg {
    transform: translateX(4px);
}

/* Empty State when category has no matches */
.gallery-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

.gallery-empty-state h3 {
    font-size: 20px;
    color: #0f172a;
    margin: 0 0 8px;
}

.gallery-empty-state p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   4. Interactive Fullscreen Lightbox Modal
   ========================================================================== */

.gallery-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s ease, visibility 0.26s ease;
    padding: 24px;
}

.gallery-lightbox-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Container Frame */
.lightbox-container {
    position: relative;
    max-width: 1100px;
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    animation: lightboxScaleUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lightboxScaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Header / Close Bar */
.lightbox-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
}

.lightbox-counter-badge span {
    color: #f8ce24;
}

.lightbox-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
    background: #f8ce24;
    color: #151618;
    transform: rotate(90deg);
}

/* Main Visual Viewport Frame */
.lightbox-viewport {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #090d16;
    min-height: 480px;
    max-height: 82vh;
    overflow: hidden;
    user-select: none;
}

.lightbox-main-img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-prev-btn {
    left: 18px;
}

.lightbox-next-btn {
    right: 18px;
}

.lightbox-nav-btn:hover {
    background: #f8ce24;
    border-color: #f8ce24;
    color: #151618;
    transform: translateY(-50%) scale(1.1);
}

/* Lightbox Details Drawer */
.lightbox-details-panel {
    padding: 20px 24px;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.lightbox-text-group {
    flex-grow: 1;
}

.lightbox-category-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(248, 206, 36, 0.16);
    border: 1px solid rgba(248, 206, 36, 0.38);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #f8ce24;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.lightbox-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.3;
}

.lightbox-modal-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0;
    max-width: 680px;
}

.lightbox-actions {
    flex-shrink: 0;
}

.lightbox-inquire-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8ce24;
    color: #151618;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lightbox-inquire-btn:hover {
    background: #e0b60c;
    color: #151618;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(248, 206, 36, 0.4);
}

/* ==========================================================================
   5. Bottom Support / Inquiry CTA Banner
   ========================================================================== */

.gallery-support-section {
    max-width: 1240px;
    margin: 0 auto 80px;
    padding: 0 24px;
}

.gallery-support-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 24px;
    padding: 44px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.support-content {
    max-width: 640px;
}

.support-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8ce24;
    margin-bottom: 12px;
}

.support-title {
    font-size: clamp(22px, 3.2vw, 30px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 12px;
}

.support-desc {
    font-size: 15px;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0;
}

.support-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.btn-gallery-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px;
    background: #25d366;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-gallery-whatsapp:hover {
    background: #1ebe5d;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.btn-gallery-call {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px;
    background: #f8ce24;
    color: #151618;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(248, 206, 36, 0.3);
}

.btn-gallery-call:hover {
    background: #e0b60c;
    color: #151618;
    transform: translateY(-2px);
}

.btn-gallery-inquiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-gallery-inquiry:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   6. Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    .gallery-support-card {
        flex-direction: column;
        text-align: center;
        padding: 36px 28px;
    }

    .support-actions {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .gallery-hero-section {
        padding: 50px 18px 36px;
    }

    .gallery-filter-section {
        top: 60px;
        padding: 12px 16px;
    }

    .gallery-filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .gallery-counter-status {
        text-align: center;
        font-size: 12.5px;
    }

    .gallery-content-section {
        padding: 32px 16px 60px;
    }

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

    .lightbox-modal-title {
        font-size: 17px;
    }

    .lightbox-details-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 18px;
    }

    .lightbox-actions {
        width: 100%;
    }

    .lightbox-inquire-btn {
        width: 100%;
        justify-content: center;
    }

    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev-btn {
        left: 8px;
    }

    .lightbox-next-btn {
        right: 8px;
    }

    .support-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-gallery-whatsapp,
    .btn-gallery-call,
    .btn-gallery-inquiry {
        width: 100%;
        justify-content: center;
    }
}
