/*
 * mobile.css - Mobile-friendly overrides
 * All styles are scoped to max-width: 768px
 * Desktop layout is completely untouched.
 */

/* Hide hamburger button on desktop */
#mobile-menu-toggle {
  display: none;
}

/* Hide filters toggle button on desktop */
#mobile-filters-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* ============================================
     Base
  ============================================ */
  html, body {
    overflow-x: hidden;
  }

  .container {
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* Make all Bootstrap columns full-width by default on mobile */
  [class*="col-md-"],
  [class*="col-lg-"] {
    width: 100% !important;
    float: none !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* ============================================
     Header Informations Bar
  ============================================ */
  #header-informations {
    padding: 5px 0;
  }

  #header-informations .informations {
    float: none !important;
    text-align: center;
    padding: 0 10px;
  }

  #header-informations .informations li {
    float: none !important;
    display: block;
    line-height: 32px;
    font-size: 14px;
    margin-right: 0;
    border-bottom: 1px solid #eee;
  }

  #header-informations .informations li:last-child {
    border-bottom: none;
  }

  /* ============================================
     Header: Logo + Search
  ============================================ */
  #header {
    margin-bottom: 10px;
  }

  #header #logo {
    float: none !important;
    display: block;
    text-align: center;
    height: auto;
    line-height: normal;
    margin-bottom: 10px;
  }

  #header #logo img {
    height: 45px;
  }

  #header #search {
    float: none !important;
    padding-top: 0;
    text-align: center;
  }

  #header #search form {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  #header #search input[type=text] {
    float: none !important;
    width: auto !important;
    flex: 1;
    margin-right: 0 !important;
  }

  #header #search input[type=submit] {
    float: none !important;
    width: 80px;
    height: 35px;
  }

  /* ============================================
     Navigation - Hamburger Menu
  ============================================ */
  #mobile-menu-toggle {
    display: block;
    width: 100%;
    background: linear-gradient(to bottom, #21a1e8 0%, #03689e 100%);
    color: white;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 5px;
    padding: 11px 15px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,.46);
    letter-spacing: 0.5px;
  }

  #mobile-menu-toggle::before {
    content: '☰  ';
    font-size: 18px;
  }

  #mobile-menu-toggle.open::before {
    content: '✕  ';
  }

  #nav {
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
  }

  #nav ul {
    display: none;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #03689e;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    width: 100% !important;
  }

  #nav ul.mobile-open {
    display: block;
  }

  #nav ul li {
    float: none !important;
    width: 100% !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.15) !important;
    display: block;
  }

  #nav ul li:last-child {
    border-bottom: none !important;
  }

  #nav ul li a {
    height: auto !important;
    max-height: none !important;
    line-height: 1.4 !important;
    padding: 12px 20px !important;
    display: block;
    font-size: 14px;
  }

  #nav ul li:hover a,
  #nav ul li.active a {
    background-color: #0469a0 !important;
    padding-left: 28px !important;
  }

  /* ============================================
     Slider / Banner (Home)
  ============================================ */
  .bend.niceties {
    overflow: hidden;
  }

  .bend.niceties img {
    width: 100% !important;
    height: auto !important;
  }

  /* ============================================
     Home: Category Features Grid
  ============================================ */
  .row.features [class*="col-md-3"] {
    width: 50% !important;
    float: left !important;
    padding: 5px !important;
    box-sizing: border-box;
  }

  .features h3 {
    height: auto !important;
    line-height: 1.3;
    font-size: 14px;
  }

  /* ============================================
     Home: Testimonials + Latest Arrivals
  ============================================ */
  .gradient-container {
    display: none !important;
  }

  /* ============================================
     Home: News Ticker
  ============================================ */
  #news .caroufredsel_wrapper {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    overflow: visible !important;
  }

  #news .caroufredsel_wrapper ul {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  #news .caroufredsel_wrapper ul li {
    width: 100% !important;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
  }

  #news .news-arrow-next,
  #news .news-arrow-prev {
    display: none !important;
  }

  /* ============================================
     CATEGORIES / PRODUCTS LIST PAGE
     Layout: sidebar (col-md-3) + list (col-md-9)
  ============================================ */

  /* Sidebar filters - collapsible on mobile */
  #stock-sidebar {
    margin-bottom: 15px;
  }

  /* "Filters" toggle button */
  #mobile-filters-toggle {
    display: block;
    width: 100%;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: left;
    cursor: pointer;
    margin-bottom: 5px;
  }

  #mobile-filters-toggle::after {
    content: ' ▼';
    font-size: 11px;
    float: right;
  }

  #mobile-filters-toggle.open::after {
    content: ' ▲';
  }

  /* Hide all filter items by default, show only when open */
  #stock-sidebar-inner {
    display: none !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fafafa;
  }

  #stock-sidebar-inner.open {
    display: block !important;
  }

  #stock-sidebar .sidebar-item {
    margin-bottom: 10px;
  }

  #stock-sidebar .sidebar-heading {
    font-size: 13px;
    padding: 6px 12px;
  }

  #stock-sidebar .nav-stacked li a {
    padding: 4px 10px;
    font-size: 13px;
  }

  /* Page title + sort inline row */
  .page-header {
    margin-bottom: 10px;
  }

  .page-header h1 {
    float: none !important;
    font-size: 16px;
    margin-bottom: 5px;
  }

  #sorting {
    float: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  #sorting p {
    margin: 0;
    white-space: nowrap;
  }

  #sorting select {
    flex: 1;
    max-width: 200px;
  }

  /* Products grid: one per row on mobile */
  #machine-list {
    margin: 0 0 20px;
  }

  #machine-list li {
    width: 100% !important;
    float: none !important;
    height: auto !important;
    padding: 12px 0;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  #machine-list li .row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  #machine-list li h3 {
    width: 100% !important;
    font-size: 15px !important;
    margin-bottom: 6px;
  }

  #machine-list .image {
    flex: 0 0 auto;
    width: 110px !important;
  }

  #machine-list .image img {
    width: 110px !important;
    height: 85px !important;
    object-fit: cover;
  }

  #machine-list .image .sold img {
    width: 55px !important;
    height: 50px !important;
  }

  #machine-list .spec {
    flex: 1;
    width: auto !important;
    padding-left: 5px;
    font-size: 12px;
  }

  #machine-list .spec p {
    margin-bottom: 2px;
  }

  #machine-list .sheet {
    width: 100% !important;
    text-align: left !important;
    padding-right: 0 !important;
  }

  .products-subcat {
    min-height: 0 !important;
  }

  /* ============================================
     PRODUCT DETAIL PAGE
  ============================================ */

  /* Main product layout: specs left, photos right → stack vertically */
  #machine-slider {
    margin-left: 0 !important;
    margin-bottom: 15px;
  }

  #machine-slider #machine-big {
    width: 100% !important;
    height: auto !important;
    padding-left: 0 !important;
  }

  #machine-slider #machine-big img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }

  #thumb-images {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #thumb-images ul {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0;
  }

  #thumb-images li {
    float: none !important;
    margin-left: 0 !important;
  }

  #thumb-images li img {
    height: 45px;
  }

  .border-images {
    width: 60px;
  }

  .machine-description {
    margin-top: 15px;
  }

  /* Specs table */
  .table-specs {
    font-size: 13px;
    width: 100%;
  }

  /* Tabs (Description tab) */
  .tab-custom {
    display: flex;
    flex-wrap: wrap;
  }

  .tab-custom li {
    flex: 1;
    text-align: center;
  }

  /* Enquire / Request form on product detail */
  .form-horizontal .col-lg-2,
  .form-horizontal .col-lg-10,
  .form-horizontal .col-lg-offset-2 {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .form-horizontal .control-label {
    text-align: left !important;
    padding-bottom: 4px;
    font-weight: bold;
  }

  .form-horizontal .form-group {
    margin-bottom: 12px;
  }

  /* Other Machinery sidebar on product detail */
  .machines-rand li {
    padding: 10px 0;
  }

  .machines-rand li img {
    width: 38% !important;
  }

  .machines-rand li .info {
    width: 58% !important;
  }

  .machines-rand li .info h3 {
    font-size: 13px;
  }

  /* ============================================
     CONTACT US / STATIC PAGES
     (contact-us, about-us, export-transport, faq)
  ============================================ */

  /* Contact form sidebar stacks below content */
  #sidebar {
    margin-top: 20px;
  }

  /* Contact form labels + inputs: stack vertically */
  .form-horizontal .col-md-4,
  .form-horizontal .col-md-8 {
    width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .form-horizontal .col-md-offset-4 {
    margin-left: 0 !important;
  }

  .form-horizontal label.control-label {
    text-align: left !important;
    padding-bottom: 4px;
    font-weight: bold;
  }

  /* Map image on contact page */
  #contact-maps iframe,
  #contact-maps img,
  .text-center img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Static page content (about-us, FAQ, etc.) */
  .static.php .col-md-7 {
    width: 100% !important;
  }

  /* ============================================
     ABOUT US / EXPORT-TRANSPORT page
     (full-width text, no sidebar)
  ============================================ */
  /* These pages already use a full-width div, no extra overrides needed
     beyond the global col-md reset at the top */

  /* ============================================
     Sidebar Stock Widget (products page)
  ============================================ */
  .content-wrapper #stock-widget {
    margin-right: 0 !important;
    margin-bottom: 20px;
  }

  /* ============================================
     Footer
  ============================================ */
  #footer {
    padding: 30px 0;
  }

  #footer .footer-logo {
    width: 100% !important;
    float: none !important;
    text-align: center;
    padding: 0 0 15px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 15px;
  }

  #footer .footer-links {
    width: 100% !important;
    float: none !important;
    text-align: left;
  }

  #footer .footer-links h3 {
    font-size: 14px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
  }

  /* ============================================
     Clients / Partners Banner
  ============================================ */
  #clients img {
    max-width: 100%;
    height: auto;
  }

} /* End @media (max-width: 768px) */
