/* ===================================== */
/* === SHOP PAGE SPECIFIC STYLES === */
/* ===================================== */

/* --- GENERAL STYLES FOR THIS PAGE'S CONTENT --- */
.container { width: 90%; max-width: 1400px; margin-left: auto; margin-right: auto; }
.content-section { padding: clamp(3rem, 8vw, 4rem) 0; } 
.btn-primary { padding: 12px 30px; background-color: #d5a26f; color: #fff; font-weight: 600; border-radius: 4px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(213, 162, 111, 0.2); display: inline-block; text-align: center; }
.btn-primary:hover { background-color: #b98242; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(213, 162, 111, 0.3); }
.btn-secondary { padding: 10px 25px; background-color: transparent; color: #555; border: 1px solid #ccc; border-radius: 4px; font-weight: 500; transition: all 0.3s ease; display: inline-block; text-align: center; }
.btn-secondary:hover { background-color: #f5f5f5; border-color: #bbb; color: #333; }
.cart-item-count-badge { position: absolute; top: 0px; right: 0px; background-color: #d5a26f; color: white; border-radius: 50%; padding: 0.1em 0.4em; font-size: 0.75rem; font-weight: bold; line-height: 1.1; min-width: 18px; min-height: 18px; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transform: translate(30%, -30%); }

/* --- PAGE-SPECIFIC SECTIONS --- */
body.page-shop { opacity: 0; transition: opacity 0.7s ease-out; }
body.page-shop.loaded { opacity: 1; }

.shop-hero { position: relative; padding-top: 85px; padding-bottom: 4rem; min-height: 35vh; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; background-color: #3a2b26; background-image: linear-gradient(rgba(44, 31, 26, 0.7), rgba(44, 31, 26, 0.7)), url('placeholder-shop-hero.jpg'); background-size: cover; background-position: center 30%; }
.hero-content { position: relative; z-index: 3; }
.hero-content h1 { color: #fff; margin-bottom: 0.5em; text-shadow: 1px 1px 5px rgba(0,0,0,0.3); font-size: clamp(2.5rem, 6vw, 3.0rem); }
.hero-content p { font-size: clamp(1rem, 2.5vw, 1.1rem); color: rgba(255, 255, 255, 0.9); max-width: 600px; margin: 0 auto; font-weight: 300; }

.shop-controls-section { padding: 1.5rem 0; background-color: #fff; border-bottom: 1px solid #eee; position: sticky; top: 65px; z-index: 900; }
.controls-container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filter-toggle-btn { display: none; background-color: #eee; padding: 0.6rem 1rem; border-radius: 4px; font-weight: 500; color: #555; font-size: 0.9rem; gap: 0.5em; align-items: center; border: 1px solid #ddd; }
.filter-toggle-btn i { margin-right: 0.5em; }
.results-sort-wrapper { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; flex-grow: 1; justify-content: flex-end; }
.search-control-shop { display: flex; align-items: center; flex-grow: 1; max-width: 350px; }
#shop-search-input { padding: 0.6rem 0.8rem; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; font-family: 'Raleway', sans-serif; outline: none; width: 100%; }
#shop-search-input:focus { border-color: #d5a26f; box-shadow: 0 0 0 2px rgba(213, 162, 111, 0.1); }
.product-count { font-size: 0.9rem; color: #777; white-space: nowrap; margin-left: auto; }
.sort-control { display: flex; align-items: center; gap: 0.5rem; }
.sort-control label { font-size: 0.9rem; color: #555; font-weight: 500; white-space: nowrap; }
.sort-control select { padding: 0.6rem 2rem 0.6rem 0.8rem; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; background-color: #fff; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23888888'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 1.2em; }
.sort-control select:focus { outline: none; border-color: #d5a26f; box-shadow: 0 0 0 2px rgba(213, 162, 111, 0.1); }

.shop-layout-container { display: flex; gap: 2.5rem; }
.filters-sidebar { flex: 0 0 280px; position: relative; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid #eee; }
.sidebar-header h3 { font-size: 1.3rem; margin: 0; }
.close-filters-btn { display: none; font-size: 1.2rem; color: #888; }
.close-filters-btn:hover { color: #d5a26f; }
.filter-group { margin-bottom: 2rem; }
.filter-group h4 { font-size: 1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f0f0f0; }
.filter-list { display: flex; flex-direction: column; gap: 0.7rem; } 
.filter-list li label { display: flex; align-items: center; font-size: 0.95rem; cursor: pointer; color: #555; }
.filter-list li label input[type="checkbox"] { margin-right: 0.8em; width: 17px; height: 17px; accent-color: #b98242; cursor: pointer; } 
.filter-list li label:hover { color: #23140f; }
.filter-list li.filter-loading { color: #888; font-style: italic; padding: 5px 0; }
.price-range-inputs { display: flex; flex-direction: column; gap: 0.8rem; }
.price-input-group { display: flex; align-items: center; gap: 0.5rem; }
.price-input-group label { font-size: 0.9rem; color: #666; min-width: 35px; }
.price-input-group input[type="number"] { padding: 0.6rem; border: 1px solid #ccc; border-radius: 3px; width: 100%; font-size: 0.9rem; -moz-appearance: textfield; }
.price-input-group input[type="number"]::-webkit-outer-spin-button, .price-input-group input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.apply-filters-btn { display: block; width: 100%; margin-top: 1.5rem; padding: 0.8rem; } 
.clear-filters-btn { width: 100%; margin-top: 0.75rem; }

.product-grid-main-area { flex-grow: 1; width: 100%; }
.loading-status-shop, .error-status-shop { text-align: center; padding: 3rem 1rem; font-size: 1.1em; color: #666; }
.error-status-shop { color: #c0392b; background-color: #fdecea; border: 1px solid #e74c3c; border-radius: 4px; }
.grid-placeholder-initial { text-align: center; padding: 3rem 1rem; color: #888; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.product-grid .no-products-message { grid-column: 1 / -1; text-align: center; padding: 4rem 1rem; color: #777; font-style: italic; font-size: 1.1em; }

.product-item-card { background-color: #ffffff; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; height: 100%; }
.product-item-card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); }
.product-item-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.product-item-image-wrapper { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background-color: #f8f9fa; }
.product-item-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; display: block; }
.product-item-card:hover .product-item-image { transform: scale(1.03); }
.product-item-info { padding: 15px 20px 20px; text-align: center; display: flex; flex-direction: column; flex-grow: 1; }
.product-item-name { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; color: #212529; margin: 0 0 5px 0; line-height: 1.3; }
.product-item-description-placeholder { font-family: 'Raleway', sans-serif; font-size: 0.8rem; color: #6c757d; margin: 0 0 10px 0; min-height: 1em; }
.product-item-price { font-family: 'Raleway', sans-serif; font-size: 1rem; font-weight: 700; color: #212529; margin: 0 0 15px 0; }
.btn-view-product { display: inline-block; align-self: center; padding: 8px 18px; background-color: #ffffff; color: #343a40; border: 1px solid #adb5bd; border-radius: 0.25rem; font-weight: 500; font-size: 0.85rem; text-transform: none; transition: all 0.2s ease; cursor: pointer; margin-top: auto; width: auto; max-width: 180px; }
.btn-view-product:hover { background-color: #e9ecef; border-color: #6c757d; color: #000; }

/* === CORRECTED ANIMATION SECTION === */
.animated {
    opacity: 0;
}
.visible {
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.3, 0.8, 0.2, 1);
    animation-fill-mode: forwards;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
/* === END OF CORRECTION === */


/* --- MEDIA QUERIES --- */
@media (max-width: 992px) {
    .shop-hero { padding-top: 80px; min-height: 30vh; } 
    .controls-container { justify-content: space-between; }
    .results-sort-wrapper { justify-content: flex-end; } 
    .search-control-shop { max-width: 280px; } 
    .shop-layout-container { flex-direction: column; gap: 0; } 
    .filters-sidebar { flex: 0 0 auto; width: 100%; max-height: none; border-right: none; border-bottom: 1px solid #eee; padding: 1.5rem 0; margin-bottom: 2rem; overflow-y: visible; display: none; position: fixed; top: 0; left: 0; height: 100vh; background-color: #fff; z-index: 1200; transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); padding: 2rem; overflow-y: auto; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .filters-sidebar.active { display: block; transform: translateX(0); }
    .sidebar-header { padding-bottom: 1rem; margin-bottom: 1rem; }
    .close-filters-btn { display: block; } 
    .filter-toggle-btn { display: inline-flex; } 
    .product-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
}
@media (max-width: 768px) {
    .shop-hero { padding-top: 70px; min-height: 25vh; } 
    .shop-controls-section { top: 60px; } 
    .controls-container { justify-content: center; } 
    .filter-toggle-btn { flex-grow: 1; justify-content: center; } 
    .results-sort-wrapper { flex-direction: column; align-items: stretch; width: 100%; gap: 0.8rem; } 
    .search-control-shop { max-width: none; } 
    .product-count { text-align: center; margin-left: 0; }
    .sort-control { justify-content: center; }
    .filters-sidebar { width: 90%; max-width: 320px; } 
    .product-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
}
@media (max-width: 480px) {
    .shop-hero { padding-top: 65px; } 
    .shop-controls-section { top: 56px; } 
    .product-grid { grid-template-columns: repeat(2, 1fr); } 
    .filters-sidebar { width: 100%; max-width: none; }
}

/* --- CSS for Availability Tags on Shop Page --- */
.product-item-tags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.product-tag {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-in-stock {
    background-color: #4CAF50; /* A nice green for in stock */
}

.tag-on-demand {
    background-color: #FF9800; /* An orange for on demand */
}

