/* Gallery Page Styles */
:root {
    --primary-color: #0F1B2D;
    --secondary-color: #11C76F;
    --accent-color: #FF7A45;
    --line-color: #00C300;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
}

/* Gallery Hero */
.gallery-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Section */
.filter-section {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-light);
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-left {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.filter-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--secondary-color);
}

.search-box input {
    padding: 0.5rem 1rem;
    border: none;
    outline: none;
    min-width: 200px;
    font-size: 0.95rem;
}

.search-box button {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background: #0ea860;
}

.view-toggle {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    background: white;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--secondary-color);
    color: white;
}

.view-btn:hover:not(.active) {
    background: var(--light-bg);
}

/* Gallery Main */
.gallery-main {
    padding: 2rem 0 4rem;
    background: var(--light-bg);
}

.gallery-stats {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-count {
    color: #666;
    font-size: 0.95rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    transition: all 0.3s ease;
}

.gallery-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.gallery-grid.list-view .gallery-item {
    display: flex;
    align-items: stretch;
}

.gallery-grid.list-view .gallery-item:hover {
    transform: none;
    box-shadow: var(--shadow-light);
}

/* Quick View Button */
.quick-view-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.gallery-item:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.quick-view-btn i {
    font-size: 12px;
}

.quick-view-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Quick View Modal */
.quick-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.quick-view-content {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    z-index: 2;
}

.quick-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.quick-view-image {
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.main-image-container {
    width: 100%;
    min-height: 300px;
    aspect-ratio: 1/1;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.3s ease-in-out;
    display: block;
}

.thumbnail-container {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
    margin: 0 -5px;
    padding: 5px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail:hover {
    border-color: #3498db;
}

.thumbnail.active {
    border-color: #e74c3c;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.quick-view-info {
    padding: 10px 0;
}

.quick-view-info h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: #333;
}

.quick-view-category {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: #555;
}

.quick-view-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0 15px;
}

.quick-view-highlights {
    margin: 20px 0;
}

.quick-view-highlights h4 {
    margin: 0 0 10px;
    color: #333;
    font-size: 1.1rem;
}

.quick-view-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-view-highlights li {
    padding: 5px 0 5px 20px;
    position: relative;
    color: #555;
}

.quick-view-highlights li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
}

.quick-view-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-view-details, .btn-line {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-view-details {
    background: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

.btn-view-details:hover {
    background: #2980b9;
}

.btn-line {
    background: #06c755;
    color: white;
    border: 1px solid #05a548;
}

.btn-line:hover {
    background: #05a548;
}

/* Loading State */
.quick-view-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.quick-view-loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #3498db;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .quick-view-grid {
        grid-template-columns: 1fr;
        padding: 20px 15px;
    }
    
    .quick-view-image {
        max-height: 300px;
    }
}

/* Item Image */
.item-image {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--light-bg);
}

.gallery-grid.list-view .item-image {
    flex: 0 0 300px;
    aspect-ratio: unset;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .item-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    background: #f0f0f0;
}

.no-image i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Badges */
.image-count-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Item Overlay */
.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.overlay-buttons {
    display: flex;
    gap: 1rem;
}

.btn-view,
.btn-quick-view {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-view:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-quick-view:hover {
    background: var(--accent-color);
    color: white;
}

/* Item Content */
.item-content {
    padding: 1.5rem;
}

.gallery-grid.list-view .item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-title {
    margin-bottom: 0.75rem;
}

.item-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.item-title a:hover {
    color: var(--secondary-color);
}

.item-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-grid.list-view .item-excerpt {
    -webkit-line-clamp: 2;
}

.item-price {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.price-label {
    color: #666;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.price-value {
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 0.75rem;
}

.gallery-grid.list-view .item-actions {
    margin-top: auto;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #27ae60 100%);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 199, 111, 0.3);
}

.btn-line {
    background: var(--line-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-line:hover {
    background: #00B300;
    transform: translateY(-2px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.no-results p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn-reset {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #0ea860;
    transform: translateY(-2px);
}

/* Quick View Modal */
.quick-view-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.quick-view-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.quick-view-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.quick-view-body {
    padding: 2rem;
}

/* CTA Section */
.gallery-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-line,
.btn-cta-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cta-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-cta-primary:hover {
    background: #0ea860;
    transform: translateY(-3px);
}

.btn-cta-line {
    background: var(--line-color);
    color: white;
}

.btn-cta-line:hover {
    background: #00B300;
    transform: translateY(-3px);
}

.btn-cta-phone {
    background: var(--accent-color);
    color: white;
}

.btn-cta-phone:hover {
    background: #e67e22;
    transform: translateY(-3px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 15px;
    position: relative;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #999;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    background: rgba(255,255,255,0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--accent-color);
    background: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-left {
        justify-content: center;
    }
    
    .filter-right {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-grid.list-view .gallery-item {
        flex-direction: column;
    }
    
    .gallery-grid.list-view .item-image {
        flex: none;
        aspect-ratio: 1/1;
    }
    
    .filter-left {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        min-width: unset;
        width: 100%;
    }
    
    .search-box input {
        min-width: unset;
        width: 200px;
    }
    
    .overlay-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-view,
    .btn-quick-view {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-cta-primary,
    .btn-cta-line,
    .btn-cta-phone {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .item-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-line {
        min-width: unset;
        width: 100%;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .filter-section {
        position: static;
    }
}
