/**
 * results-consistency.css
 * -----------------------------------------------------------------
 * Purpose: make sure ANY "results" page — product search results,
 * category archives, brand archives, and the toolbar/search bar that
 * sits above them — always look like the rest of the site (same
 * navy/red palette, same header styling), even when other
 * conditionally-loaded stylesheets change what page type is active.
 *
 * This file is loaded LAST (after main.css, shop-archive.css,
 * woocommerce-shop.css, dcsupplies-shop-style.css) specifically so
 * its rules win the cascade on every page this applies to. Enqueue
 * snippet is at the bottom of this file as a comment.
 *
 * Covers:
 *   1) Header search bar + Categories button (row 2) — reinforced so
 *      it can never render as bare/unstyled browser defaults again.
 *   2) The "results" area itself — archive title, breadcrumb,
 *      toolbar, product grid cards, pagination, empty state — styled
 *      to match the site's navy (#0D0D0D/#0D0D0D) + red (#9B1E22)
 *      palette used everywhere else (header, blog, home page).
 *   3) The non-product search-result fallback card (search.php +
 *      template-parts/content-search-post.php), for the rare case a
 *      blog post shows up in search results alongside products.
 *
 * Breakpoints used throughout:
 *   Big screen / large desktop .... min-width: 1400px
 *   Laptop / standard desktop ..... 992px – 1399px
 *   Tablet ......................... 768px – 991px
 *   Phone .......................... max-width: 767px
 * -----------------------------------------------------------------
 */

 :root {
    --dcs-navy: #0D0D0D;
    --dcs-navy-2: #0D0D0D;
    --dcs-red: #9B1E22;
    --dcs-red-2: #c8102e;
    --dcs-border: #E2E2E2;
    --dcs-text: #0D0D0D;
    --dcs-text-muted: #5b6377;
    --dcs-bg-soft: #f7f8fb;
}

/* ===================================================================
   0) PRODUCT IMAGE BORDER RADIUS — applied site-wide
   Rounds every product thumbnail regardless of which page/stylesheet
   built the card (grid cards, list view, category/outlet/hard-drives/
   networking pages, home page carousel, WooCommerce block grid).
   Placed here since this file loads last, so it reliably wins the
   cascade over the page-specific stylesheets that create these cards.
=================================================================== */
.product-grid .product-card__image-wrap img,
ul.products li.product img,
.wc-block-grid__product-image img,
.dc-product-card__img-wrap img,
.dc-hd-product-grid .product img,
.dc-net-product-grid .product img,
.server-deals__thumb img,
.dc-hd-blog-card__img img,
.dc-blog-card__img-wrap img {
    border-radius: 8px;
}

/* ===================================================================
   1) HEADER SEARCH BAR + CATEGORIES BUTTON — LOCKED-IN STYLING
   Reinforces main.css so a category/search/brand/product page can
   never fall back to unstyled native <select>/<input>/<button>.
=================================================================== */

.header-row-2,
.header-row-2 .header-row-2__inner {
    background: var(--dcs-navy-2) !important;
}

.header-row-2 .categories-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 46px !important;
    padding: 0 18px !important;
    background: var(--dcs-red) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 3px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

.header-row-2 .dc-search-form {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 3px !important;
    overflow: hidden !important;
}

.header-row-2 .dc-search-form .search-cat-select {
    flex: 0 0 72px !important;
    height: 46px !important;
    border: 0 !important;
    border-right: 1px solid var(--dcs-border) !important;
    background: #F4EFEB !important;
    padding: 0 8px !important;
    font-size: 14px !important;
}

.header-row-2 .dc-search-form .search-input-field {
    flex: 1 !important;
    min-width: 0 !important;
    height: 46px !important;
    border: 0 !important;
    background: #ffffff !important;
    padding: 0 14px !important;
    font-size: 14px !important;
}

.header-row-2 .dc-search-form .search-submit-btn {
    flex: 0 0 52px !important;
    height: 46px !important;
    border: 0 !important;
    background: var(--dcs-red) !important;
    color: #ffffff !important;
    cursor: pointer !important;
}

.header-row-2 .dc-search-form .search-submit-btn .dashicons {
    color: #ffffff !important;
}

/* ===================================================================
   2) RESULTS AREA — search results / category / brand archives
   Targets the markup from archive-product.php so it matches the
   navy/red site language instead of default WooCommerce styling.
=================================================================== */

.archive-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    box-sizing: border-box;
}

.archive-breadcrumb,
.woocommerce-breadcrumb {
    font-size: 12.5px;
    color: var(--dcs-text-muted);
    margin-bottom: 10px;
}

.archive-breadcrumb a,
.woocommerce-breadcrumb a {
    color: var(--dcs-text-muted);
    text-decoration: none;
}

.archive-breadcrumb a:hover,
.woocommerce-breadcrumb a:hover {
    color: var(--dcs-red-2);
    text-decoration: underline;
}

.archive-header {
    background:white;
    border-bottom: 4px solid var(--dcs-red-2);
    padding: 32px 28px;
    border-radius: 6px;
    margin-bottom: 28px;
}

.archive-title {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .3px;
    margin: 0 0 10px;
}

.archive-description {
    color: #c7cde0;
    font-size: 15px;
    margin: 0 0 4px;
}

.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dcs-red);
    color: #ffffff;
    border: none;
    border-radius: 3px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.filter-toggle-btn:hover {
    background: var(--dcs-red-2);
}

/* Product grid cards — matches the blog-card visual language used
   elsewhere on the site (white card, subtle border, hover lift). */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-grid .product-card,
.product-grid li.product {
    background: #ffffff;
    border: 1px solid #e7e9f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    transition: box-shadow .2s ease, transform .2s ease;
}

.product-grid .product-card:hover,
.product-grid li.product:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--dcs-text-muted);
    font-size: 16px;
    background: var(--dcs-bg-soft);
    border-radius: 8px;
}

.no-results .button {
    display: inline-block;
    margin-top: 16px;
    background: var(--dcs-red);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 3px;
    font-weight: 700;
}

.no-results .button:hover {
    background: var(--dcs-red-2);
}

/* Pagination — same look as the blog pagination on home.php */
.woocommerce-pagination,
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 48px 0 8px;
    flex-wrap: wrap;
}

.woocommerce-pagination a,
.woocommerce-pagination span,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--dcs-text);
    border: 1px solid var(--dcs-border);
}

.woocommerce-pagination a:hover,
.pagination a:hover {
    border-color: var(--dcs-red-2);
    color: var(--dcs-red-2);
}

.woocommerce-pagination .current,
.pagination .current {
    background: var(--dcs-navy);
    color: #ffffff;
    border-color: var(--dcs-navy);
}

/* ===================================================================
   3) SEARCH — NON-PRODUCT RESULT CARD
   Used by template-parts/content-search-post.php in search.php when a
   result isn't a product (e.g. a blog post). Sits inside the same
   .product-grid as product cards, so it borrows the identical card
   shell (white bg, border, radius, hover lift) and just swaps in its
   own thumbnail/excerpt layout — reads as intentional next to product
   cards rather than a mismatched leftover.
=================================================================== */

.search-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e7e9f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    transition: box-shadow .2s ease, transform .2s ease;
}

.search-post-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
}

.search-post-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--dcs-bg-soft);
    overflow: hidden;
}

.search-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-post-card__thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 36px !important;
    width: 36px;
    color: var(--dcs-text-muted);
}

.search-post-card__type {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--dcs-navy);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 4px 9px;
    border-radius: 3px;
}

.search-post-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 16px 18px;
}

.search-post-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
}

.search-post-card__title a {
    color: var(--dcs-text);
    text-decoration: none;
}

.search-post-card__title a:hover {
    color: var(--dcs-red-2);
}

.search-post-card__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: var(--dcs-text-muted);
    margin: 0 0 14px;
    flex: 1;
}

.search-post-card__link {
    align-self: flex-start;
    font-size: 13px;
    font-weight: 700;
    color: var(--dcs-red);
    text-decoration: none;
}

.search-post-card__link:hover {
    color: var(--dcs-red-2);
    text-decoration: underline;
}

/* ===================================================================
   RESPONSIVE BREAKPOINTS
=================================================================== */

/* ---- Big screen / large desktop monitors ---- */
@media (min-width: 1400px) {
    .archive-layout {
        max-width: 1440px;
        gap: 40px;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }

    .archive-title {
        font-size: 34px;
    }

    .search-post-card__title {
        font-size: 16px;
    }
}

/* ---- Laptop / standard desktop ---- */
@media (min-width: 992px) and (max-width: 1399px) {
    .archive-layout {
        max-width: 1200px;
        gap: 28px;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }

    .archive-title {
        font-size: 28px;
    }
}

/* ---- Tablet ---- */
@media (min-width: 768px) and (max-width: 991px) {
    .archive-layout {
        flex-direction: column;
        padding: 16px 16px 36px;
        gap: 20px;
    }

    .archive-layout__sidebar {
        width: 100%;
        flex: 1 1 auto;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .archive-header {
        padding: 22px 18px;
    }

    .archive-title {
        font-size: 24px;
    }

    .archive-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Header search bar on tablet: category select collapses to an
       icon-only control (no room for full width text) */
    .header-row-2 .dc-search-form .search-cat-select {
        flex: 0 0 58px;
        font-size: 13px;
    }

    .search-post-card__body {
        padding: 14px 14px 16px;
    }
}

/* ---- Phone ---- */
@media (max-width: 767px) {
    .archive-layout {
        flex-direction: column;
        padding: 12px 12px 28px;
        gap: 16px;
    }

    .archive-layout__sidebar {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .archive-header {
        padding: 18px 14px;
        border-radius: 4px;
    }

    .archive-title {
        font-size: 20px;
    }

    .archive-breadcrumb,
    .woocommerce-breadcrumb {
        font-size: 11.5px;
    }

    .archive-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .no-results {
        padding: 40px 16px;
        font-size: 14px;
    }

    .search-post-card__thumb {
        aspect-ratio: 16 / 9;
    }

    .search-post-card__title {
        font-size: 14px;
    }

    .search-post-card__excerpt {
        font-size: 12.5px;
    }

    /* On phone the header switches to .mobile-header (main.css already
       handles this), so no header-row-2 rules needed here. */
}