/* ============================================================
   2mm.ART — Responsive Fixes v4
   Addresses: /shop.php, /services.php, all pages
   RTL/LTR language switching
   ============================================================ */

/* ── Mobile-first base ───────────────────────────────────────────────────── */
@media (max-width:1200px) {
  .container { padding: 0 20px; }
  .footer-inner { gap: 2rem; }
}

@media (max-width:1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual  { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .catalogues-grid { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
  .products-grid   { grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); }
  .services-grid   { grid-template-columns: 1fr 1fr; }
}

@media (max-width:900px) {
  /* Navbar */
  .nav-links   { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile  { display: flex; }
  .nav-username { display: none; }
  .nav-inner   { gap: .75rem; }

  /* Shop layout — sidebar goes on top */
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
  }
  .shop-sidebar h4 { width: 100%; margin: 0; }
  .search-form { flex: 1; min-width: 200px; }
  .cat-link { padding: .3rem .65rem; font-size: .78rem; white-space: nowrap; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }

  /* B2B strip */
  .b2b-content  { flex-direction: column; gap: 1.5rem; text-align: center; }

  /* Dashboard */
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-nav    { position: static; }
  .dashboard-nav nav { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; }

  /* Cart */
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary-panel { position: static; }
}

@media (max-width:768px) {
  /* Hero */
  .hero { padding: 52px 16px; min-height: auto; }
  .hero h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  .hero p  { font-size: .95rem; }
  .hero-stats { gap: 1.5rem; }

  /* Product page */
  .product-layout { grid-template-columns: 1fr; gap: 2rem; }
  .gallery-thumbs { gap: .35rem; }
  .thumb { width: 58px; height: 58px; }

  /* Contact */
  .contact-layout { grid-template-columns: 1fr; }

  /* Cart rows */
  .cart-row { grid-template-columns: 64px 1fr auto; gap: .6rem; }
  .cart-row-qty   { grid-column: 2; }
  .cart-row-total { grid-column: 3; grid-row: 1; align-self: start; }
  .cart-row-remove{ grid-column: 3; grid-row: 2; }

  /* Admin */
  .layout { grid-template-columns: 1fr; }
  .sb { position: static; height: auto; }
  .grid2,.grid3 { grid-template-columns: 1fr; }
}

@media (max-width:540px) {
  /* Typography */
  h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); }
  h2 { font-size: clamp(1.1rem, 4vw, 1.5rem); }

  /* Buttons */
  .hero-btns, .cta-btns, .product-actions { flex-direction: column; }
  .hero-btns .btn-primary, .hero-btns .btn-outline { width: 100%; }

  /* Steps */
  .steps-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; gap: .4rem; }

  /* Forms */
  .form-row, .dims-row { grid-template-columns: 1fr; }

  /* Catalogue */
  .catalogues-grid { grid-template-columns: 1fr; }

  /* WhatsApp FAB position */
  .wa-fab { bottom: 16px; right: 12px; }
}

/* ── RTL / Arabic ────────────────────────────────────────────────────────── */
body.ar {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Kufi Arabic', 'Cairo', system-ui, sans-serif;
}

/* Navbar RTL */
body.ar .nav-inner    { flex-direction: row-reverse; }
body.ar .nav-links    { flex-direction: row-reverse; }
body.ar .nav-actions  { flex-direction: row-reverse; }
body.ar .nav-mobile a { text-align: right; }

/* Page structure RTL */
body.ar .hero-content     { direction: rtl; }
body.ar .hero p           { text-align: right; }
body.ar .section-header   { flex-direction: row-reverse; }
body.ar .b2b-content      { flex-direction: row-reverse; }

/* Products RTL */
body.ar .product-tag { left: auto; right: 10px; }
body.ar .eco-badge   { right: auto; left: 10px; }
body.ar .product-footer { flex-direction: row-reverse; }
body.ar .product-actions { justify-content: flex-end; }

/* Shop sidebar RTL */
body.ar .shop-layout { direction: rtl; }
body.ar .cat-link    { text-align: right; border-left: none; border-right: 3px solid transparent; }
body.ar .cat-link.active { border-right-color: var(--brand); }

/* Product detail RTL */
body.ar .breadcrumb { direction: rtl; }
body.ar .gallery-thumbs { flex-direction: row-reverse; }
body.ar .swatch-label { flex-direction: row-reverse; }
body.ar .product-short-desc { text-align: right; }

/* Forms RTL */
body.ar .form-group label { text-align: right; }
body.ar .form-row { direction: rtl; }
body.ar .dims-row { direction: rtl; }
body.ar .form-check label { flex-direction: row-reverse; }
body.ar select { text-align: right; direction: rtl; }

/* Cart RTL */
body.ar .cart-layout    { direction: rtl; }
body.ar .cart-row       { direction: rtl; }
body.ar .cart-row-total { text-align: left; }
body.ar .cart-summary-panel { direction: rtl; }
body.ar .summary-line { flex-direction: row-reverse; }

/* Dashboard RTL */
body.ar .dashboard-layout { direction: rtl; }
body.ar .dashboard-nav nav a { text-align: right; border-left: none; border-right: 3px solid transparent; }
body.ar .dashboard-nav nav a:hover { border-right-color: var(--brand); }
body.ar .order-header { flex-direction: row-reverse; }
body.ar .order-date { margin-right: auto; margin-left: 0; }
body.ar .order-body { flex-direction: row-reverse; }

/* Footer RTL */
body.ar .footer-inner    { direction: rtl; }
body.ar .footer-bottom   { flex-direction: row-reverse; }
body.ar .footer-links a  { text-align: right; }
body.ar .footer-contact a, body.ar .footer-contact p { text-align: right; }
body.ar .social-links { flex-direction: row-reverse; }

/* Services RTL */
body.ar .services-grid  { direction: rtl; }
body.ar .service-card   { text-align: right; }
body.ar .service-deliverables li { flex-direction: row-reverse; }

/* Auth RTL */
body.ar .type-tabs   { direction: rtl; }
body.ar .login-form, body.ar .reg-form { direction: rtl; text-align: right; }

/* WhatsApp FAB — flip for RTL */
body.ar .wa-fab { right: auto; left: 24px; }
body.ar .wa-fab-tooltip { right: auto; left: calc(100% + 10px); }
@media (max-width: 768px) {
  body.ar .wa-fab { right: auto; left: 16px; }
}

/* Announcement bar */
body.ar .announcement-bar { direction: rtl; }

/* Step cards RTL */
body.ar .steps-grid { direction: rtl; }
body.ar .step-card  { text-align: right; }

/* Catalogue RTL */
body.ar .catalogues-grid { direction: rtl; }
body.ar .catalogue-card  { text-align: right; }
body.ar .cat-cta { direction: ltr; display: inline-block; } /* keep arrow direction */

/* Hero RTL */
body.ar .hero-stats { flex-direction: row-reverse; }
body.ar .hero-badge { direction: rtl; }

/* Nav user dropdown RTL */
body.ar .nav-user-dropdown { right: auto; left: 0; }

/* Mobile nav RTL */
@media (max-width: 900px) {
  body.ar .nav-inner { flex-direction: row-reverse; }
  body.ar .nav-mobile { direction: rtl; }
}
