/* =========================================================
   MOBILE STYLES — Up to 768px
   ========================================================= */
@media (max-width: 768px) {

  html {
    scroll-behavior: auto;
  }

  /* ================= HEADER ================= */
  .logo {
    max-height: 50px;
  }
  .brand span {
    font-size: 0.9rem;
  }

  /* ================= MENU TOGGLE ================= */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--accent-main);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0;
    padding: 10px 12px;
    position: relative;
    z-index: 1002;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
  }

  .menu-toggle::before {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    pointer-events: none;
  }

  .menu-toggle::after {
    display: none;
  }

  .menu-toggle[aria-expanded="true"]::before {
    box-shadow: none;
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle[aria-expanded="true"]::after {
    content: '';
    display: block;
    position: absolute;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: rotate(-45deg);
  }

  /* ================= MOBILE NAV ================= */
  .nav {
    display: none;
    position: fixed;
    top: 80px;
    inset-inline: 0;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--accent-main);
    flex-direction: column;
    padding: 0;
    gap: 0;
    box-shadow: var(--shadow-md);
    z-index: 1001;
    align-items: stretch;
    will-change: transform; 
  }

  .nav.active {
    display: flex;
  }

  /* ================= NAV LINKS ================= */
  .nav a {
    padding: 16px 20px;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--primary);
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
  }

  .nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-main);
    transition: width 0.2s ease;
  }

  .nav a:hover,
  .nav a:active {
    color: var(--accent);
  }

  .nav a:hover::after {
    width: 60%;
  }

  /* ================= CARD & IMAGE FIXES ================= */
  .card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 200px;
    padding: 0.8rem;
    flex: 1 1 auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    contain: content;
    transition: transform var(--transition-fast);
  }

  .card:hover {
    transform: translateY(-2px);
  }

  .businesses {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
  }

  .icon {
    width: 40px;
    color: var(--primary);
    margin-bottom: 0.5rem;
  }

  .card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }

  .card p {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .card-link {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  /* ================= IMAGE OPTIMIZATION ================= */
  .product-image-container,
  .image-container {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111; /* lightweight placeholder */
  }

  .product-image,
  .card img,
  .image-container img,
  [class*="product-"] img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    display: block;
  }

  .card img[src$=".svg"] {
    object-fit: contain;
    background-color: transparent;
    fill: var(--primary);
  }

  /* ================= MOBILE PERFORMANCE ================= */
  .product-card {
    contain: content;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    will-change: auto;
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .product-card:hover {
    transform: none;
  }

  .header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg-surface);
  }

  .header.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hero::before {
    display: none;
  }

  .btn-primary {
    box-shadow: none;
    will-change: auto;
  }

  .btn-primary:hover {
    box-shadow: none;
    transform: none;
  }

  .cart-item:hover {
    transform: none;
    box-shadow: none;
  }

  .card:hover {
    transform: none;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* ================= HERO ================= */
  .hero {
    padding: 70px 6%;
    gap: 20px;
    text-align: center;
  }

  .hero h2 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 16px;
  }

  .hero h2 br {
    display: none;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  /* ================= BUTTONS ================= */
  .buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  /* ================= FOOTER ================= */
  footer {
    padding: 20px 5%;
    font-size: 0.85rem;
    text-align: center;
  }

  /* ================= CART ================= */
  .cart-sidebar {
    width: 100%;
    right: -100%;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
  }

  .cart-sidebar.active {
    right: 0;
  }

  .cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .cart-close,
  .remove-btn,
  .qty-controls button {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    font-size: 0;
    line-height: 0;
    position: relative;
  }

  /* Cart close — clean × */
  .cart-close::before,
  .cart-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }

  .cart-close::before { transform: rotate(45deg); }
  .cart-close::after  { transform: rotate(-45deg); }

  /* Remove / delete button — red trash indicator (two lines) */
  .remove-btn::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 12px;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 3px 3px;
    bottom: 13px;
  }

  .remove-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    top: 13px;
  }

  /* Qty minus button — bold − */
  .qty-controls button.dec::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
  }

  /* Qty plus button — bold + */
  .qty-controls button.inc::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
  }

  .qty-controls button.inc::after {
    content: '';
    position: absolute;
    width: 2.5px;
    height: 14px;
    background: currentColor;
    border-radius: 2px;
  }
  /* ================= IMAGE ZOOM & MODAL ================= */
  .image-zoom-container,
  .modal-content {
    max-width: 95vw;
    max-height: 90vh;
    padding: 20px;
    overflow-y: auto;
  }

  .image-zoom-content,
  .modal-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* =========================================================
   EXTRA SMALL DEVICES — Below 480px
   ========================================================= */
@media (max-width: 480px) {
  .header {
    height: 60px;
    padding: 0.5rem 4%;
  }

  .logo {
    max-height: 45px;
  }

  .brand span {
    font-size: 0.8rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .card {
    max-width: 160px;
    padding: 0.6rem;
  }

  .icon {
    width: 30px;
    margin-bottom: 0.4rem;
  }
}

/* =========================================================
   TABLETS & SMALL SCREENS — 769px to 900px
   ========================================================= */
@media (min-width: 769px) and (max-width: 900px) {
  .products-grid,
  .fleet-grid {
    grid-template-columns: 1fr;
  }

  .card img {
    width: 100%;
    height: 100%;
  }
}

/* ================= IMAGE PERFORMANCE FIX ================= */
/* Ensure containment works on mobile */
.product-card {
  contain: content;
}


