/* Main Styles for BeanJars Adverts Page */
body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;

    /* ✅ Enterprise: reserve space for FIXED 2-row orange header */
    padding-top: 110px; /* desktop header height */

    /* keep your original reset intention */
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

@media (max-width: 850px) {
    body {
        padding-top: 120px; /* mobile header can be slightly taller */
    }
}

/* ===== SELL BUTTON ===== */
.sell-btn { 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    background: none;
    color: #222;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    text-decoration: none;
    font-size: 15px;
    box-shadow: none;
    transition: color 0.2s ease;
}

.sell-btn:hover { 
    background: #e85a20; 
}

/* ===== ENTERPRISE BRANDING ===== */
.brand-container {
    text-align: center;
    margin: 40px auto 5px;
    padding: 0;
}

.brand-link {
    display: inline-flex;
    align-items: flex-end; /* bottom align jar + text */
    text-decoration: none;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.brand-logo__icon {
    position: relative;
    top: -10px; /* ← Naikkan logo */
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-logo__icon {
    width: 50px;
    height: 60px;
    flex-shrink: 0;
    object-fit: contain;
}

.brand-logo__text {
    font-family: "Tahoma Rounded", Arial, sans-serif;
    font-weight: 700;
    font-size: 48px;
    color: #0F9F9A;
    letter-spacing: 0.5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.brand-link:hover .brand-logo__text {
    color: #e85a20;
}

/* ===== TAGLINE ===== */
.beanjars-tagline { 
    display: block; 
    text-align: center; 
    font-family: Arial, sans-serif; 
    font-size: 20px; 
    color: #000; 
    margin: 0 0 40px; 
}

/* Location Header */
.location-header {
    text-align: center;
    margin: 25px 0 10px; /* top spacing + small bottom gap */
}

.location-title {
    font-size: 28px;
    color: #004d4d;
    font-weight: bold;
    margin: 0 0 5px;
}
.location-subtitle {
    font-size: 16px;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Container */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 20px auto; /* move white canvas upward */
    background: #fff;
    padding: 20px;
    border-radius: 10px;
}

/* Headers */
h1 {
    text-align: center;
    color: #0F9F9A;
    font-size: 40px;
    margin: 0 0 8px;
}
h2 {
    text-align: center;
    color: #004d4d;
    font-size: 18px;
    margin: 0 0 20px;
}

/* ===== SEARCH CONTAINER - Centered above filters ===== */
.search-container {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.search-field {
    width: 100%;
    max-width: 100%;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
}

/* ===== SEARCH BUTTON ===== */
.search-btn {
    padding: 10px 20px;
    background: #0F9F9A;
    color: white;
    border: 1.5px solid #ffffff; /* white border */
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #e85a20;
}

    /* ===== FILTER BAR ===== */
    .filter-bar {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        margin-bottom: 20px;
    }
    .filter-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
        width: 100%;
        max-width: 100%;
    }

.homepage-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    justify-content: flex-end;
}

.homepage-sort-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.homepage-sort-select {
    width: 132px;
}

.homepage-sale-type-select {
    width: 132px;
    max-width: 132px;
    text-overflow: ellipsis;
}
      .filter-row select,
    .filter-row .filter-select {
        min-width: 0;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

/* ===== MOBILE ONLY: convert pills to clean text dropdown ===== */
@media (max-width: 768px) {
  /* Native selects (3 filters): keep browser arrow */
  .filter-row select{
    background: #fff;                 /* ✅ match stripe */
    border: 1.5px solid #0F9F9A;      /* ✅ orange box */
    border-radius: 8px;              /* ✅ rounded */
    box-shadow: none;

    font-size: 10px;
    font-weight: 700;
    color: #0F9F9A;

    padding: 6px 10px;               /* ✅ thin stripe */
    text-align: left;                /* ✅ not centered */
    width: 100%;                     /* ✅ full row width */
    box-sizing: border-box;

    appearance: auto;
    -webkit-appearance: menulist;
  }

  /* Custom dropdown closed label: no native arrow logic */
.filter-row .dropdown-selected{
    background: transparent;
    border: none;
    box-shadow: none;

    font-size: 10px;
    font-weight: 700;
    color: #0F9F9A;

    padding: 0;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between; /* ✅ arrow goes right */

    white-space: nowrap;
}

}
    /* Desktop ONLY: restore pill style */
    @media (min-width: 851px) {
        .filter-row select,
        .filter-row .filter-select {
            width: 140px;
            padding: 8px 10px;
            border-radius: 5px;
            border: 1px solid #ccc;
        }
    }
    .button-row {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
.filter-bar input[type="submit"], .filter-bar .reset-btn {
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: #004d4d;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}
.filter-bar .reset-btn {
    background: #888;
}
.filter-bar input[type="submit"]:hover {
    background: #003737;
}
.filter-bar .reset-btn:hover {
    background: #666;
}

/* Ad Item (AD CONTAINER) */
.ad-item {
    display: flex;
    gap: 16px;
    align-items: center;
    width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-item .info {
    flex: 1;
    text-align: left;
}
.ad-item h3 {
    margin: 0;
    color: #004d4d;
    font-size: 18px;
}
.ad-item p {
    margin: 4px 0;
    color: #555;
    font-size: 14px;
}

/* Image Placeholder (GRAY BOX YANG TELAH DI-BESARKAN) */
.ad-item img {
    width: 150px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #cccccc;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
}

/* Shared public listing image: preserve the thumbnail's existing footprint. */
.ad-item .ad-listing-media {
    position: relative;
    flex-shrink: 0;
    width: 150px;
    border-radius: 8px;
    overflow: hidden;
    container-type: inline-size;
}

.ad-item .ad-listing-media__placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}

.ad-item .ad-shipping-promo {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 3px;
    box-sizing: border-box;
    border-radius: 4px;
    background: #147d64;
    color: #fff;
    line-height: 1.1;
    text-align: left;
    pointer-events: none;
}

.ad-item .ad-shipping-promo__icon {
    flex: 0 0 auto;
    font-size: 10px;
}

.ad-item .ad-shipping-promo__copy {
    min-width: 0;
}

.ad-item .ad-shipping-promo__title,
.ad-item .ad-shipping-promo__status,
.ad-item .ad-shipping-promo__detail {
    display: block;
}

.ad-item .ad-shipping-promo__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.ad-item .ad-shipping-promo__status {
    font-size: 9px;
    font-weight: 600;
    font-style: italic;
    color: #fff3c4;
    text-transform: uppercase;
}

.ad-item .ad-shipping-promo__detail {
    margin-top: 1px;
    font-size: 10px;
    font-weight: 400;
}

/* Scale to the image, including narrow two-column phone cards. */
@container (max-width: 125px) {
    .ad-item .ad-shipping-promo__icon {
        display: none;
    }

    .ad-item .ad-shipping-promo {
        padding: 2px;
    }
}

@container (max-width: 105px) {
    .ad-item .ad-shipping-promo {
        padding: 1px;
    }

    .ad-item .ad-shipping-promo__title {
        font-size: 10.5px;
    }
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 18px;
}

@media (max-width: 480px) {
    .pagination {
        grid-column: 1 / -1;
    }
}

.pagination a {
    margin: 0 5px;
    padding: 8px 12px;
    background: #004d4d;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}
.pagination a:hover {
    background: #003737;
}
.pagination .current {
    background: #0F9F9A;
    color: #000;
}

/* Footer */
.footer {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 26px;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 200px;   /* desktop unchanged */
}

/* MOBILE ONLY: allow grid to control width */
@media (max-width: 768px) {
    .custom-dropdown {
        width: 100%;
    }
}

.dropdown-selected {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    padding-right: 22px; /* ✅ reserve space so ▾ stays visible */
    border-radius: 5px;
    cursor: pointer;
    text-align: left;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    line-height: 1.2;
    min-height: 38px;

    display: block;
}

.dropdown-list {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;

    /* FIX: ensure dropdown stays ABOVE the white sheet/container */
    z-index: 99999;

    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.dropdown-list::-webkit-scrollbar {
    width: 8px;
}
.dropdown-list::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 4px;
}
.dropdown-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
.dropdown-list > div:first-child {
    padding: 5px 10px;
    cursor: pointer;
    color: #000;
}
.dropdown-list > div:first-child:hover {
    background: #0F9F9A;
    color: #fff;
}
.dropdown-list .main-cat {
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    background: #f9f9f9;
    color: #000;
}
.dropdown-list .main-cat:hover {
    background: #0F9F9A;
    color: #fff;
}
.dropdown-list .selectable-item {
    padding: 5px 10px;
    cursor: pointer;
    color: #000;
}
.dropdown-list .selectable-item:hover {
    background: #0F9F9A;
    color: #fff;
}
.dropdown-list .subcat {
    display: none;
    padding-left: 15px;
    border-left: 2px solid #eee;
}
.dropdown-list .subcat .subcat {
    padding-left: 15px;
    border-left: 2px solid #ddd;
}
/* Clickable ad item link */
.ad-item-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

/* Remove ALL underlines from text inside the link */
.ad-item-link * {
    text-decoration: none !important;
}

/* Remove text decoration from links inside ad item */
.ad-item-link h3 {
    color: #004d4d;
    text-decoration: none !important;
}

.ad-item-link:hover h3 {
    color: #0F9F9A;
    text-decoration: none !important;
}

/* Remove hover effects from ad-item since link handles it */
.ad-item-link:hover .ad-item {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    cursor: pointer;
}

/* Responsive: make ad cards full-width on mobile */
@media (max-width: 850px) {
    .ad-item-link {
        width: 48%;
        margin-left: 1%;
        margin-right: 1%;
        display: inline-block;
        vertical-align: top;
    }
    .ad-item {
        width: 100%;
    }
}
/* ===== RESPONSIVE ===== */
@media (max-width: 850px) {
    .brand-container {
        margin: 30px auto 5px;
    }
    
    .brand-logo__icon {
        width: 40px;
        height: 48px;
    }
    
    .brand-logo__text {
        font-size: 36px;
    }

     /* Enterprise: fine-tune spacing between jar icon and BeanJars text on mobile */
    .brand-link {
        gap: 1px; /* reduce spacing between icon and text */
    }
    
    .ad-item {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
     .ad-item-link {
        width: 48%;
        margin-left: 1%;
        margin-right: 1%;
        display: inline-block;
        vertical-align: top;
    }

    /* Search field responsive */
    .search-field {
        width: 90%;
        max-width: none;
    }

    /* Search button responsive */
    .search-container {
        flex-direction: column;
        gap: 10px;
    }
    .search-btn {
        width: 90%;
        max-width: 400px;
    }
}


/* =========================
   Main Menu Top Bar (Home /)
   Scope: .mainmenu-topbar only
   ========================= */
.mainmenu-topbar__row {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 20px;
}

.mainmenu-topbar__left {
    flex: 0 0 auto;
    margin-right: 20px;
}

.mainmenu-topbar__center {
    display: flex;
    justify-content: center;
}

.mainmenu-topbar__right {
    flex: 0 0 auto;
}

/* Make logo behave in top bar (no big top margin, no center alignment) */
.mainmenu-topbar .brand-container {
    text-align: left;
    margin: 0;
}

.mainmenu-topbar .brand-logo__text {
    font-size: 34px; /* smaller so it fits the bar */
}

/* Search in top bar: wide */
.mainmenu-search {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header Buttons Container - now in normal flow (RIGHT) and horizontal */
.header-buttons-container {
    position: static;
    top: auto;
    right: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    z-index: auto;
}

/* Chat Button Styling */

.chat-btn:hover {
    background-color: #218838 !important;
    transform: translateY(-2px);
}

/* ===== MY CART BUTTON ===== */

.cart-btn:hover {
    background-color: #0F766E !important; /* Darker orange on hover */
    transform: translateY(-2px);
}

/* =========================
   Rounded Topbar Container
   ========================= */
.mainmenu-topbar {
    width: 99%;
    max-width: 1600px;
    margin: 20px auto 15px;
    background: #f4f4f4;
    border: 2px solid #0F9F9A;
    border-radius: 22px;
    padding: 16px 28px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* =========================
   Top Row (Logo + Post Ad)
   ========================= */
.location-toprow {
    width: 99%;
    max-width: 1600px;
    margin: 20px auto 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.location-toprow__center {
    flex: 1;
    text-align: center;
}

.location-toprow .brand-container {
    margin: 0;
    text-align: left;
}

/* =========================
   Clean-Style Header
   ========================= */

.site-header {
    position: fixed;     /* enterprise: always sticks */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 3000;
    background: #0F9F9A;
}

/* Shared container */
.header-container {
    max-width: 1100px;  /* match ads container max */
    margin: 0 auto;
    padding: 0 10px;
}

/* Row 1 */
.header-strip {

    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding: 8px 0;
    background: #0F9F9A;
}

/* ✅ Dashboard-only: make Stripe 1 match Main Menu height (no impact elsewhere) */
.site-header.is-dashboard .header-strip{
    padding: 6px 0;
}

.strip-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;       /* ✅ lock vertical alignment */
    gap: 20px;
}

/* Dashboard Stripe 1: avatar dropdown (no username inline) */
.site-header.is-dashboard .dash-strip-user{
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ✅ Consolidated: prevent button/avatar from increasing strip height (single source of truth) */
.site-header.is-dashboard .dash-strip-trigger{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
    font: inherit;
    line-height: 1; /* keep stripe height stable */
}

.site-header.is-dashboard .dash-strip-avatar{
    width: 26px;
    height: 26px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex: 0 0 auto;
}

.site-header.is-dashboard .dash-strip-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-header.is-dashboard .dash-strip-chevron{
    font-size: 12px;
    opacity: 0.9;
}

/* Dropdown (stable hover: stays open when moving into it) */
.site-header.is-dashboard .dash-strip-dropdown{
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 6px 0;
    display: none;
    z-index: 2000;
}

.site-header.is-dashboard .dash-strip-dropdown__name{
    padding: 10px 12px;
    font-weight: 700;
    color: #111;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.site-header.is-dashboard .dash-strip-dropdown a{
    display: block;
    padding: 10px 12px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
}

.site-header.is-dashboard .dash-strip-dropdown a:hover{
    background: rgba(255,111,60,0.12);
}

.site-header.is-dashboard .dash-strip-logout-btn{
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #111;
}

.site-header.is-dashboard .dash-strip-logout-btn:hover{
    background: rgba(255,111,60,0.12);
}

/* Open on hover + keep open while hovering dropdown */
.site-header.is-dashboard .dash-strip-user:hover .dash-strip-dropdown{
    display: block;
}

.strip-link {
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

/* Row 2 */
.header-main {
    padding: 15px 0;
    background: #0F9F9A;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* 3 equal columns */
.header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding-right: 40px;   /* internal space between Logo and Search */
}

.header-search {
    flex: 1 1 0;
    display: flex;
    justify-content: center;  /* center column */
}

.header-cart {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 60px;    /* space between Search Button and Cart */
}

.header-post {
    flex: 0 0 auto;
    min-width: 100px;
}

.header-logo {
    flex: 0 0 auto;
}

.header-search {
    flex: 1 1 auto;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 6px; /* round all corners */
}

.search-btn {
    padding: 10px 20px;
    background: #0F9F9A;
    color: #fff;
    border: 1.5px solid #ffffff; /* white border line */
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

.header-post {
    flex: 0 0 auto;
}

.post-btn {
    text-decoration: none;
    color: #0F9F9A;
    font-weight: 600;
}

.strip-link,
.post-btn,
.brand-logo__text {
    color: #fff;
}

/* ===== Header logo smaller (BeanJars + jar) ===== */
.site-header .brand-logo__icon{
    width: 34px;
    height: 40px;
    top: 0; /* override global -10px */
}

.site-header .brand-logo__text{
    font-size: 30px;
    line-height: 1;
}

/* ===== Cart icon only (Row 2 right) ===== */
.header-cart{
    flex: 0 0 60px;   /* default (non-dashboard) */
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Dashboard user menu (CSS-only dropdown, no JS needed) */
.dashboard-user-menu{
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dashboard-user-trigger{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.dashboard-avatar{
    width: 28px;
    height: 28px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex: 0 0 auto;
}

.dashboard-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dashboard-username{
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.dashboard-chevron{
    font-size: 12px;
    opacity: 0.9;
}

/* Dropdown panel */
.dashboard-user-dropdown{
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 6px 0;
    display: none;
    z-index: 2000;
}

.dashboard-user-dropdown a{
    display: block;
    padding: 10px 12px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
}

.dashboard-user-dropdown a:hover{
    background: rgba(255,111,60,0.12);
}

.dashboard-logout-btn{
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #111;
}

.dashboard-logout-btn:hover{
    background: rgba(255,111,60,0.12);
}

/* Show dropdown on hover (enterprise-safe, no JS dependency) */
/* Open dropdown ONLY when arrow is hovered */
.dashboard-user-trigger:hover .dashboard-chevron + .dashboard-user-dropdown,
.dashboard-user-dropdown:hover{
    display: block;
}

.cart-icon-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff; /* if header background is orange */
    font-size: 22px;
}

/* ===== Strip links icons spacing ===== */
.strip-link i{
    margin-right: 6px;
}

/* === Filters Area (scrolls normally with page) === */
.filters-sticky-bar {
    position: relative;
    width: 100%;
    background: #f0f2f5;
    padding: 18px 0 8px;
}

/* ✅ Push the page content down so ads don't touch the header/filters */
@media (min-width: 851px) {
    .filters-sticky-bar + .container {
        margin-top: 70px;         /* breathing space below fixed filters */
    }
}

/* ✅ MOBILE ONLY: you already hide filters in Main Menu, so hide the whole sticky bar */
@media (max-width: 850px) {
    .filters-sticky-bar {
        display: none;
        padding: 0;
        background: transparent;
    }

    /* ✅ Mobile: small breathing space (about 1 line) */
    .filters-sticky-bar + .container {
        margin-top: 24px;
    }

    /* Mobile breathing space under fixed header */
    body {
        padding-top: 120px;   /* match mobile header height */
    }
}

/* Desktop breathing space under fixed header */
@media (min-width: 851px) {
    body {
        padding-top: 110px;   /* match desktop header height */
    }
}

/* ✅ Nudge filters slightly to the right (responsive, scalable) */
.filters-sticky-bar .header-container {
    padding-left: clamp(10px, 2vw, 22px);
}

/* Reduce spacing inside filters */
.filters-sticky-bar .filter-bar {
    margin: 0;
}

/* Add small breathing space before white container */
.container {
    margin-top: 10px;
}

/* =========================================================
   MOBILE ONLY: Filter selects must shrink to content
   (Placed at EOF so it wins over earlier width:140px rules)
   ========================================================= */
@media (max-width: 850px) {
    .filter-row select,
    .filter-row .filter-select {
        width: auto;
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
    }
}

/* ===== MOBILE FIX: equal filter layout foundation ===== */
@media (max-width: 768px) {
  .filter-bar {
    display: none;
  }
  .filter-row {
    display: grid;
    grid-template-columns: 1fr; /* ✅ 4 rows (stack) */
    width: 100%;
    transform: none;
    overflow: visible;
    padding: 4px 8px;
    gap: 8px; /* spacing between rows */
  }
.filter-row > * {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    border: 1.5px solid #0F9F9A;   /* orange border */
    border-radius: 8px;            /* rounded corners */
    padding: 6px 10px;             /* stripe thickness */
    background: #fff;              /* white interior */
}
}

/* Ensure no horizontal overflow on root + safe full-width mobile container */
html, body {
    overflow-x: hidden;
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        max-width: none;
        margin: 10px 0;
        padding: 12px;
        box-sizing: border-box;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .filters-sticky-bar .header-container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Mobile-only: Ensure sticky headers/filters work correctly */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        overflow-y: visible;
        height: 100%;
    }

      .site-header {
        top: 0;
        z-index: 3000;
    }

    .filters-sticky-bar {
        top: 60px;          /* try 60-75px - adjust by 5px until it sits just below orange */
        z-index: 950;       /* higher than before to sit on top if overlap */
        background: #f0f2f5;
    }

    body > *:not(.site-header):not(.filters-sticky-bar) {
        overflow: visible !important;
    }
}

/* MOBILE ONLY: allow 2-column grid to control card width */
@media (max-width: 480px) {

    .ad-item-link {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 12px;
    }

    .ad-item {
        width: 100%;
    }

}

@media (max-width: 480px) {

    .pagination {
        grid-column: 1 / -1;

        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;

        justify-content: flex-start;
        padding-bottom: 4px;

        align-items: center;
    }

}

/* ==========================================
   Ad Trust Badges (Main Menu Ad Cards Only)
   Scope: adverts.css
   ========================================== */

.ad-item .ad-trust-badge-row {
    margin: 8px 0 6px;
}

.ad-item .ad-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.ad-item .ad-trust-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 19px;
    border-radius: 9px 9px 12px 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    clip-path: polygon(50% 0%, 92% 18%, 84% 72%, 50% 100%, 16% 72%, 8% 18%);
}

.ad-item .ad-trust-icon--shield {
    background: #f4b400;
    color: #ffffff;
}

.ad-item .ad-trust-badge--protected {
    background: #eef4ff;
    color: #2f5ea8;
    border: 1px solid #bfd3ff;
}

.ad-item .ad-trust-badge--meetup {
    background: #fff1eb;
    color: #0F9F9A;
    border: 1px solid #ffb89f;
}

/* =========================================================
   Main Category Cards — BeanJars Marketplace
   File: C:\beanjars-project\public\css\adverts.css
   Purpose: 10 main categories, 5 above + 5 below
   ========================================================= */

.main-category-grid {
    width: 100%;
    max-width: 920px;
    margin: 0 auto 14px auto;
    padding: 18px 22px;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 22px;

    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* =========================================================
   Desktop Main Menu: category canvas alignment
   Purpose: align the upper category canvas visually with the lower ads canvas
   Mobile/tablet: protected because this applies only from 1281px and above
   ========================================================= */

@media (min-width: 1281px) {
    .main-category-grid {
        --main-category-desktop-offset: 9px;

        margin-left: calc((100% - 920px) / 2 - var(--main-category-desktop-offset));
        margin-right: auto;
    }
}

.main-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 118px;
    padding: 16px 10px;

    border: 1px solid #f1f1f1;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    cursor: pointer;

    font-family: inherit;
    color: #111827;
    text-align: center;

    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.main-category-card__icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff5f2;
    border: 1px solid rgba(255,111,60,0.22);

    font-size: 28px;
    line-height: 1;
}

.main-category-card__label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.main-category-card:hover,
.main-category-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(255,111,60,0.35);
    box-shadow: 0 8px 18px rgba(0,0,0,0.10);
}

.main-category-card:hover .main-category-card__icon,
.main-category-card.is-active .main-category-card__icon {
    background: #0F9F9A;
    color: #ffffff;
}

.main-category-card:hover .main-category-card__label,
.main-category-card.is-active .main-category-card__label {
    color: #0F9F9A;
}
/* Filters now scroll normally, no fake spacing needed */
@media (min-width: 851px) {
    .filters-sticky-bar + .container {
        margin-top: 20px;
    }
}

/* Mobile: hide category card block for now, same as existing mobile filter behavior */
@media (max-width: 850px) {
    .main-category-grid {
        display: none;
    }
}

/* Desktop: category cards replace the old category dropdown visually.
   The hidden input and JS logic remain active. */
@media (min-width: 851px) {
    .filter-row .custom-dropdown,
    .marketplace-sale-type-control {
        display: none;
    }

    .marketplace-sale-type-control.is-homepage-sale-type {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
}

/* =========================================================
   Marketplace Sidebar Layout
   ========================================================= */

.marketplace-layout.has-sidebar {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;

    display: flex;
    align-items: flex-start;
    gap: 34px;
}

.marketplace-sidebar {
    width: 230px;
    flex-shrink: 0;

    padding-left: 18px;
}

.marketplace-sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 16px;

    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.marketplace-sidebar-title {
    margin: 0 0 10px;

    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.marketplace-sidebar-note {
    margin: 0;

    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

.marketplace-content {
    flex: 1;
}

/* =========================================================
   Sidebar Navigation Links
   ========================================================= */

.marketplace-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.marketplace-sidebar-link {
    display: block;

    padding: 10px 12px;
    border-radius: 10px;

    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;

    color: #374151;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.marketplace-sidebar-link:hover {
    background: #fff4ef;
    color: #0F9F9A;
}

.marketplace-sidebar-link.is-active {
    background: #fff1eb;
    color: #0F9F9A;
    font-weight: 700;
}

/* =========================================================
   Properties Sidebar Groups
   ========================================================= */

.marketplace-sidebar-group {
    margin-top: 14px;
}

.marketplace-sidebar-group:first-child {
    margin-top: 0;
}

.marketplace-sidebar-group-title {
    margin: 0 0 6px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.marketplace-sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 10px;
}

.marketplace-sidebar-divider {
    height: 1px;
    margin: 18px 0 16px;
    background: #e5e7eb;
}

/* =========================================================
   BeanJars Homepage Launch Banner
   Scope: UI-only banner above homepage categories
   ========================================================= */

.homepage-launch-banner {
    width: 100%;
    background: #f0f2f5;
    padding: 18px 0 10px;
    box-sizing: border-box;
}

.homepage-launch-banner .header-container {
    box-sizing: border-box;
}

.homepage-launch-banner__link {
    display: block;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    text-decoration: none;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(10, 82, 79, 0.16);
}

.homepage-launch-banner__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 26px;
}