/* Header: mini-cart (hc-*) + browse-categories / search bar (hb-*).
   Colors come from the admin theme tokens in partials/theme-vars. */

/* ---------- Mini cart ---------- */
.hc-cart {
    position: relative;
    margin-left: 24px;
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, .25);
}

.hc-cart-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--theme-text-light, #F7EFE3) !important;
    line-height: 1;
}

.hc-cart-icon {
    position: relative;
    font-size: 28px;
}

.hc-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--theme-accent, #C9A227);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}

.hc-cart-label {
    margin-top: 5px;
    font-size: 12px;
}

.hc-cart-box {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 1100;
    width: 340px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.hc-cart.hc-open .hc-cart-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hc-cart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    font-size: 15px;
}

.hc-cart-close,
.hc-cart-remove {
    border: 0;
    background: none;
    color: #999;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.hc-cart-close:hover,
.hc-cart-remove:hover {
    color: #d00;
}

.hc-cart-empty {
    margin: 20px 0 6px;
    text-align: center;
    color: #777;
}

.hc-cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.hc-cart-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
}

.hc-cart-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f4f4;
}

.hc-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hc-cart-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

.hc-cart-name {
    font-weight: 600;
    color: #222;
}

.hc-cart-variant {
    color: #777;
    font-size: 12px;
}

.hc-cart-price {
    color: var(--theme-primary, #5C1420);
    font-weight: 600;
}

.hc-cart-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
}

.hc-cart-actions {
    display: flex;
    gap: 10px;
}

.hc-btn {
    flex: 1 1 0;
    padding: 10px 12px;
    border: 1.5px solid var(--theme-primary, #5C1420);
    border-radius: 6px;
    background: var(--theme-primary, #5C1420);
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
}

.hc-btn-outline {
    background: #fff;
    color: var(--theme-primary, #5C1420) !important;
}

/* ---------- Bottom bar: categories + search + track order ---------- */
.hb-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

/* .header .container is display:flex in the theme, so the row must claim the full width
   itself — otherwise it shrinks to content and the search box stays narrow */
.hb-inner {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.hb-categories {
    position: relative;
    flex: 0 0 270px;
}

.hb-cat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--theme-primary, #5C1420);
    color: var(--theme-text-light, #F7EFE3);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
}

.hb-cat-toggle .hb-caret {
    margin-left: auto;
    transition: transform .2s ease;
}

.hb-categories.hb-open .hb-caret {
    transform: rotate(180deg);
}

.hb-cat-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
    max-height: min(420px, calc(100vh - 220px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .25) transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}

.hb-cat-menu::-webkit-scrollbar {
    width: 6px;
}

.hb-cat-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .25);
    border-radius: 3px;
}

.hb-categories.hb-open .hb-cat-menu {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .hb-categories:hover .hb-cat-menu {
        opacity: 1;
        visibility: visible;
    }
}

.hb-cat-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
}

.hb-cat-menu a:hover {
    background: var(--theme-soft-bg, #F7EFE3);
    color: var(--theme-primary, #5C1420);
}

/* Subcategory flyout: opens to the right of the hovered category (desktop only;
   below 992px the bar is hidden and the mobile menu nests them instead).
   .hb-cat-menu scrolls, so the panel is position:fixed (not clipped by the overflow) and
   master.blade.php sets its top/left from the hovered <li> on mouseenter. */
.hb-cat-menu > li {
    position: relative;
}

.hb-cat-menu > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hb-sub-caret {
    margin-left: auto;
    font-size: 11px;
    opacity: .6;
}

.hb-sub-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1051;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    min-width: 220px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateX(6px);
    transition: opacity .18s ease, visibility .18s, transform .18s ease;
}

.hb-cat-menu > li.hb-has-sub:hover > a,
.hb-cat-menu > li.hb-has-sub:focus-within > a {
    background: var(--theme-soft-bg, #F7EFE3);
    color: var(--theme-primary, #5C1420);
}

.hb-cat-menu > li.hb-has-sub:hover > .hb-sub-menu,
.hb-cat-menu > li.hb-has-sub:focus-within > .hb-sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.hb-search {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    max-width: 760px;
    height: 46px;
    border: 2px solid var(--theme-primary, #5C1420);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.hb-search select {
    flex: 0 0 150px;
    max-width: 150px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid #ddd;
    background: #fff;
    color: #555;
    font-size: 13px;
}

.hb-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 14px;
    border: 0;
    outline: 0;
    font-size: 14px;
}

.hb-search button {
    flex: 0 0 52px;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 20px;
    cursor: pointer;
}

.hb-track {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #222;
    font-weight: 600;
    white-space: nowrap;
}

.hb-track i {
    font-size: 22px;
}

/* Tablet / mobile: search takes the full row; categories live in the mobile menu */
@media (max-width: 991px) {
    .hb-categories,
    .hb-track {
        display: none;
    }

    .hb-search {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .hb-search select {
        display: none;
    }

    .hc-cart {
        margin-left: 12px;
        padding-left: 12px;
    }

    .hc-cart-label {
        display: none;
    }

    .hc-cart-box {
        position: fixed;
        top: 70px;
        right: 12px;
    }
}
