/* GALLERY SECTION */
.gallery-section {
    background: #f8f9fa;
    padding: 30px 30px 80px;
    max-width: 100%;
}
.gallery-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}
.gallery-header h2 {
    font-size: 2.5em;
    color: #223366;
    margin-bottom: 20px;
}
.gallery-intro {
    font-size: 1.2em;
    color: #3C434A;
    line-height: 1.6;
}

/* Filter Controls */
.gallery-filters {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 10px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.filter-group-wide {
    flex: 1 1 100%;
    max-width: 100%;
}
.filter-group label {
    font-weight: 600;
    color: #223366;
    font-size: 0.9em;
}

/* Multi-Select Dropdown */
.multiselect-dropdown {
    position: relative;
    width: 100%;
    min-width: 250px;
}
.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    user-select: none;
}
.multiselect-trigger:hover {
    border-color: #ec5737;
}
.multiselect-trigger.active {
    border-color: #ec5737;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.dropdown-arrow {
    font-size: 0.8em;
    transition: transform 0.2s;
}
.multiselect-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}
.multiselect-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ec5737;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.multiselect-content.show {
    display: block;
}
.multiselect-search {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}
.multiselect-search input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9em;
    outline: none;
}
.multiselect-search input:focus {
    border-color: #ec5737;
}
.multiselect-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 5px 0;
}
.multiselect-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}
.multiselect-option:hover {
    background: #f8f9fa;
}
.multiselect-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #ec5737;
}
.multiselect-option.hidden {
    display: none;
}
#model-display {
    color: #3C434A;
    font-size: 1em;
}

.filter-dropdown {
    padding: 10px 15px;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px;
    font-size: 1em;
    color: #3C434A;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 180px;
    height: auto;
}
.filter-dropdown:hover,
.filter-dropdown:focus {
    border-color: #ec5737 !important;
    outline: none;
}
.filter-reset {
    background: #e8eaed;
    color: #3C434A;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    align-self: center;
}
.filter-reset:hover {
    background: #d1d4d8;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 40px;
}
.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 51, 102, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
.page-count {
    background: #ec5737;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}
.view-btn, .delete-btn {
    background: white;
    color: #223366;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.view-btn:hover, .delete-btn:hover {
    background: #ec5737;
    color: white;
}
.gallery-info {
    padding: 12px 15px;
    background: white;
}
.gallery-info h4 {
    font-size: 1em;
    color: #223366;
    margin: 0 0 5px 0;
}
.gallery-info p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Load More Section */
.gallery-load-more {
    text-align: center;
    margin: 40px auto 30px;
    max-width: 600px;
}
.results-counter {
    font-size: 1.1em;
    color: #3C434A;
    margin-bottom: 20px;
    font-weight: 500;
}
.results-counter span {
    color: #223366;
    font-weight: 700;
}
.btn-load-more {
    background: white;
    color: #223366;
    border: 2px solid #223366;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-load-more:hover {
    background: #223366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 51, 102, 0.3);
}
.btn-load-more i {
    font-size: 1.1em;
}
.loading-spinner {
    color: #ec5737;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 20px;
}
.loading-spinner i {
    margin-right: 8px;
}

.gallery-footer {
    text-align: center;
    margin-top: 40px;
}
.gallery-footer p {
    font-size: 1.1em;
    color: #3C434A;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* FILTER MESSAGES */
.filter-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaf0 100%);
    border: 2px solid #ec5737;
    border-radius: 12px;
    padding: 40px;
    margin: 30px auto;
    max-width: 700px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(236, 87, 55, 0.1);
}
.message-icon {
    font-size: 3em;
    margin-bottom: 15px;
}
.filter-message h3 {
    color: #223366;
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
}
.filter-message p {
    font-size: 1.1em;
    color: #3C434A;
    margin-bottom: 20px;
}
.message-suggestions {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}
.message-suggestions p {
    font-weight: 600;
    color: #223366;
    margin-bottom: 10px;
}
.message-suggestions ul {
    list-style: none;
    padding-left: 0;
}
.message-suggestions li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #3C434A;
    line-height: 1.6;
}
.message-suggestions li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #ec5737;
    font-weight: bold;
}

/* MODAL */
#quoteModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#quoteModal .modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
#quoteModal .modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: #666;
}
#quoteModal .modal-close:hover {
    color: #ec5737;
}
#quoteModal .modal-content h2 {
    color: #223366;
    margin-bottom: 15px;
}
#quoteModal .modal-content p {
    color: #3C434A;
    margin-bottom: 25px;
}
.quote-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.quote-form input,
.quote-form textarea {
    padding: 14px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}
.quote-form input:focus,
.quote-form textarea:focus {
    outline: none;
    border-color: #223366;
}
.file-upload {
    padding: 14px;
    border: 2px dashed #E5E7EB;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.file-upload:hover {
    border-color: #223366;
    background: #f8f9fa;
}
.file-upload input {
    display: none;
}

/* DESIGN LIGHTBOX */
.design-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 30100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox-content {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 20px 30px;
}
.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 36px;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: color 0.3s;
}
.lightbox-close:hover {
    color: #ec5737;
}
.lightbox-header {
    text-align: center;
    margin-bottom: 15px;
}
.lightbox-header h2 {
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 5px;
}
.lightbox-header p {
    color: #aaa;
    font-size: 0.95em;
}

/* Lightbox Viewer */
.lightbox-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.lightbox-image-container {
    position: relative;
    max-width: 600px;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.lightbox-image-container img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 600px;
    object-fit: contain;
}
.page-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    font-weight: bold;
}
.lightbox-nav:hover {
    background: rgba(236, 87, 55, 0.9);
    border-color: #ec5737;
    transform: translateY(-50%) scale(1.1);
}
.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.lightbox-nav:disabled:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%);
}
.lightbox-nav.prev {
    left: 5px;
}
.lightbox-nav.next {
    right: 5px;
}

/* Thumbnail Strip */
.lightbox-thumbnails {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.lightbox-thumbnails .thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    opacity: 0.6;
}
.lightbox-thumbnails .thumb:hover {
    opacity: 1;
    border-color: #ec5737;
}
.lightbox-thumbnails .thumb.active {
    opacity: 1;
    border-color: #ec5737;
    box-shadow: 0 0 15px rgba(236, 87, 55, 0.5);
}

.bb-btn-primary {
    background: #ec5737;
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(236, 87, 55, 0.3);
    display: inline-block;
    width: auto;
}
.bb-btn-primary:hover {
    background: #d64627;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(236, 87, 55, 0.4);
}

/* Lightbox CTA */
.lightbox-cta {
    text-align: center;
    padding: 20px 20px 10px;
}
.btn-large {
    padding: 16px 45px;
    font-size: 1.05em;
}
.btn-large i {
    margin-right: 10px;
}
.lightbox-cta-text {
    color: #ccc;
    margin-top: 12px;
    font-size: 0.9em;
}

.gallery-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
    gap: 20px;
    padding: 0;
    z-index: 10;
}

/* Hide when inactive */
.gallery-skeleton:not(.active) {
    display: none !important;
}
.gallery-skeleton.active {
    display: grid !important;
}

/* --- INDIVIDUAL SKELETON CARDS --- */
.skeleton-card {
    height: 250px;
    border-radius: 8px;
    background: #e6e6e6;
    position: relative;
    overflow: hidden;
}

/* --- SHIMMER EFFECT --- */
.skeleton-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150px;
    width: 150px;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.6) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0% { left: -150px; }
    100% { left: 100%; }
}

/* Make gallery-section relative so absolute overlay works */
.gallery-section,
.gallery-grid {
    position: relative;
}

#gform_submit_button_39{
    width: 100%;
}

.has-image {
    max-width: 130px;
    text-align: center;
}

.noresult_msg {
    text-align: center;
    padding-bottom: 15px;
    font-size: 18px;
    color: #223366;
    font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 968px) {
    .has-image {
        max-width: 100%;
    }
    .gallery-section {
        padding: 40px 15px;
    }
    .stat-blocks {
        grid-template-columns: 1fr;
    }
    .image-compare {
        grid-template-columns: 1fr;
    }
    .parts-content-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .product-grid {
        grid-template-columns: 1fr 1fr;
    }
    .model-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .model-grid {
        grid-template-columns: 1fr 1fr;
    }
    .model-slider-track img {
        height: 250px;
    }
    .tabs {
        flex-direction: column;
    }
    .tab-button {
        border-radius: 6px;
    }
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-dropdown {
        min-width: 100%;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    .gallery-footer p {
        flex-direction: column;
    }
    .narrative-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .narrative-slider-track img {
        height: 300px;
    }
    .lightbox-nav.prev {
        left: 10px;
    }
    .lightbox-nav.next {
        right: 10px;
    }
    .lightbox-thumbnails .thumb {
        width: 80px;
        height: 60px;
    }
    .lightbox-content {
        padding: 20px 10px;
    }
    .btn-large {
        padding: 14px 30px;
        font-size: 1em;
    }
    .filter-group {
        max-width: 100%;
    }
    .multiselect-dropdown {
        min-width: auto;
        max-width: 100%;
    }
    .lightbox-close {
        top: -8px;
        right: 5px;
    }
    .lightbox-header h2 {
        padding-top: 10px;
    }
}

@media (max-width: 1459px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}