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

/* ===== 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: #ff6f3c;
    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: #ff6f3c;
    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: #ff6f3c;
    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;
    justify-content: center;  /* keep centered */
    gap: 10px;

    width: fit-content;       /* shrink to content */
    max-width: 100%;
    margin: 0 auto;           /* center the whole group */

    transform: translateX(3px);  /* ✅ reliable tiny push right */
}

.filter-row select,
.filter-row .filter-select {
    padding: 8px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;

    min-width: 0;            /* IMPORTANT: allow shrinking */
    width: 140px;            /* stable size (not too big) */
    max-width: 100%;
    box-sizing: border-box;
}


.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;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 18px;
}
.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: #ff6f3c;
    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;   /* slightly wider than original 250px */
}

.dropdown-selected {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
}
.dropdown-list {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 999;
    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: #ff6f3c;
    color: #fff;
}
.dropdown-list .main-cat {
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    background: #f9f9f9;
    color: #000;
}
.dropdown-list .main-cat:hover {
    background: #ff6f3c;
    color: #fff;
}
.dropdown-list .selectable-item {
    padding: 5px 10px;
    cursor: pointer;
    color: #000;
}
.dropdown-list .selectable-item:hover {
    background: #ff6f3c;
    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: #ff6f3c;
    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 ===== */
@media (max-width: 850px) {
    .brand-container {
        margin: 30px auto 5px;
    }
    
    .brand-logo__icon {
        width: 40px;
        height: 48px;
    }
    
    .brand-logo__text {
        font-size: 36px;
    }

   /* ← TAMBAH INI ↓ */
    .brand-link {
        gap: 1px; /* Lebih dekat pada etxt beanjars*/
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ad-item {
        flex-direction: column;
        width: 90%;
        align-items: center;
    }
     .ad-item-link {
        width: 90%;
    }

    /* 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: #E68900 !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 #ff6f3c;
    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: sticky;
    top: 0;
    z-index: 1000;
    background: #ff6f3c;
}
/* 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: #ff6f3c;
}

/* ✅ 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: #ff6f3c;
}

.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: #ff6f3c;
    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: #ff6f3c;
    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;
}

/* === Sticky Filter Bar (3rd Stripe) === */
.filters-sticky-bar {
    position: sticky;
    top: 98px; /* match actual header height so no gap */
    z-index: 900;

    background: #f0f2f5;
    padding: 8px 0;
}

/* ✅ 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;
}