/*
 * Bricofy - design (MIG-008, Bootstrap 5.3; architecture of 321reduc, ROADMAP D17).
 * Brand: the orange of the logo (#fd5d14) on a very dark brown header, white surfaces.
 */
:root {
    --brand-dark: #231a08;
    --brand-dark-2: #3a2c10;
    --brand-orange: #fd5d14;
    --brand-orange-dark: #d94a08;
    --brand-orange-soft: #fff1ea;
    --surface: #f7f6f3;
    --text-muted-2: #6f6a5f;
    --card-radius: 12px;
    --shadow-soft: 0 1px 2px rgba(35, 26, 8, .06), 0 4px 14px rgba(35, 26, 8, .06);
    --shadow-hover: 0 2px 4px rgba(35, 26, 8, .08), 0 10px 26px rgba(35, 26, 8, .12);

    --bs-primary: var(--brand-orange);
    --bs-primary-rgb: 253, 93, 20;
    --bs-link-color: var(--brand-orange-dark);
    --bs-link-color-rgb: 217, 74, 8;
    --bs-link-hover-color: var(--brand-dark-2);
    --bs-body-bg: var(--surface);
    --bs-body-color: #22201a;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-border-radius: .55rem;
}

body { -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-accent { color: var(--brand-orange); }
.bi { vertical-align: -.125em; }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 2000; padding: .5rem 1rem; background: #fff; }

.btn-primary, .btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--brand-orange); --bs-btn-border-color: var(--brand-orange);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-orange-dark); --bs-btn-hover-border-color: var(--brand-orange-dark);
    --bs-btn-active-bg: var(--brand-orange-dark); --bs-btn-active-border-color: var(--brand-orange-dark);
    font-weight: 600;
}

/* Header */
.site-header { background: linear-gradient(90deg, var(--brand-dark), var(--brand-dark-2)); box-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
.site-header .navbar { --bs-navbar-padding-y: .55rem; }
.brand-logo { display: block; height: 40px; width: auto; }
.site-header .nav-link { font-weight: 500; border-radius: .5rem; padding-inline: .75rem !important; }
.site-header .nav-link.active, .site-header .nav-link:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.site-header .dropdown-menu { max-height: 70vh; overflow-y: auto; }

/* Search with suggestions */
.quick-search-header { flex: 1 1 auto; max-width: 34rem; margin-inline: auto; }
.quick-search-header .input-group { background: #fff; border-radius: 999px; padding: 3px; }
.quick-search-header .form-control { border: 0; box-shadow: none; border-radius: 999px !important; padding-inline: 1rem; }
.quick-search .btn { border-radius: 999px !important; width: 2.4rem; height: 2.4rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.quick-search-lg .input-group { background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow-soft); }
.quick-search-lg .form-control { border: 0; box-shadow: none; border-radius: 999px !important; padding: .7rem 1.2rem; font-size: 1.05rem; }
.quick-search-lg .btn { width: 3rem; height: 3rem; }
@media (max-width: 991.98px) { .quick-search-header { max-width: none; margin: .6rem 0; } }
.quick-search-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1050; margin: 0; padding: .35rem;
    background: #fff; border-radius: .6rem; max-height: 26rem; overflow-y: auto; text-align: left;
}
.quick-search-results li a { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: .45rem; color: #22201a; }
.quick-search-results li a:hover, .quick-search-results li a.is-active { background: var(--surface); text-decoration: none; }
.quick-search-results img { width: 40px; height: 40px; object-fit: contain; }
.quick-search-results .qs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-search-results .qs-type { margin-left: auto; font-size: .75rem; color: var(--text-muted-2); white-space: nowrap; }

/* Hero */
.hero { background: radial-gradient(1100px 380px at 50% -10%, #5a4317 0%, var(--brand-dark) 65%); color: #fff; }
.hero-title { font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.hero-lead { opacity: .85; font-size: 1.1rem; margin-bottom: 1.5rem; }
.hero-links a { color: #fff; opacity: .85; margin-inline: .5rem; }

/* Sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.section-link { white-space: nowrap; font-weight: 500; }
.page-title { font-weight: 800; letter-spacing: -.01em; }
.empty-state { background: #fff; border-radius: var(--card-radius); padding: 2rem; text-align: center; color: var(--text-muted-2); box-shadow: var(--shadow-soft); }

/* Chips and category tiles */
.category-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: #fff; box-shadow: var(--shadow-soft); color: #22201a; font-size: .9rem; }
.chip span { color: var(--text-muted-2); font-size: .8rem; }
.chip:hover { text-decoration: none; background: var(--brand-orange-soft); }
.category-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.category-tile { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 1rem 1.1rem; }
.category-tile h3 a { color: #22201a; font-weight: 700; }
.count { color: var(--text-muted-2); font-size: .8rem; }

/* Product cards */
.product-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
.product-card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.product-thumb { position: relative; display: block; background: #fff; padding: .75rem; }
.product-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.badge-discount { position: absolute; top: .6rem; left: .6rem; background: var(--brand-orange); color: #fff; font-weight: 800; font-size: .85rem; padding: .15rem .5rem; border-radius: 999px; }
.badge-discount.badge-lg { font-size: 1.1rem; padding: .3rem .8rem; }
.product-body { padding: .1rem .9rem .9rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.product-brand { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted-2); font-weight: 600; }
.product-name { font-size: .92rem; font-weight: 600; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-name a { color: #22201a; }
.product-name a::after { content: ""; position: absolute; inset: 0; }
.product-price { margin-top: auto; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--brand-dark); }
.price-old { color: var(--text-muted-2); font-size: .85rem; }

/* Listing */
.listing-toolbar label { white-space: nowrap; }
.filter-panel { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 1rem; }
.filter-block + .filter-block { border-top: 1px solid #eee; margin-top: .9rem; padding-top: .9rem; }
.filter-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--text-muted-2); margin-bottom: .5rem; }
.filter-list { margin: 0; font-size: .9rem; max-height: 18rem; overflow-y: auto; }
.filter-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .15rem 0; }
.filter-panel a { color: #22201a; }
.filter-panel a.active { color: var(--brand-orange-dark); font-weight: 600; }
.pagination { --bs-pagination-active-bg: var(--brand-orange); --bs-pagination-active-border-color: var(--brand-orange); --bs-pagination-color: var(--brand-dark-2); }

/* Product page */
.product-gallery { position: relative; background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 1.5rem; }
.product-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.product-brand-link { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; font-size: .85rem; }
.product-title { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 800; margin: .3rem 0 1rem; }
.buy-box { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 1.25rem; }
.buy-price { font-size: 2rem; font-weight: 800; color: var(--brand-dark); }
.saving { color: #1d7a3a; font-weight: 600; }
.buy-facts li { padding: .2rem 0; }
.product-description { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 1.5rem; max-width: 60rem; }

/* Brands */
.letter-index { display: flex; flex-wrap: wrap; gap: .25rem; background: #fff; padding: .5rem; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); }
.letter-index a { padding: .2rem .55rem; border-radius: .4rem; font-weight: 700; }
.sticky-index { position: sticky; top: 4.5rem; z-index: 10; }
.brand-columns { columns: 4 12rem; column-gap: 1.5rem; }
.brand-columns li { break-inside: avoid; padding: .1rem 0; }
.brand-letter { scroll-margin-top: 8rem; }

/* Static pages */
.static-page { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow-soft); padding: 2rem; max-width: 60rem; }
.static-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }

/* Footer */
.site-footer { background: var(--brand-dark); color: rgba(255, 255, 255, .78); }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: #fff; }
.footer-title { color: #fff; font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.footer-disclosure { opacity: .8; }
.footer-bottom { background: rgba(0, 0, 0, .25); }
.social-link { display: inline-flex; width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .1); }

/* Phones: two product cards per row, tighter cards */
@media (max-width: 575.98px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .product-thumb { padding: .5rem; }
    .product-body { padding: .1rem .6rem .7rem; }
    .product-name { font-size: .85rem; }
    .price { font-size: 1rem; }
    .badge-discount { font-size: .75rem; top: .4rem; left: .4rem; }
    .static-page { padding: 1.25rem; }
}
