/* /gallery.css (Definitive, Robust Version) */

/* Using variables from styles.css for consistency */
:root {
    --primary-color: #A98A5A;
    --secondary-color: #2c2c2c;
    --text-color: #4a4a4a;
    --background-color: #f9f9f9;
    --white-color: #ffffff;
    --border-color: #e0e0e0;
}

/* --- HEADER STYLES --- */
/* Makes the header transparent initially when this class is on the body */
.header-transparent-on-load header {
    background-color: transparent;
    box-shadow: none;
    /* border-bottom removed to fix the line issue */
}

/* This is the solid brown background that appears on scroll */
.header-transparent-on-load header.scrolled {
    background-color: #3a2d20; /* The dark brown from your shop page */
    border-bottom-color: transparent;
}


/* --- HERO SECTION STYLES --- */
/* Final, corrected hero styling to match shop page */
body.page-collections .shop-style-hero {
    position: relative;
    padding: 120px 20px 80px;  /* REDUCED PADDING to match shop hero */
    text-align: center;
    background-color: #3a2d20; /* The dark brown color */
    overflow: hidden;
}

body.page-collections .shop-style-hero .hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

body.page-collections .shop-style-hero .collections-hero-content {
    position: relative;
    z-index: 2;
}

/* Specific text styling to match shop page hero */
body.page-collections .shop-style-hero .collections-hero-content h1 {
    color: white !important;
    font-size: 2.8rem; /* ADJUSTED FONT SIZE */
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.75rem;
}

body.page-collections .shop-style-hero .collections-hero-content p {
    color: white !important;
    font-size: 1.1rem; /* ADJUSTED FONT SIZE */
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    max-width: 650px; /* Constrain width of the paragraph */
    margin-left: auto;
    margin-right: auto;
}


/* --- CONTROLS AND FILTER STYLES --- */
.gallery-controls-section {
    padding: 20px;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}
.controls-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.filter-toggle-btn {
    display: none; /* Hidden on desktop */
    padding: 10px 15px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Raleway', sans-serif;
}
.filter-toggle-btn i {
    margin-right: 8px;
}
.results-sort-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    justify-content: flex-end;
}
.product-count {
    font-family: 'Raleway', sans-serif;
    color: var(--text-color);
    white-space: nowrap;
}
#search-gallery-input {
    width: 250px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Raleway', sans-serif;
}
.sort-control select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Raleway', sans-serif;
}

.gallery-grid-section {
    padding: 40px 20px;
}
.shop-layout-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
}
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    align-self: flex-start;
    background-color: var(--white-color);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.sidebar-header h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
}
.close-filters-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}
.filter-group {
    margin-bottom: 25px;
}
.filter-group h4 {
    margin: 0 0 15px;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
}
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.filter-list li {
    margin-bottom: 8px;
    font-family: 'Raleway', sans-serif;
}
.filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.filter-list input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--primary-color);
}
.apply-filters-btn {
    display: none; /* Hidden on desktop */
}
.clear-filters-btn, .apply-filters-btn {
    width: 100%;
    margin-top: 10px;
}
.product-grid-main-area {
    flex-grow: 1;
}

/* Dynamic Gallery Grid */
.gallery-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default 3 columns in this layout */
    gap: 30px;
}

/* Gallery Product Card */
.gallery-product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}
.gallery-product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); }
.gallery-product-card.selected { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(169, 138, 90, 0.5); }
.card-image-wrapper { position: relative; padding-top: 100%; }
.card-image-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-product-card:hover .card-image-wrapper img { transform: scale(1.05); }
.selected-indicator { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background-color: var(--primary-color); color: var(--white-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; z-index: 3; transform: scale(0); transition: transform 0.2s ease-out; }
.gallery-product-card.selected .selected-indicator { transform: scale(1); }
.card-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-info h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; margin: 0 0 10px; color: var(--secondary-color); }
.card-info .product-description { font-family: 'Raleway', sans-serif; font-size: 0.9rem; color: var(--text-color); margin-bottom: 15px; flex-grow: 1; min-height: 54px; }
.card-info .product-price { font-family: 'Raleway', sans-serif; font-weight: 600; font-size: 1.1rem; color: var(--primary-color); margin-bottom: 15px; }
.btn-select-inquiry { width: 100%; padding: 10px; background-color: var(--secondary-color); color: var(--white-color); border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.3s ease; font-family: 'Raleway', sans-serif; font-weight: 600; margin-top: auto; }
.btn-select-inquiry:hover { background-color: var(--primary-color); }
.gallery-product-card.selected .btn-select-inquiry { background-color: #d9534f; }
.gallery-product-card.selected .btn-select-inquiry:hover { background-color: #c9302c; }


/* Loading/Error States */
.loading-status, .error-status, .no-products-message { text-align: center; padding: 40px; font-size: 1.2rem; color: var(--text-color); grid-column: 1 / -1; }

/* Inquiry Sidebar Styles */
.inquiry-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90%;
    height: 100%;
    background: var(--white-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.inquiry-sidebar.active { transform: translateX(0); }
.inquiry-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.inquiry-header h3 { font-family: 'Playfair Display', serif; margin: 0; }
.inquiry-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-color); }
.inquiry-body { flex-grow: 1; overflow-y: auto; padding: 10px 20px; }
.inquiry-empty-message { text-align: center; color: #888; margin-top: 40px; }
.inquiry-item { display: flex; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--background-color); align-items: center; }
.inquiry-item:last-child { border-bottom: none; }
.inquiry-item-image { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.inquiry-item-details { flex-grow: 1; }
.inquiry-item-name { font-weight: 600; margin: 0; font-family: 'Raleway', sans-serif; }
.inquiry-item-remove { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1.2rem; transition: color 0.2s; padding: 5px; }
.inquiry-item-remove:hover { color: #d9534f; }
.inquiry-footer { padding: 20px; border-top: 1px solid var(--border-color); background: var(--background-color); }
.inquiry-footer p { font-size: 0.9rem; text-align: center; margin: 0 0 15px; color: var(--text-color); }
.inquiry-actions { display: flex; flex-direction: column; gap: 10px; }
.inquiry-btn { display: block; text-align: center; padding: 12px; border-radius: 4px; text-decoration: none; color: var(--white-color); font-weight: 600; transition: opacity 0.3s, background-color 0.3s; font-family: 'Raleway', sans-serif; }
.inquiry-btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.inquiry-btn i { margin-right: 8px; }
.inquiry-btn.whatsapp { background-color: #25D366; }
.inquiry-btn.whatsapp:hover { background-color: #1DA851; }
.inquiry-btn.sms { background-color: #4A90E2; }
.inquiry-btn.sms:hover { background-color: #357ABD; }
.inquiry-btn.email { background-color: #555; }
.inquiry-btn.email:hover { background-color: #333; }
.inquiry-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}
.inquiry-overlay.active { opacity: 1; visibility: visible; }

/* Floating Inquiry Button */
.inquiry-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    gap: 10px;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    transition: transform 0.3s ease, background-color 0.3s;
}
.inquiry-toggle-btn:hover {
    transform: scale(1.05);
    background-color: #8e6e44;
}
.inquiry-toggle-btn .inquiry-toggle-text {
    display: block;
}
.inquiry-toggle-btn i {
    font-size: 1.2rem;
}
.inquiry-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #d9534f;
    color: var(--white-color);
    border-radius: 50%;
    min-width: 26px;
    height: 26px;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white-color);
}

/* Helper classes for primary/secondary buttons */
.btn-primary { background-color: var(--primary-color); color: var(--white-color); padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-family: 'Raleway', sans-serif; font-weight: 600; text-align: center; transition: background-color 0.3s; }
.btn-primary:hover { background-color: #8e6e44; }
.btn-secondary { background-color: transparent; color: var(--secondary-color); padding: 10px 20px; border: 1px solid var(--secondary-color); border-radius: 4px; cursor: pointer; font-family: 'Raleway', sans-serif; font-weight: 600; text-align: center; transition: background-color 0.3s, color 0.3s; }
.btn-secondary:hover { background-color: var(--secondary-color); color: var(--white-color); }


/* Responsive Adjustments */
@media (max-width: 992px) {
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1055;
        overflow-y: auto;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .filters-sidebar.active {
        transform: translateX(0);
    }
    body.filters-sidebar-active {
        overflow: hidden;
    }
    .filter-toggle-btn, .close-filters-btn, .apply-filters-btn {
        display: block;
    }
    .gallery-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .controls-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .results-sort-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    #search-gallery-input {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .gallery-grid-container {
        grid-template-columns: 1fr;
    }
}
/* --- ANIMATIONS & KEYFRAMES --- */
.animated {
    opacity: 0;
    visibility: hidden; /* Start hidden to prevent flash of unstyled content */
}

.visible {
    visibility: visible; /* Make visible when animation starts */
}

.visible.fadeInUp {
    animation: fadeInUp 0.8s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

.visible.fadeInLeft {
    animation: fadeInLeft 1s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

.visible.fadeInRight {
    animation: fadeInRight 1s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Delay classes if you want to stagger animations */
.delay-1 { animation-delay: 0.3s !important; }
.delay-2 { animation-delay: 0.6s !important; }
.delay-3 { animation-delay: 0.9s !important; }


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}