/* ============================================================
   ART-AGRO B2B — Shared Responsive Stylesheet
   ============================================================ */

.catalog-layout { min-width: 0; }
.catalog-main { min-width: 0; overflow: hidden; }
.subcat-chips {
  display: flex !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  flex-wrap: nowrap !important;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  scroll-behavior: smooth;
}
.subcat-chips.dragging { cursor: grabbing; scroll-behavior: auto; }
.subcat-chips.dragging a,
.subcat-chips.dragging .subcat-chip { pointer-events: none; }
.subcat-chips::-webkit-scrollbar { display: none; }
.subcat-chip { white-space: nowrap; flex-shrink: 0; }

.mobile-nav-toggle {
  display: none;
  background: var(--green, #2b8a1c);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-nav-toggle svg { width: 22px; height: 22px; }

.mobile-search-toggle {
  display: none;
  background: var(--gray-05, #f6f6f4);
  border: 1.5px solid var(--gray-15, #e8e8e8);
  width: 40px;
  height: 40px;
  border-radius: 3px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-search-toggle svg { width: 18px; height: 18px; color: var(--gray-70, #555); }

.mobile-filter-toggle {
  display: none;
  background: var(--charcoal, #1a1e1a);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 1024px) {
  .inner { padding: 0 16px; }
  .header-phone span { display: none; }
  .header-phone { font-size: 14px; }
  .header-actions { gap: 12px; }
  .two-col { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .catalog-layout { grid-template-columns: 240px 1fr !important; gap: 0 !important; }
  .sidebar { top: 96px !important; }
  .product-section { grid-template-columns: 1fr 360px !important; gap: 20px !important; }
  .page-wrap .inner { grid-template-columns: 1fr 320px !important; gap: 16px !important; }
  .account-layout { grid-template-columns: 200px 1fr !important; gap: 16px !important; }
}

@media (max-width: 768px) {
  body { font-size: 13px; }
  .inner { padding: 0 12px; }
  .topbar { height: auto; padding: 6px 0; }
  .topbar .inner { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .topbar-left { gap: 10px; flex-wrap: wrap; justify-content: center; }
  .topbar-left a:not(:first-child) { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-right span:first-child { display: none; }
  .lang-switch { display: none; }
  .header { height: auto; padding: 10px 0; }
  .header .inner { flex-wrap: wrap; gap: 10px; }
  .logo img { height: 36px; }
  .search-wrap { display: none; }
  .search-wrap.mobile-open {
    display: flex !important;
    order: 99;
    width: 100%;
    flex-basis: 100%;
    max-width: 100%;
  }
  .header-phone { display: none; }
  .header-actions { gap: 8px; margin-left: auto; }
  .header-icon-btn { padding: 4px; font-size: 0; }
  .header-icon-btn svg { width: 22px; height: 22px; }
  .mobile-search-toggle { display: flex; }
  .mobile-nav-toggle { display: flex; }
  .mainnav {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 80%;
    max-width: 320px;
    z-index: 1000;
    background: var(--green, #2b8a1c);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .mainnav.mobile-open { display: block; }
  .mainnav .inner {
    flex-direction: column;
    align-items: stretch;
    padding: 60px 0 20px;
    max-width: 100%;
  }
  .mainnav a {
    height: auto;
    padding: 14px 20px;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,.12);
    font-size: 14px;
  }
  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
  }
  .mobile-nav-backdrop.mobile-open { display: block; }
  .mobile-nav-close {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .breadcrumb .inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .breadcrumb .inner::-webkit-scrollbar { display: none; }
  .page-body { padding: 16px 12px !important; }
  .hero { padding: 32px 16px !important; }
  .hero h1 { font-size: 24px !important; line-height: 1.2 !important; }
  .hero p { font-size: 14px !important; }
  .hero-stats { flex-wrap: wrap !important; gap: 16px !important; }
  .category-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .cat-card { padding: 14px 10px !important; }
  .two-col { grid-template-columns: 1fr !important; gap: 16px !important; }
  .product-row { grid-template-columns: 56px 1fr !important; gap: 10px !important; }
  .product-row > *:nth-child(3),
  .product-row > *:nth-child(4) { grid-column: 1 / -1 !important; margin-top: 4px !important; }
  .product-row > *:nth-child(3) { text-align: left !important; }
  .brand-row { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .footer { padding: 24px 12px 12px !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 20px !important; padding: 0 !important; }
  .footer-bottom { flex-direction: column !important; gap: 10px !important; text-align: center !important; padding: 16px 0 0 !important; }
  .catalog-layout { grid-template-columns: 1fr !important; gap: 0 !important; }
  .sidebar, .catalog-sidebar {
    display: none !important;
    position: fixed !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: auto !important;
    width: 90% !important; max-width: 360px !important;
    height: 100vh !important;
    z-index: 1000 !important;
    background: #fff !important;
    overflow-y: auto !important;
    box-shadow: -4px 0 20px rgba(0,0,0,.3) !important;
    border-right: none !important;
    padding-top: 50px !important;
  }
  .sidebar.mobile-open, .catalog-sidebar.mobile-open { display: block !important; }
  .mobile-filter-toggle { display: flex !important; }
  .sidebar .filter-section .filter-body { display: none; }
  .sidebar .filter-section.open .filter-body { display: flex; }
  .sidebar .filter-section .filter-header span:last-child { transition: transform .15s; }
  .sidebar .filter-section .filter-header span:last-child { font-size: 0; }
  .sidebar .filter-section .filter-header span:last-child::before { content: '▸'; font-size: 11px; }
  .sidebar .filter-section.open .filter-header span:last-child::before { content: '▾'; }
  .subcat-chips { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 4px; }
  .catalog-toolbar { flex-wrap: wrap !important; gap: 8px !important; padding: 10px 0 !important; }
  .product-card-list { grid-template-columns: 80px 1fr !important; gap: 10px !important; padding: 10px !important; }
  .product-right { grid-column: 1 / -1 !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; padding-top: 10px !important; border-top: 1px dashed var(--gray-15) !important; margin-top: 4px !important; }
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .product-section { grid-template-columns: 1fr !important; gap: 16px !important; }
  .buy-panel { position: static !important; padding: 16px !important; }
  .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-nav::-webkit-scrollbar { display: none; }
  .page-wrap .inner { grid-template-columns: 1fr !important; gap: 16px !important; }
  .steps-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap !important; }
  .steps-bar::-webkit-scrollbar { display: none; }
  .cart-item { grid-template-columns: 60px 1fr !important; gap: 10px !important; padding: 12px !important; position: relative; }
  .cart-item input[type=checkbox] { display: none; }
  .qty-ctrl, .item-price-col { grid-column: 1 / -1 !important; }
  .item-price-col { display: flex !important; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px dashed var(--gray-15); margin-top: 4px; }
  .item-remove { position: absolute !important; top: 8px; right: 8px; }
  .summary-panel { position: static !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .account-layout { grid-template-columns: 1fr !important; gap: 16px !important; }
  .account-nav { position: static !important; }
  .order-table { font-size: 12px; }
  .order-table thead { display: none; }
  .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; }
  .order-table tr { border-bottom: 1px solid var(--gray-15); padding: 10px 14px; }
  .order-table td { border-bottom: none !important; padding: 3px 0 !important; display: flex; justify-content: space-between; align-items: center; }
  .order-table td::before { content: attr(data-label); font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--gray-40); letter-spacing: 0.4px; margin-right: 8px; }
  .address-grid { grid-template-columns: 1fr !important; padding: 12px !important; }
  .company-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .product-grid { grid-template-columns: 1fr !important; }
  .related-grid { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 20px !important; }
  .hero-stats { gap: 10px !important; }
  .hero-stat-val { font-size: 18px !important; }
}

.mobile-nav-close { display: none; }
@media (max-width: 768px) {
  .mainnav.mobile-open .mobile-nav-close { display: flex; }
  .sidebar.mobile-open .mobile-sidebar-close,
  .catalog-sidebar.mobile-open .mobile-sidebar-close { display: flex; }
  .mobile-sidebar-close {
    background: rgba(0,0,0,.08);
    color: #000;
  }
}
