/* ============================================================
   OSCLASS — MODERN RESPONSIVE
   Matching brand: #0b2b56 (plum) / #1266cb (orange)
   ============================================================ */

/* ── DESKTOP ONLY (981px+) ──────────────────────────────────── */
@media screen and (min-width: 981px) {
  .isMobile:not(.isDesktop), .isTablet:not(.isDesktop) { display: none !important; }
}

/* ── MEDIUM DESKTOP / TABLET LANDSCAPE (max 980px) ──────────── */
@media screen and (max-width: 980px) {
  body.home #main,
  body.search #main,
  body.user #main,
  body.item #main,
  body.user-public-profile #main { width: 68%; }

  #sidebar,
  body.search #sidebar { width: 30%; margin-right: 2%; }

  body.user #sidebar { width: 28%; margin-right: 2%; }

  .wrapper { width: 100%; }

  body.search #content { padding: 18px; margin-top: 14px; grid-template-columns: 30% 1fr; }
  .ad-slot-tall .ad-slot-box { height: 220px; }
  .listing-with-ad { flex-direction: column; }
  .listing-ad { width: 100%; position: static; }

  .listing-grid .listing-card,
  .similar_ads .listing-grid .listing-card,
  body.search .listing-grid .listing-card { width: calc(50% - 20px); }

  .item-photos .main-photo { flex: 1 1 auto; }

  .main-search { border-radius: 16px; padding: 16px; }
}

/* ── TABLET PORTRAIT (768–980px) ────────────────────────────── */
@media screen and (min-width: 768px) and (max-width: 980px) {
  .isDesktop:not(.isTablet), .isMobile:not(.isTablet) { display: none !important; }

  #sidebar .g-recaptcha { transform: scale(0.86); transform-origin: 0 0; }

  .listing-grid .listing-card,
  .similar_ads .listing-grid .listing-card,
  body.search .listing-grid .listing-card { width: calc(50% - 20px); }

  header .nav a { padding: 6px 10px; font-size: 14px; margin: 14px 0 14px 3px; }
  header #logo img { height: 46px; }
}

/* ── 768px+ (hide mobile-only toggles) ──────────────────────── */
@media screen and (min-width: 768px) {
  .resp-toogle, .fixed-layout .fixed-close { display: none; }
}

/* ── MOBILE (max 767px) ──────────────────────────────────────── */
@media screen and (max-width: 767px) {

  body.osc-has-admin-header header { margin-top: 46px; }

  .isDesktop:not(.isMobile), .isTablet:not(.isMobile) { display: none !important; }

  footer #subdomains-list a { max-width: 50%; }
  body.subdomain-navigation { padding-top: 0; }
  body.subdomain-navigation header { position: relative; height: auto; top: auto; left: auto; }
  body.subdomain-navigation.sd-with-icon #subdomains-list { padding-left: 0; padding-right: 0; }
  body.subdomain-navigation.sd-with-icon #subdomains-list a { max-width: 104px; }

  body.item.item-post #main { width: 100%; }
  body.item-post #error_list { width: 100%; margin-left: 0; }
  #home-regs .wrap > div:nth-of-type(1n+10) { display: block; }

  /* STICKY HEADER */
  header {
    height: 60px;
    padding-top: 5px; padding-bottom: 5px;
    position: fixed; top: 0; left: 0;
    z-index: 99;
    background: linear-gradient(135deg, #0b2b56 0%, #113a71 100%) !important;
    box-shadow: 0 2px 16px rgba(11,43,86,.4);
    border-bottom: 2px solid rgba(18,102,203,.5);
  }
  /* NOTE: no body padding-top — the .qads-navbar in header.php is static,
     not fixed, so reserving space here left a blank band above it. */
  header #logo img { height: 38px; margin: 6px 0; }

  /* HAMBURGER */
  .menu-icon {
    width: 42px; height: 42px;
    position: absolute; right: 4px; top: 2px;
    padding: 11px 9px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.06);
    transition: 0.2s;
  }
  .menu-icon:active, .menu-icon:focus {
    border-color: #1266cb;
    background: rgba(18,102,203,.15);
  }
  .menu-icon > div { display: inline-block; position: relative; width: 24px; height: 18px; }
  .menu-icon span {
    position: absolute; left: 0; width: 100%; height: 2px;
    border-radius: 100px; background: #fff; top: 0; transition: 0.22s;
  }
  .menu-icon span.l2 { top: 50%; margin-top: -1px; }
  .menu-icon span.l3 { bottom: 0; top: auto; }
  .menu-icon.opened span.l1 { top: 8px; transform: rotate(45deg); }
  .menu-icon.opened span.l2 { opacity: 0; }
  .menu-icon.opened span.l3 { top: 8px; transform: rotate(-45deg); }

  /* MOBILE NAV OVERLAY */
  header .nav {
    display: none;
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: linear-gradient(160deg, #0b2b56 0%, #113a71 60%, #16478a 100%);
    z-index: 99; height: initial; overflow-y: auto; padding: 12px 0;
  }
  header .nav a {
    clear: both; width: 100%; text-align: center;
    margin: 0; padding: 18px 28px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-radius: 0; border-left: none; border-right: none; border-top: none;
    color: rgba(255,255,255,.88);
    height: auto; font-size: 17px; font-weight: 700;
    background: transparent;
    transition: background 0.15s, color 0.15s;
  }
  header .nav a:hover,
  header .nav a.active { background: rgba(18,102,203,.18); color: #fff; box-shadow: none; }
  header .nav a.publish {
    background: linear-gradient(135deg, #1266cb, #2b7de0);
    color: #fff; margin: 14px 20px;
    border-radius: 100px; border-color: transparent;
    width: calc(100% - 40px);
    box-shadow: 0 4px 20px rgba(18,102,203,.35);
  }
  header .nav a.publish:hover { box-shadow: 0 6px 26px rgba(18,102,203,.5); }

  /* USER SIDEBAR */
  body.user #sidebar a {
    clear: both; width: 100%; text-align: center; margin: 0;
    padding: 14px 22px; border-bottom: 1px solid rgba(0,0,0,.08);
    border-radius: 0; color: #0b2b56; height: auto; float: left;
  }
  body.user #sidebar { background: #fff; padding: 0; }

  .show-menu-btn { width: 100%; margin: 0 0 16px 0; }

  /* PRICE */
  #item-content .price {
    display: inline-block; margin: 0 0 22px 0;
    font-weight: 800; font-size: 32px; line-height: 36px; color: #fff;
    background: linear-gradient(135deg, #1266cb, #2b7de0);
    padding: 14px 20px; border-radius: 14px;
    box-shadow: 0 4px 20px rgba(18,102,203,.3);
  }

  /* SIDEBAR FILTERS */
  #sidebar .filters,
  .refine,
  .alert_form {
    background: #fff; padding: 16px 14px; margin: 0 0 14px 0;
    border: 1.5px solid var(--clr-border-lt); border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
  }
  #sidebar .filters:hover { box-shadow: var(--shadow-xs); }
  #sidebar ul.category a { padding: 11px 10px; font-size: 15px; }
  #sidebar ul.category ul a { font-size: 14px; padding: 9px 10px; }
  #sidebar input[type="text"],#sidebar input[type="date"],#sidebar input[type="number"],#sidebar select {
    height: 46px; font-size: 15px;
  }

  /* FIXED LAYOUT PANEL — sits below the sticky header, above everything else */
  .fixed-layout {
    display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    width: 100%; height: calc(100% - 60px); z-index: 120;
    background: var(--clr-bg); padding: 18px 16px 96px; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .fixed-layout .fixed-close {
    position: fixed; top: 72px; z-index: 121; right: 16px; cursor: pointer;
    background: linear-gradient(135deg, #0b2b56, #16478a);
    width: 40px; height: 40px; text-align: center; font-size: 18px;
    color: #fff; border-radius: 100px;
    box-shadow: 0 2px 12px rgba(11,43,86,.3);
    display: flex; align-items: center; justify-content: center;
  }
  .fixed-layout .fixed-close i { line-height: 40px; }
  .fixed-layout .fixed-close:hover,
  .fixed-layout .fixed-close:active { background: #1266cb; }
  .fixed-layout .btn { width: auto !important; padding-left: 25px !important; padding-right: 25px !important; }

  /* Sticky Apply bar so it's always reachable once the filter list grows */
  .fixed-layout .filters .actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 122;
    background: #fff; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(11,43,86,.14);
  }
  .fixed-layout .filters .actions .btn { width: 100% !important; }

  .resp-toogle { display: block; }

  /* LISTING GRID */
  .listing-card-list.listing-grid { width: calc(100% + 16px); margin-left: -8px; margin-right: -8px; }
  .listing-grid .listing-card,
  .similar_ads .listing-grid .listing-card { width: calc(50% - 16px); margin: 0 8px 16px 8px; }

  /* SEARCH BAR */
  .main-search { margin: 16px 0 24px 0; border-radius: 14px; padding: 14px; }
  .main-search > .cell.c2 { display: none; }
  .main-search > .cell.c1 { width: 65%; }
  .main-search > .cell.c3 { width: 35%; }

  #sidebar .btn.show-contact-btn { margin-top: 16px; }

  /* FULL WIDTH */
  body.home #main, #main,
  body.search #main, body.user #main,
  body.item #main, body.user-public-profile #main { width: 100%; }

  body.home #sidebar, #sidebar,
  body.search #sidebar, body.user #sidebar { width: 100%; margin-right: 0; }

  /* Edge-to-edge on mobile — a floating rounded card with margin on all
     sides wastes width on a small screen; fill it like a native app does. */
  body.search .wrapper { width: 100%; max-width: 100%; }
  body.search #content {
    padding: 14px; margin: 0; border-radius: 0;
    border-left: none; border-right: none; box-shadow: none;
    grid-template-columns: 1fr;
  }
  .list-header { margin-bottom: 14px; padding-bottom: 14px; }
  .list-header-top { flex-direction: column; gap: 12px; }
  .list-header h1 { font-size: 20px; line-height: 25px; }
  .list-header-search { max-width: 100%; }
  .list-header .quick-search { width: 100%; flex: 0 0 auto; }
  .list-header .counter-search { float: none; display: block; margin: 0 0 10px 0; }
  .list-header .actions { float: none; width: 100%; }
  .ad-slot-tall .ad-slot-box { height: 200px; }

  #home-regs .wrap > div { width: 50%; clear: none; padding-right: 15px; }

  /* FOOTER */
  footer .footer-cols { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  footer .footer-col-brand { grid-column: 1 / -1; }
  footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: .5rem; }
  footer .language { margin: 0; }

  .home-latest { margin: 0 0 10px 0; }
  .form-container-box { padding: 16px 0 0 0; }
  #related-searches { margin-top: 12px; }
  .counter-search { margin: 0 0 12px 0; }

  body.search .list-header .actions { float: left; width: 100%; }
  .show-filters-btn { float: left; padding: 10px 14px; height: 42px; font-size: 14px; }
  .btn.see_by { clear: none; }
  .see_by ul a { width: 100%; white-space: initial; }

  .item #comments { margin-bottom: 16px; padding: 18px; }
  #useful_info { margin-bottom: 0; }
  section { padding-bottom: 24px; }

  body.item-post #content { text-align: center; }
  body.item-post #content #main { max-width: 100%; text-align: left; float: none; display: inline-block; }
  body.item-post .form-container { padding: 24px 20px 28px 20px; border-radius: var(--radius-lg); }
  body.item-post .form-container .header h1 { font-size: 25px; line-height: 30px; }
  body.item-post .form-container .header { margin-bottom: 22px; padding-bottom: 18px; }
  .item.item-post h2 { margin-top: 28px; }
  .item.item-post .form-horizontal .actions .btn { width: 100%; }
  .item.item-post .form-horizontal label:not(.osp-chk) { padding: 0; margin: 0 0 4px 0; text-align: left; width: 100%; }
  .item.item-post .form-horizontal .controls { width: 100%; }
  .item-post .form-horizontal .control-group.img,
  .item.item-post h1, .item.item-post h2,
  .item-post .pblbt, .form-horizontal .controls.recpt { padding-left: 0; }
  .item-post .form-horizontal .controls.checkbox { margin-left: 0; }
  ul.user_menu li { display: inline-block; width: 100%; margin: 0; }
  .item-post .meta[data-type="CHECKBOX"] { padding-left: 0; padding-right: 0; }
}

/* ── SMALL MOBILE (max 490px) ───────────────────────────────── */
@media screen and (max-width: 490px) {

  .item-post select,
  .item-post input[type="text"],
  .item-post .meta select,
  .item-post .meta input,
  .item-post ul.checkbox-list { width: 100%; }
  .item-post input[type="text"]#price { width: calc(100% - 100px); }

  .main-search > .cell button { padding-left: 8px; padding-right: 8px; }
  .main-search > .cell button i { display: none; }

  .listing-card-list.listing-grid,
  body.search .listing-grid { width: calc(100% + 16px); margin-left: -8px; margin-right: -8px; }
  .listing-grid .listing-card,
  .similar_ads .listing-grid .listing-card,
  body.search .listing-grid .listing-card { width: calc(50% - 16px); margin: 0 8px 16px 8px; }

  #home-regs .wrap > div { width: 100%; padding-right: 0; }

  .see_by span { display: none; }

  .doublebutton { float: left; }
  .doublebutton a { float: left; margin: 0 5px 0 0; }

  .item-photos { gap: 6px; }
  .item-photos .thumbs { flex: 0 0 50px; width: 50px; }
  .item-photos .thumbs img { width: 50px; height: 50px; }
  .item-photos .main-photo { border-radius: 10px; }

  /* Listing card on mobile: no description, no location text, price moved
     onto the image as a bottom overlay badge instead of its own line — the
     text column left is just title + category/date, kept short enough
     (title clamped to 2 lines) that the row naturally lands close to the
     thumbnail's own 100px width. Thumb has no fixed/aspect-ratio height of
     its own — it uses the SAME default flex align-items:stretch as the
     desktop list view (see the .listing-card comment above) so it always
     fills the row's full height exactly, whatever that ends up being —
     that's what actually guarantees no gap under the image, at the minor
     cost of not being a mathematically perfect square on a rare
     two-line-title card. */
  .listing-list .listing-card { min-height: 100px; position: relative; }
  .listing-list .listing-thumb { flex: 0 0 100px; width: 100px; }
  .listing-list .listing-thumb img { min-height: 0; }
  .listing-list .listing-basicinfo { padding: 8px 10px; justify-content: flex-start; }
  .listing-list .listing-basicinfo .title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; white-space: normal;
  }
  .listing-list .listing-details { font-size: 11.5px; margin: 2px 0 0 0; }
  .listing-list .listing-details .location { display: none; }
  .listing-list .desc { display: none; }

  /* Price badge overlaid on the thumbnail's bottom edge. .currency-value
     sits inside .listing-detail, which comes after .listing-thumb in the
     DOM, so it paints on top with no z-index juggling needed — position it
     absolutely against .listing-card (the nearest positioned ancestor) at
     exactly the thumb's own width so it lines up over the image, not the
     text column beside it. */
  .listing-list .listing-card .currency-value {
    position: absolute; left: 0; bottom: 0; width: 100px; z-index: 2;
    margin: 0; padding: 4px 6px 5px 6px; text-align: center;
    font-size: 12px; line-height: 14px; font-weight: 800; color: #fff;
    background: linear-gradient(0deg, rgba(11,43,86,.82) 0%, rgba(11,43,86,0) 100%);
  }

  .form-horizontal label { width: 100%; text-align: left; line-height: 16px; margin: 0 0 4px 0; padding: 0; font-weight: 700; }
  .form-horizontal .controls { width: 100%; }
  .form-horizontal .actions { padding: 0; }

  .item #comments h3 { font-weight: normal; }
  .item #comments .header > h3 { padding-bottom: 16px; }
  .item #comments input[type="text"],
  .item #comments textarea { width: 100%; }
  .item #comments .reply-text { padding-left: 0; }

  body.user .form-horizontal .controls input[type="text"],
  body.user .form-horizontal .controls input[type="password"],
  body.user .form-horizontal .controls input[type="email"],
  body.user .form-horizontal .controls select,
  body.user .form-horizontal .controls textarea { width: 100%; }
  body.user .form-horizontal .control-group.bts { padding-left: 0; }

  .main-search > .cell { padding-right: 12px; }
  #sidebar .g-recaptcha { transform: scale(0.82); transform-origin: 0 0; }
  form[name="contact_form"] .g-recaptcha,
  form#item-post .g-recaptcha,
  .g-recaptcha { transform: scale(0.88); transform-origin: 0 0; margin-right: -50px; max-width: 260px; }

  #description .item-hook .table-attributes table td { width: 100%; display: inline-block; }
  #description .item-hook .table-attributes table td:first-child { width: 100%; }
  #description .item-hook .table-attributes table td:last-child { width: 100%; margin-bottom: 6px; }

  #custom_fields .meta strong { width: 100%; }
  #custom_fields .meta > span { margin-bottom: 6px; display: inline-block; width: 100%; }

  form[name="user-items-search"] { flex-wrap: wrap; }
  form[name="user-items-search"] .control-group { width: 50%; }
  form[name="user-public-profile-search"] { flex-wrap: wrap; }
  form[name="user-public-profile-search"] .control-group { width: 50%; }

  .form-container-box .control-group.act { margin-bottom: 20px; }

  /* FOOTER single column */
  footer .footer-cols { grid-template-columns: 1fr; gap: 1.25rem; }
  footer .footer-col-brand { grid-column: 1; }
}