/**
 * AMG Products Gallery - Styles (self-contained)
 * All Marble Granite palette:  Gold #F3B335  Dark #1d1609  Cream #fbf6ec
 */

.amg-products { --amg-columns: 3; }

/* ===== TYPE TOGGLE ===== */
.amg-products-toggle {
    display: inline-flex;
    background: #fbf6ec;
    border: 1px solid #e2d7bf;
    border-radius: 6px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}
.amg-toggle-btn {
    padding: 0.55rem 1.6rem;
    border: none; background: transparent;
    color: #6b5c3e; font-size: 0.9rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    border-radius: 4px; cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.amg-toggle-btn:hover { color: #1d1609; }
.amg-toggle-btn.active { background: #F3B335; color: #1d1609; box-shadow: 0 1px 3px rgba(29,22,9,0.15); }

/* ===== LAYOUT: sidebar + main ===== */
.amg-products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}
.amg-products-sidebar { position: sticky; top: 1.5rem; }
.amg-filters-toggle { display: none; } /* shown on mobile only */

/* ===== SEARCH ===== */
.amg-products-search { margin-bottom: 1.25rem; }
.amg-search-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #d4c9b0; border-radius: 4px;
    font-size: 0.95rem; font-family: inherit; color: #1d1609; background: #fff;
}
.amg-search-input:focus { outline: none; border-color: #F3B335; box-shadow: 0 0 0 3px rgba(243,179,53,0.2); }

/* ===== FILTERS (sidebar) ===== */
.amg-products-filters {
    display: flex; flex-direction: column; gap: 1.25rem;
    padding: 1.25rem; background: #fbf6ec; border-radius: 6px;
}
.amg-products-filters:empty { display: none; }
.amg-filter-group { display: flex; flex-direction: column; gap: 0.5rem; }
.amg-filter-group label {
    font-weight: 600; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: #1d1609;
}
.amg-filter-buttons { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.amg-filter-btn {
    padding: 0.3rem 0.7rem; border: 1px solid #d4c9b0; border-radius: 3px;
    background: #fff; color: #1d1609; font-size: 0.8rem; cursor: pointer;
    transition: all 0.15s; font-family: inherit; line-height: 1.4;
}
.amg-filter-btn:hover { border-color: #F3B335; color: #b8860b; }
.amg-filter-btn.active { background: #F3B335; border-color: #F3B335; color: #1d1609; font-weight: 600; }

/* ===== COUNT + STATUS ===== */
.amg-products-count {
    font-size: 0.82rem; color: #8a7d66; margin-bottom: 1rem;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.amg-products-status { text-align: center; padding: 1.5rem; color: #8a7d66; font-size: 0.95rem; }
.amg-products-status:empty { display: none; padding: 0; }
.amg-products-error { color: #a3421b; }

/* ===== GRID + CARDS ===== */
.amg-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--amg-columns, 3), 1fr);
    gap: 1.5rem;
}
@media (max-width: 600px) { .amg-products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .amg-products-grid { grid-template-columns: 1fr; } }

.amg-slab-card {
    border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid #e8e0d0;
    transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column;
}
.amg-slab-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29,22,9,0.1); }
.amg-slab-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.amg-slab-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f0ebe0; }
.amg-slab-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.amg-slab-card:hover .amg-slab-image img { transform: scale(1.05); }
.amg-slab-no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b0a48a; font-size: 0.85rem; }
.amg-slab-badge {
    position: absolute; top: 0.5rem; right: 0.5rem; background: #F3B335; color: #1d1609;
    font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 3px;
    line-height: 1.3; text-transform: uppercase; letter-spacing: 0.03em;
}
.amg-slab-badge.amg-badge-inquire { background: rgba(29,22,9,0.75); color: #fbf6ec; }
.amg-slab-info { padding: 1.125rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.amg-slab-name { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem 0; color: #1d1609; line-height: 1.3; }
.amg-slab-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.5rem 0; font-size: 0.78rem; color: #6b5c3e; }
.amg-slab-type { background: #f5f0e6; padding: 0.125rem 0.5rem; border-radius: 3px; }
.amg-slab-size { margin: 0 0 0.75rem 0; font-size: 0.8rem; color: #8a7d66; }
.amg-slab-more { margin-top: auto; font-size: 0.85rem; font-weight: 600; color: #F3B335; letter-spacing: 0.02em; }
.amg-slab-card:hover .amg-slab-more { color: #b8860b; }

/* ===== PAGINATION ===== */
.amg-products-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem;
    margin-top: 2.5rem;
}
.amg-products-pagination:empty { display: none; }
.amg-page-btn {
    min-width: 2.25rem; padding: 0.45rem 0.7rem;
    border: 1px solid #d4c9b0; border-radius: 4px; background: #fff;
    color: #1d1609; font-size: 0.85rem; font-family: inherit; cursor: pointer;
    transition: all 0.15s;
}
.amg-page-btn:hover:not(:disabled):not(.active) { border-color: #F3B335; color: #b8860b; }
.amg-page-btn.active { background: #F3B335; border-color: #F3B335; color: #1d1609; font-weight: 700; cursor: default; }
.amg-page-btn:disabled { opacity: 0.5; cursor: default; }
.amg-page-btn.amg-ellipsis { border: none; background: transparent; opacity: 0.7; }

.amg-products-noscript { padding: 2rem; text-align: center; color: #6b5c3e; }

/* ===== MOBILE: stack, collapsible filters ===== */
@media (max-width: 900px) {
    .amg-products-layout { grid-template-columns: 1fr; gap: 1rem; }
    .amg-products-sidebar { position: static; }
    .amg-filters-toggle {
        display: inline-block; margin-bottom: 0.75rem;
        padding: 0.6rem 1.2rem; border: 1px solid #d4c9b0; border-radius: 4px;
        background: #fbf6ec; color: #1d1609; font-weight: 700; font-family: inherit;
        text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8rem; cursor: pointer;
    }
    .amg-products-sidebar .amg-products-search,
    .amg-products-sidebar .amg-products-filters { display: none; }
    .amg-products-sidebar.open .amg-products-search { display: block; }
    .amg-products-sidebar.open .amg-products-filters { display: flex; }
}
