/* ========================================================
   ApexCatalog - Production Showcase Stylesheet
   Modern, Clean, Responsive B2B Product Catalog
   ======================================================== */

:root {
  --primary-color: #1e3a8a;       /* Deep navy blue */
  --primary-hover: #172554;
  --secondary-color: #0284c7;     /* Industrial cyan/sky */
  --accent-color: #0ea5e9;
  --whatsapp-color: #25d366;
  --whatsapp-hover: #20ba59;
  --dark-slate: #0f172a;
  --text-primary: #1e293b;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-radius: 10px;
  --transition-speed: 0.25s ease;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ----------------- Top Header Bar ----------------- */
.top-header-bar {
  background-color: var(--dark-slate);
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-header-bar a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color var(--transition-speed);
}
.top-header-bar a:hover {
  color: #ffffff;
}

/* ----------------- Site Header & Navigation ----------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.desktop-navigation {
  background-color: #ffffff;
  padding: 14px 0;
}

.navbar-custom {
  background-color: #ffffff;
  padding: 14px 0;
}
.navbar-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary-color) !important;
  letter-spacing: -0.5px;
}
.brand-badge {
  background: var(--primary-color);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.navbar-custom .nav-link,
.desktop-nav-links .nav-link {
  color: #334155;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px !important;
  border-radius: 6px;
  transition: all var(--transition-speed);
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active,
.desktop-nav-links .nav-link:hover,
.desktop-nav-links .nav-link.active {
  color: var(--primary-color);
  background-color: #f1f5f9;
}
.nav-search-form {
  max-width: 280px;
  position: relative;
}
.nav-search-input {
  border-radius: 20px;
  padding-left: 36px;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
  background-color: #f8fafc;
}
.nav-search-input:focus {
  background-color: #ffffff;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ----------------- Dedicated Mobile & Tablet Header (< 1024px) ----------------- */
.mobile-header-wrapper {
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  box-sizing: border-box;
}

.mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  box-sizing: border-box;
  background-color: #ffffff;
  position: relative;
}

/* Logo MUST remain inside flex row, vertical center, no negative margin, no upward shift */
.mobile-logo {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  bottom: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 0 !important;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary-color) !important;
}

.mobile-logo-text {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Mobile Search Icon Button */
.mobile-search-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-search-button:hover,
.mobile-search-button:focus-visible {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

/* Mobile Quick Enquiry Button (Tablet) */
.mobile-action-enquiry {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f0fdf4;
  color: #16a34a;
  font-size: 1.25rem;
  text-decoration: none;
  transition: background 0.2s ease;
}
.mobile-action-enquiry:hover {
  background: #dcfce7;
  color: #15803d;
}

/* 44x44px 3-Line Hamburger Menu Button */
.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  transition: background 0.2s ease;
}
.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  background-color: #f1f5f9;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background-color: #0f172a;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

/* Hamburger to X Transform Animation */
.mobile-menu-toggle.menu-open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.mobile-menu-toggle.menu-open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.menu-open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Expandable Search Drawer */
.mobile-search-drawer {
  display: block;
  position: static;
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  box-sizing: border-box;
}
.mobile-search-drawer[hidden] {
  display: none !important;
}

/* Mobile Navigation Menu (Normal document flow, strictly below header row) */
.mobile-navigation {
  display: block;
  position: static;
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}
.mobile-navigation[hidden] {
  display: none !important;
}

.mobile-nav-link {
  display: block;
  width: 100%;
  padding: 14px 18px;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}
.mobile-nav-link:hover,
.mobile-nav-link:focus {
  background-color: #f8fafc;
  color: var(--primary-color);
}
.mobile-nav-link.active {
  color: var(--primary-color);
  background-color: #eff6ff;
  border-left: 4px solid var(--primary-color);
}

/* Desktop vs Mobile/Tablet Breakpoint (1024px) */
@media (min-width: 1024px) {
  .desktop-navigation {
    display: block !important;
  }
  .mobile-header-wrapper {
    display: none !important;
  }
}
@media (max-width: 1023.98px) {
  .desktop-navigation {
    display: none !important;
  }
  .mobile-header-wrapper {
    display: block !important;
  }
}

@media (max-width: 380px) {
  .mobile-logo-text {
    font-size: 0.98rem;
    max-width: 130px;
  }
  .mobile-logo i {
    font-size: 1.25rem !important;
  }
  .brand-badge {
    padding: 2px 4px;
    font-size: 0.65rem;
  }
  .mobile-header-row {
    padding: 8px 12px;
  }
}

/* ----------------- Hero Showcase Banner ----------------- */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 90px 0;
  overflow: hidden;
}
.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: #cbd5e1;
  max-width: 620px;
  margin-bottom: 35px;
}
.hero-card-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-card-preview img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.hero-card-preview:hover img {
  transform: scale(1.03);
}

/* ----------------- Section Headers ----------------- */
.section-tag {
  display: inline-block;
  color: var(--secondary-color);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.section-subtitle {
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 40px auto;
  font-size: 1.05rem;
}

/* ----------------- Category Cards ----------------- */
.category-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary-color);
  color: inherit;
}
.category-img-wrap {
  height: 170px;
  overflow: hidden;
  position: relative;
  background-color: #f1f5f9;
}
.category-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}
.category-card:hover .category-img-wrap img {
  transform: scale(1.06);
}
.category-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.category-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.category-count {
  font-size: 0.85rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-top: auto;
}

/* ----------------- Product Cards ----------------- */
.product-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}
.product-img-wrapper {
  position: relative;
  height: 230px;
  background-color: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-img-wrapper img {
  transform: scale(1.05);
}
.badge-featured {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.product-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.product-category-link {
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: none;
}
.product-sku-tag {
  color: var(--text-muted);
  font-family: monospace;
}
.product-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.35;
}
.product-title a {
  color: inherit;
  text-decoration: none;
}
.product-title a:hover {
  color: var(--primary-color);
}
.product-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}
.product-actions-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* ----------------- Buttons ----------------- */
.btn-primary-custom {
  background-color: var(--primary-color);
  color: #ffffff;
  border: 1px solid var(--primary-color);
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 18px;
  transition: all var(--transition-speed);
}
.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}
.btn-outline-custom {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid #cbd5e1;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
  transition: all var(--transition-speed);
}
.btn-outline-custom:hover {
  background-color: #f1f5f9;
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.btn-whatsapp {
  background-color: var(--whatsapp-color);
  color: #ffffff;
  border: 1px solid var(--whatsapp-color);
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 18px;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
  border-color: var(--whatsapp-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ----------------- Product Details Page ----------------- */
.details-gallery-main {
  width: 100%;
  height: 440px;
  background-color: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.details-gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.gallery-thumbs-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.gallery-thumb-item {
  width: 75px;
  height: 75px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
  flex-shrink: 0;
  transition: all var(--transition-speed);
}
.gallery-thumb-item.active,
.gallery-thumb-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.gallery-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-specs-table th {
  background-color: #f8fafc;
  color: var(--text-primary);
  font-weight: 600;
  width: 35%;
  border-color: var(--border-color);
}
.details-specs-table td {
  border-color: var(--border-color);
}

.feature-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.feature-icon-check {
  color: #10b981;
  font-size: 1.15rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ----------------- Floating WhatsApp Button ----------------- */
.floating-whatsapp-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--whatsapp-color);
  color: #ffffff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  z-index: 999;
  text-decoration: none;
  transition: all var(--transition-speed);
}
.floating-whatsapp-btn:hover {
  background-color: var(--whatsapp-hover);
  color: #ffffff;
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.6);
}

/* ----------------- Footer ----------------- */
.site-footer {
  background-color: #0b1120;
  color: #94a3b8;
  padding: 60px 0 24px 0;
  margin-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer h5 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 10px;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-speed);
}
.footer-links a:hover {
  color: #ffffff;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 0.85rem;
}

/* ----------------- Admin Styling & Mobile-Friendly Navigation Drawer ----------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Mobile & Tablet Topbar (< 1024px) */
.admin-mobile-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  min-height: 60px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0 16px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-menu-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  transition: background 0.2s ease;
}
.admin-menu-toggle:hover,
.admin-menu-toggle:focus-visible {
  background-color: rgba(255, 255, 255, 0.1);
}
.admin-menu-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
.admin-menu-toggle.menu-open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.admin-menu-toggle.menu-open span:nth-child(2) {
  opacity: 0;
}
.admin-menu-toggle.menu-open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Admin Sidebar Overlay (Backdrop for mobile/tablet drawer) */
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1090;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.admin-sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

body.admin-menu-open {
  overflow: hidden;
}

/* Admin Sidebar Defaults */
.admin-sidebar {
  background-color: #0f172a;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.admin-sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav-item {
  color: #94a3b8;
  text-decoration: none;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: all var(--transition-speed);
}
.admin-nav-item:hover,
.admin-nav-item.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
  border-left-color: var(--secondary-color);
}

.admin-main-content {
  flex-grow: 1;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.admin-topbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-page-body {
  padding: 24px;
  flex-grow: 1;
}

/* Responsive Table Wrapper */
.admin-table-wrapper,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Metric Cards Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .admin-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Metric Cards */
.metric-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.metric-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* Breakpoint rules: Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .admin-layout {
    flex-direction: row;
  }
  .admin-sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    transform: none !important;
    box-shadow: none;
    z-index: 100;
  }
  .admin-sidebar-overlay {
    display: none !important;
  }
  .admin-mobile-header {
    display: none !important;
  }
  .admin-main-content {
    width: calc(100% - 260px);
  }
}

/* Breakpoint rules: Mobile & Tablet (< 1024px: 320px to 1023.98px) */
@media (max-width: 1023.98px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 1100;
    transform: translateX(-100%);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
  }
  .admin-sidebar.is-open {
    transform: translateX(0);
  }
  .admin-main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .admin-page-body {
    padding: 16px;
  }
}

/* ----------------- Mobile-First Responsive Architecture ----------------- */

/* Global image and overflow rules */
*, *::before, *::after {
  box-sizing: border-box;
}

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

/* Base Mobile Grids (below 768px): STRICTLY 1 column using repeat(1, minmax(0, 1fr)) */
.catalog-grid,
.category-grid,
.features-grid,
.footer-grid,
.hero-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  width: 100%;
  gap: 1.5rem;
}

/* Tablet (768px to 1023.98px): Exactly 2 columns */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .category-grid,
  .catalog-grid,
  .features-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop Medium (1024px to 1279.98px): 2 to 3 columns */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .category-grid,
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Desktop Large (1280px+): Full multi-column design restored */
@media (min-width: 1280px) {
  .category-grid,
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .features-grid,
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile & Tablet Responsive Fine-Tuning */
@media (max-width: 991.98px) {
  .nav-search-form {
    max-width: 100%;
    margin-top: 12px;
  }
}

@media (max-width: 767.98px) {
  /* Prevent table or pre overflow */
  .details-specs-table, table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Reset fixed widths on cards */
  .product-card,
  .category-card,
  .metric-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Responsive typography scaling */
  .hero-title {
    font-size: clamp(1.4rem, 5.5vw, 2.1rem);
    line-height: 1.25;
    word-break: break-word;
  }

  .section-title {
    font-size: clamp(1.25rem, 4.5vw, 1.75rem);
    line-height: 1.3;
    word-break: break-word;
  }
}

@media (max-width: 575.98px) {
  .hero-section {
    padding: 50px 0;
  }
  .details-gallery-main {
    height: 280px;
  }
  .product-actions-footer {
    flex-direction: column;
  }
  .floating-whatsapp-btn {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 28px;
  }
  .navbar-brand-logo {
    font-size: 1.15rem;
    gap: 6px;
  }
}

