/* Compact spacing: tighter, catalog-style density across the site.
   Loaded after app.css and responsive.css so these values win. */

/* ---------- Fluid page width ----------
   --page-gutter: distance from the screen edge to content (matches the header).
   --content-inset: padding #main-content already has (responsive.css, 1400px+). */
:root {
    --page-gutter: 10px;
    --content-inset: 0px;
}
@media (min-width: 1400px) {
    :root {
        --page-gutter: 2vw;
        --content-inset: 2vw;
    }
}

/* Home sections: backgrounds run edge to edge, content lines up with the header. */
#main-content section.banner_panel,
#main-content section.our_category,
#main-content section.about_us_panel,
#main-content section.video_section,
#main-content section.why_choose_panel,
#main-content section.advantage_panel,
#main-content section.hicks_catalog,
#main-content section.hicks_content_panel {
    margin-left: calc(-1 * var(--content-inset));
    margin-right: calc(-1 * var(--content-inset));
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}
#main-content section.banner_panel > .container,
#main-content section.our_category > .container,
#main-content section.about_us_panel > .container,
#main-content section.video_section > .container,
#main-content section.why_choose_panel > .container,
#main-content section.advantage_panel > .container,
#main-content section.hicks_catalog > .container,
#main-content section.hicks_content_panel > .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* A 10px gutter is narrower than Bootstrap's 12px row overhang; shrink the row
   gutter to match so rows don't poke past the screen edge. */
@media (max-width: 1399.98px) {
    #main-content section > .container > .row,
    #top_search_bar_section > .container > .row,
    #main-content section.product_list_head + section > .p-2 > div > .row,
    footer.main_footer .container > .row {
        --bs-gutter-x: 20px;
    }
}

/* Wider sections would scale the side photos up; keep them a fixed height and crop. */
@media (min-width: 992px) {
    .left_right_img img {
        width: 100%;
        height: clamp(320px, 30vw, 460px);
        object-fit: cover;
    }
}

/* Product list: title bar and filter/grid area start where the header logo does. */
#main-content section.product_details_panel > .container-fluid,
#main-content section.product_list_head > .container-fluid,
#main-content section.product_list_head + section > .p-2 {
    padding-left: calc(var(--page-gutter) - var(--content-inset)) !important;
    padding-right: calc(var(--page-gutter) - var(--content-inset)) !important;
}

/* Search bar and footer use the same edges as the header on every page. */
#top_search_bar_section > .container,
footer.main_footer .container {
    max-width: none;
    padding-left: calc(var(--page-gutter) - var(--content-inset));
    padding-right: calc(var(--page-gutter) - var(--content-inset));
}

/* ---------- Sections ---------- */
.common_vs_padding {
    padding: 28px 0;
}
.common_vb_padding {
    padding: 40px 0;
}
.common_vm_padding {
    padding: 20px 0 0 0;
}
.section_title {
    margin-bottom: 16px;
}
.section_title h2 {
    font-size: 30px;
    margin-bottom: 10px;
}
.banner_text h1 {
    font-size: 52px;
    margin-bottom: 14px;
}
.banner_panel {
    padding-top: 48px;
    padding-bottom: 48px;
}
.video_box {
    padding-bottom: min(32%, 440px);
}

/* ---------- Controls ---------- */
.all_btn {
    height: 40px;
    padding: 0 22px;
}
.text_box_control,
.select_box_control {
    height: 36px;
    padding: 6px 12px;
}
.select_box_control {
    padding-right: 30px;
}

/* ---------- Header and search bar ---------- */
.main_header .logo {
    max-width: 84px;
}
.main_header .logo a {
    padding: 4px 0;
}
#top_search_bar_section.py-2 {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}
/* Input, search button and the space reserved for it are one 40px unit at every width. */
.order_history_search_input,
#top_search_bar_section .order_history_search_input {
    padding-right: 40px;
}
.order_history_search_input input,
#top_search_bar_section .order_history_search_input input {
    height: 40px;
}
.order_history_search_input button,
#top_search_bar_section .order_history_search_input button#top_menu_search_submit {
    top: 0;
    width: 40px;
    height: 40px;
}
.order_history_search_input button svg {
    width: 20px;
    height: 20px;
}
.order_history_search_input .search_clear_btn,
#top_search_bar_section .order_history_search_input .search_clear_btn {
    right: 46px;
    width: 28px;
    height: 28px;
}

/* ---------- Gray page title bars ---------- */
#main-content section.common_gray_bg2.py-4 {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}
#main-content section.common_gray_bg2 h3 {
    font-size: 1.4rem;
}

/* ---------- Filter sidebar ---------- */
.filter_panel h3 {
    padding: 10px 14px;
    font-size: 0.95em;
}
.filter_panel .filter_item.p-2 {
    padding: 6px 12px !important;
}
.filter_accordion_title {
    padding: 8px 12px;
    font-size: 0.9em;
}
.filter_panel .filter_accordion > div {
    padding: 0 12px 8px !important;
}
.filter_panel .form-group.p-2 {
    padding: 8px 12px !important;
}
.filter_toolbar {
    margin-bottom: 10px;
}

/* ---------- Footer ---------- */
.footer_item h4 {
    font-size: 18px;
    margin-bottom: 10px;
}
.main_footer .footer_logo.mb-4 {
    margin-bottom: 12px !important;
}

/* ---------- Cart icon with item count ---------- */
.header_cart,
.main_nav > ul > li > a.header_cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--primary-dark);
    text-decoration: none;
}
.header_cart:hover {
    color: var(--primary-brown);
}
.header_cart i {
    font-size: 1.3rem;
}
.cart_count_badge {
    position: absolute;
    top: 0;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #c62828;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.main_nav > ul > li.header_cart_item {
    align-self: center;
}
.header_cart--mobile {
    margin-right: 6px;
}

/* ---------- Home: Hicks catalog brands ----------
   Three rows that slide left continuously; phones get a plain two-column list. */
.catalog_marquee {
    --tile-w: 150px;
    --tile-h: 58px;
    --tile-gap: 10px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.catalog_track {
    display: flex;
    width: max-content;
}
.catalog_marquee.is-moving .catalog_track {
    animation: catalog-scroll var(--catalog-duration, 40s) linear infinite;
}
.catalog_marquee.is-moving:hover .catalog_track,
.catalog_marquee.is-moving:focus-within .catalog_track {
    animation-play-state: paused;
}
@keyframes catalog-scroll {
    to {
        transform: translateX(-50%);
    }
}
.catalog_grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, var(--tile-h));
    grid-auto-columns: var(--tile-w);
    gap: var(--tile-gap);
    padding-right: var(--tile-gap);
}
.catalog_tile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e6e2da;
    border-radius: 8px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.catalog_tile:hover,
.catalog_tile:focus-visible {
    border-color: var(--primary-brown);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
}
.catalog_tile img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
@media (min-width: 1920px) {
    .catalog_marquee {
        --tile-w: 160px;
        --tile-h: 60px;
    }
}
@media (max-width: 767.98px) {
    .catalog_marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .catalog_track {
        display: block;
        width: auto;
    }
    .catalog_grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: 56px;
        padding-right: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .catalog_marquee.is-moving .catalog_track {
        animation: none;
    }
    .catalog_marquee.is-moving {
        overflow-x: auto;
    }
}

/* ---------- Desktop header menu ---------- */
/* Every item (text links, cart, account icon, buttons) sits on the header's centre line. */
@media (min-width: 992px) {
    .main_nav > ul {
        align-items: center;
    }
    .main_nav > ul > li {
        display: flex;
        align-items: center;
    }
    .main_nav > ul > li > a {
        display: inline-flex;
        align-items: center;
        line-height: 1.2;
        padding-top: 14px;
        padding-bottom: 14px;
    }
    .main_nav > ul > li.header_right_cta > a {
        padding: 12px 18px;
    }
    .main_nav .user-menu .user-icon {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

/* ---------- Tablets and phones ---------- */
@media (max-width: 991.98px) {
    .common_vs_padding {
        padding: 20px 0;
    }
    .common_vb_padding,
    .common_vm_padding {
        padding: 24px 0;
    }
    .section_title h2 {
        font-size: 24px;
    }
    .banner_text h1 {
        font-size: 34px;
        margin-bottom: 10px;
    }
    .banner_panel {
        padding-top: 28px;
        padding-bottom: 28px;
    }
    .video_box {
        padding-bottom: 45%;
    }
    .main_footer .footer_item.mb-5 {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 767.98px) {
    .all_btn {
        height: 38px;
        padding: 0 16px;
    }
    .main_header .logo {
        max-width: 72px;
    }
    #main-content section.common_gray_bg2.py-4 {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    #main-content section.common_gray_bg2 h3 {
        font-size: 1.15rem;
    }
    .section_title h2 {
        font-size: 22px;
    }
    .banner_text h1 {
        font-size: 28px;
    }
}

/* ---------- Tables that turn into cards on phones ----------
   Each cell needs a data-label attribute; it is shown as the row label. */
@media (max-width: 767.98px) {
    table.table-cards,
    table.table-cards tbody,
    table.table-cards tr,
    table.table-cards td {
        display: block;
        width: 100% !important;
    }
    table.table-cards thead {
        display: none;
    }
    table.table-cards tbody tr {
        margin-bottom: 10px;
        padding: 4px 12px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }
    table.table-cards > tbody > tr > * {
        --bs-table-bg-type: transparent;
        background: transparent !important;
        box-shadow: none !important;
    }
    .dt-container:has(table.table-cards) .dt-search,
    .dt-container:has(table.table-cards) .dt-search input {
        width: 100%;
        margin-left: 0;
    }
    table.table-cards tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 32px;
        padding: 5px 0;
        text-align: right;
        border: 0;
        border-bottom: 1px solid #f1f3f5;
        word-break: normal;
        overflow-wrap: anywhere;
    }
    table.table-cards tbody td:last-child {
        border-bottom: 0;
    }
    table.table-cards tbody td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 13px;
        font-weight: 600;
        color: #6c757d;
        text-align: left;
    }
    table.table-cards tbody td[colspan],
    table.table-cards tbody td.card-lead {
        display: block;
        text-align: left;
    }
    table.table-cards tbody td[colspan] {
        text-align: center;
    }
    table.table-cards tbody td[colspan]::before,
    table.table-cards tbody td.card-lead::before,
    table.table-cards tbody td[data-label=""]::before {
        content: none;
    }
    table.table-cards tbody td[data-label=""]:empty {
        display: none;
    }
}
@media (max-width: 767.98px) {
    table.table-cards tbody td.card-actions {
        justify-content: flex-end;
    }
}
