/*
Theme Name: Electrowide v11
Theme URI: https://electrowide.in
Author: Electrowide
Description: Mobile-first electronics spare parts marketplace theme. Built from custom 27-screen UI design. Features Email OTP login, custom Customer/Order IDs, and clean PCB-focused product layouts. Keeps SEO-safe URLs from the previous theme.
Version: 11.3.9
License: GPL v2 or later
Text Domain: electrowide-v11
*/

/* ════════════════════════════════════════
   ELECTROWIDE v11 — DESIGN TOKENS
   ════════════════════════════════════════ */
:root {
  --ew-navy:        #0d3556;
  --ew-navy-light:  #163b63;
  --ew-accent:      #0d6efd;
  --ew-success:     #16a34a;
  --ew-warning:     #f59e0b;
  --ew-danger:      #ef4444;
  --ew-bg:          #f4f6f9;
  --ew-card:        #ffffff;
  --ew-text:        #1a2433;
  --ew-text-muted:  #6b7785;
  --ew-border:      #e3e7ed;
  --ew-radius:      12px;
  --ew-font: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Visually hidden but accessible to screen readers / SEO crawlers —
   used for the page <h1> so the visual logo design stays untouched
   while still giving the page a proper heading hierarchy. */
.ew-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════
   BASE RESET
   ════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ew-font);
  background: var(--ew-bg);
  color: var(--ew-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ew-accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ════════════════════════════════════════
   LAYOUT (mobile-first, max-width 480px center)
   ════════════════════════════════════════ */
.ew-app {
  max-width: 480px;
  margin: 0 auto;
  background: var(--ew-card);
  min-height: 100vh;
  position: relative;
  padding-bottom: 70px;
}

/* ════════════════════════════════════════
   PWA SAFE AREAS (notch + home indicator)
   Extends navy header into iPhone notch area,
   adds bottom padding for iPhone home indicator.
   ════════════════════════════════════════ */
@supports (padding-top: env(safe-area-inset-top)) {
  .ew-header {
    padding-top: calc(12px + env(safe-area-inset-top)) !important;
  }
  .ew-bottom-nav {
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
  .ew-app {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

/* ════════════════════════════════════════
   PWA INSTALL BANNER
   Hidden by default; JS toggles .show when
   the browser fires beforeinstallprompt.
   ════════════════════════════════════════ */
.ew-install-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f4f6f9;
  border-bottom: 1px solid #e3e7ed;
}
.ew-install-banner.show { display: flex; }
.ew-ib-icon {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
}
.ew-ib-text { flex: 1; min-width: 0; }
.ew-ib-title {
  font-size: 13.5px; font-weight: 700; color: #0d3556; line-height: 1.2;
}
.ew-ib-sub {
  font-size: 11.5px; color: #6b7785; margin-top: 2px; line-height: 1.3;
}
.ew-ib-install {
  background: #0d3556; color: #fff; border: 0;
  padding: 8px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.ew-ib-close {
  background: none; border: 0; color: #6b7785;
  font-size: 22px; line-height: 1; padding: 4px 6px;
  cursor: pointer; flex-shrink: 0;
}

/* ════════════════════════════════════════
   HEADER (navy bar)
   ════════════════════════════════════════ */
.ew-header {
  background: var(--ew-navy);
  padding: 12px 18px 20px;   /* compact: was 16px 18px 22px */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;        /* anchor for floating search bar */
}
.ew-hamburger {
  width: 22px; height: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: none; border: none; cursor: pointer; padding: 0;
}
.ew-hamburger span { display: block; height: 2px; background: #fff; border-radius: 1px; }
.ew-header-center { text-align: center; flex: 1; }
.ew-logo-text { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }
.ew-logo-sub { color: #b4c5d6; font-size: 10px; margin-top: 2px; }

/* Custom Logo — display at 220x40 (half of 440x80 source for HD sharpness) */
.ew-header-center { display: flex !important; align-items: center !important; justify-content: center !important; }
.ew-header-center .custom-logo-link {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 0;
	max-width: 220px !important;
}
.ew-header-center .custom-logo,
.ew-header-center img.custom-logo,
.ew-header-center a img {
	width: 180px !important;
	height: 33px !important;
	max-width: 180px !important;
	max-height: 33px !important;
	object-fit: contain !important;
	display: block !important;
}

/* Even smaller on small phones */
@media (max-width: 380px) {
	.ew-header-center .custom-logo,
	.ew-header-center img.custom-logo,
	.ew-header-center a img {
		width: 155px !important;
		height: 28px !important;
		max-width: 155px !important;
		max-height: 28px !important;
	}
}
.ew-header-icon { color: #fff; background: none; border: none; padding: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ew-header-icon:hover { color: #fff; }
.ew-bell-link { position: relative; }
.ew-bell-badge {
	position: absolute;
	top: -2px; right: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 2px var(--ew-navy);
	line-height: 1;
}

/* Sub-header for inner pages (back arrow + title) */
.ew-subheader {
  background: var(--ew-navy);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.ew-subheader .ew-icon-btn { color: #fff; background: none; border: none; padding: 4px; cursor: pointer; }
.ew-subheader-title { color: #fff; font-size: 16px; font-weight: 700; flex: 1; text-align: center; padding-right: 30px; }

/* ════════════════════════════════════════
   SEARCH BAR  (floating — 30% in navy, 70% outside)
   ════════════════════════════════════════ */
.ew-search-wrap {
  /* Search bar ≈ 48px tall.
     30% top portion overlaps the navy = ~14px inside.
     70% sits below in the white area = move whole bar UP by 14px from white start. */
  margin-top: -14px;
  padding: 0 18px 14px;
  position: relative;
  z-index: 2;
}
.ew-search-bar {
  background: var(--ew-card);
  border: 1px solid #94a3b8;
  border-radius: 10px;
  padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.ew-search-bar input {
  border: none; outline: none; flex: 1;
  font-size: 14px; color: var(--ew-text); background: transparent;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.ew-search-bar input:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}
.ew-search-bar input::-webkit-search-decoration,
.ew-search-bar input::-webkit-search-cancel-button,
.ew-search-bar input::-webkit-search-results-button,
.ew-search-bar input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}
.ew-search-bar input::placeholder { color: #a0aab5; }

/* ════════════════════════════════════════
   SECTIONS
   ════════════════════════════════════════ */
.ew-section { padding: 20px 18px 0; }
.ew-sec-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.ew-sec-title {
  font-size: 14px; font-weight: 800; color: var(--ew-text);
  letter-spacing: 0.5px;
}
.ew-sec-viewall {
  color: var(--ew-accent); font-size: 12.5px; font-weight: 500;
  text-decoration: none;
}

/* ════════════════════════════════════════
   PCB GALLERY (3-col with photos)
   ════════════════════════════════════════ */
.ew-pcb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ew-pcb-card {
  background: var(--ew-card);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 8px 8px 0;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}
.ew-pcb-photo {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f0f2f5;
}
.ew-pcb-photo img, .ew-pcb-photo svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.ew-pcb-label {
  margin: 8px -8px 0;
  padding: 12px 6px;
  text-align: center;
  font-size: 13px; font-weight: 600; color: var(--ew-text);
  background: #eef2f7;
}

/* ════════════════════════════════════════
   SLIDE-IN SIDE MENU (hamburger drawer)
   ════════════════════════════════════════ */
.ew-side-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}
.ew-side-menu {
  position: fixed; top: 0; left: 0;
  height: 100vh; width: 78%;
  max-width: 320px;
  background: #fff;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 2px 0 16px rgba(0,0,0,0.15);
  overflow-y: auto;
  visibility: hidden;
}
body.ew-menu-open .ew-side-overlay {
  opacity: 1; visibility: visible;
  transition: opacity 0.25s ease;
}
body.ew-menu-open .ew-side-menu {
  transform: translateX(0);
  visibility: visible;
}
.ew-side-head {
  background: var(--ew-navy);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.ew-side-close {
  background: none; border: none; color: #fff;
  cursor: pointer; padding: 4px;
  display: flex; align-items: center; justify-content: center;
}
.ew-side-close svg { width: 22px; height: 22px; }
.ew-side-title {
  color: #fff; font-size: 16px; font-weight: 700;
}
.ew-side-nav {
  padding: 10px 0;
}
.ew-side-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 18px;
  color: var(--ew-text);
  text-decoration: none;
  font-size: 15px; font-weight: 500;
  border-bottom: 1px solid #f0f2f5;
}
.ew-side-link:hover { background: var(--ew-bg); }
.ew-side-link svg {
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  max-width: 20px; max-height: 20px;
  color: var(--ew-navy);
  flex-shrink: 0;
}
.ew-side-divider {
  height: 8px; background: var(--ew-bg);
  margin: 4px 0;
}

/* ════════════════════════════════════════
   SPARE PARTS (horizontal scrollable row)
   ════════════════════════════════════════ */
.ew-spare-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;          /* Firefox */
  padding-bottom: 4px;            /* breathing room for shadows */
  margin: 0 -18px;                /* extend to screen edges */
  padding-left: 18px;
  padding-right: 18px;
}
.ew-spare-scroll::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.ew-spare-card {
  flex: 0 0 auto;
  width: 100px;                   /* fixed width — about 3.5 cards visible */
  text-decoration: none;
  scroll-snap-align: start;
  background: #eef2f7;            /* whole card grey-blue (text area shows same) */
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 8px 8px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ew-spare-photo {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;               /* photo area itself stays white inside */
  display: flex; align-items: center; justify-content: center;
}
.ew-spare-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ew-spare-label {
  margin: 0 -8px;                 /* extend to card edges */
  padding: 10px 4px;
  text-align: center;
  font-size: 12px; font-weight: 600; color: var(--ew-text);
  background: #eef2f7;
  line-height: 1.25;
  flex: 1;                        /* fill remaining card height (no white gap) */
  display: flex; align-items: center; justify-content: center;
}

/* ════════════════════════════════════════
   SPARE PARTS (4-col icon grid) — kept for backward compat
   ════════════════════════════════════════ */
.ew-icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.ew-icon-card {
  background: var(--ew-card);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 14px 4px 8px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ew-icon-card svg { width: 28px; height: 28px; color: var(--ew-text); }
.ew-icon-label {
  font-size: 10.5px; font-weight: 500; color: #3a4452; margin-top: 8px;
  display: block;
}

/* ════════════════════════════════════════
   INFO CARDS (Can't Find / WhatsApp / Partner / Refer)
   ════════════════════════════════════════ */
.ew-card-refer {
  background: var(--ew-navy) !important;
  border-color: var(--ew-navy) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.ew-refer-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.ew-refer-circle svg { width: 26px; height: 26px; }

.ew-info-card {
  margin: 14px 18px 0;
  border-radius: var(--ew-radius);
  padding: 16px;
  background: var(--ew-bg);
  border: 1px solid var(--ew-border);
}
.ew-tools-second { margin-top: 10px; }
.ew-card-title { font-size: 14.5px; font-weight: 800; color: var(--ew-text); margin-bottom: 4px; }
.ew-card-sub { font-size: 12px; color: var(--ew-text-muted); line-height: 1.45; }

.ew-card-whatsapp {
  background: #dff5e3; border: 1px solid #b8e0bf;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
}
.ew-card-whatsapp .ew-card-sub { margin-top: 2px; }
.ew-wa-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ew-wa-circle svg { width: 20px; height: 20px; fill: #fff; }

.ew-card-partner-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ew-partner-icon {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--ew-navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ew-partner-icon svg { width: 13px; height: 13px; color: var(--ew-navy); }

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.ew-btn {
  display: inline-block; padding: 9px 24px; border-radius: 22px;
  font-size: 11.5px; font-weight: 700; text-decoration: none;
  border: none; letter-spacing: 0.6px; cursor: pointer;
  font-family: inherit;
}
.ew-btn-navy { background: var(--ew-navy); color: #fff; }
.ew-btn-navy:hover { background: var(--ew-navy-light); }

.ew-btn-block {
  display: block; width: 100%; text-align: center;
  padding: 14px; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.6px; text-decoration: none;
  border: none; cursor: pointer; font-family: inherit;
}
.ew-btn-block-navy { background: var(--ew-navy); color: #fff; }
.ew-btn-block-outline { background: var(--ew-card); color: var(--ew-navy); border: 1.5px solid var(--ew-navy); }
.ew-btn-block-wa { background: var(--ew-card); color: var(--ew-success); border: 1.5px solid var(--ew-success); display: flex; align-items: center; justify-content: center; gap: 8px; }
.ew-btn-block-wa svg { width: 18px; height: 18px; fill: var(--ew-success); }

/* ════════════════════════════════════════
   BOTTOM NAVIGATION
   ════════════════════════════════════════ */
.ew-bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--ew-card); border-top: 1px solid var(--ew-border);
  display: flex; justify-content: space-around; padding: 10px 0;
  z-index: 100;
}
.ew-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #8a96a4; font-size: 10px; text-decoration: none; font-weight: 500;
}
.ew-nav-item.active { color: var(--ew-navy); font-weight: 600; }
.ew-nav-item svg { width: 20px; height: 20px; }

/* ════════════════════════════════════════
   PRODUCT DETAILS PAGE
   ════════════════════════════════════════ */
.ew-pdp-topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: #fff; }
.ew-pdp-topbar .ew-icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--ew-text); background: none; border: none;
}
.ew-pdp-topbar-icons { display: flex; gap: 14px; }

.ew-pdp-image { background: #fff; aspect-ratio: 1; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.ew-pdp-image img, .ew-pdp-image svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.ew-pdp-slider { position: relative; width: 100%; height: 100%; }
.ew-pdp-slide { width: 100%; height: 100%; }
.ew-pdp-arrow {
	position: absolute; top: 50%; transform: translateY(-50%);
	background: rgba(255,255,255,0.92); border: 1px solid #e3e7ed;
	width: 36px; height: 36px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: #0d3556; cursor: pointer; z-index: 3;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.ew-pdp-arrow:hover { background: #fff; }
.ew-pdp-arrow-prev { left: 10px; }
.ew-pdp-arrow-next { right: 10px; }

.ew-pdp-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 6px; }
.ew-dot { width: 8px; height: 8px; border-radius: 50%; background: #c8cdd5; cursor: pointer; transition: all 0.2s; }
.ew-dot.active { background: var(--ew-navy); width: 10px; height: 10px; }

.ew-pdp-info { padding: 6px 18px 18px; }
.ew-pdp-code { font-size: 18px; font-weight: 800; color: var(--ew-text); margin-bottom: 8px; letter-spacing: 0.3px; }
.ew-pdp-stock { font-size: 13px; font-weight: 600; color: var(--ew-success); margin-bottom: 14px; }
.ew-pdp-stock.out { color: var(--ew-danger); }
.ew-pdp-price { font-size: 22px; font-weight: 800; color: var(--ew-text); margin-bottom: 20px; }

.ew-pdp-section { margin-bottom: 0; padding: 16px 0; border-bottom: 1px solid #eceff3; }
.ew-pdp-section:last-child { border-bottom: none; }
.ew-pdp-section h3 {
  font-size: 14px; font-weight: 700; color: var(--ew-text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.ew-pdp-section h3::before {
  content: ""; display: inline-block;
  width: 3.5px; height: 15px; border-radius: 2px;
  background: var(--ew-navy); flex-shrink: 0;
}
.ew-pdp-section ul { list-style: none; padding-left: 2px; }
.ew-pdp-section li { font-size: 13px; color: #3a4452; padding: 3px 0 3px 14px; position: relative; line-height: 1.5; }
.ew-pdp-section li::before { content: "•"; position: absolute; left: 0; color: #3a4452; font-weight: 700; }

/* Why Buy From Electrowide */
.ew-whybuy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ew-whybuy-item {
  display: flex; align-items: flex-start; gap: 9px;
  background: #f7f9fc; border: 1px solid #eceff3; border-radius: 10px;
  padding: 11px 12px;
}
.ew-whybuy-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: #eaf1f8; color: var(--ew-navy);
  display: flex; align-items: center; justify-content: center;
}
.ew-whybuy-icon svg { width: 16px; height: 16px; }
.ew-whybuy-title { font-size: 12px; font-weight: 700; color: var(--ew-text); line-height: 1.3; }
.ew-whybuy-sub { font-size: 10.5px; color: #6b7785; margin-top: 2px; line-height: 1.35; }

.ew-pdp-actions { padding: 0 18px 18px; }
.ew-pdp-actions .ew-btn-block { margin-bottom: 10px; }

/* ════════════════════════════════════════
   PRODUCT PAGE ONLY: fixed Add-to-Cart / Buy-Now bar
   replaces the global bottom nav (WordPress auto-adds
   the "single-ew_product" body class on this template).
   ════════════════════════════════════════ */
body.single-ew_product .ew-bottom-nav { display: none; }

body.single-ew_product .ew-pdp-actions {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--ew-card); border-top: 1px solid var(--ew-border);
  display: flex; gap: 0;
  padding: 0;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
/* Flipkart-style CTA row: icon + bold uppercase text, edge-to-edge,
   no rounded corners, taller touch target — colors unchanged (still
   the site's navy / navy-outline via .ew-btn-block-navy / -outline). */
body.single-ew_product .ew-pdp-actions .ew-btn-block.ew-pdp-cta {
  flex: 1; margin-bottom: 0;
  border-radius: 6px;
  padding: 11px 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px;
}
body.single-ew_product .ew-pdp-actions .ew-btn-block.ew-pdp-cta svg { width: 16px; height: 16px; flex-shrink: 0; }
/* Thin border, small gap between the two buttons (not a hard divider line) */
body.single-ew_product .ew-pdp-actions { gap: 8px; padding: 8px 12px; }
body.single-ew_product .ew-pdp-actions .ew-btn-block-outline.ew-pdp-cta { border-width: 1px; border-right-width: 1px; }
/* Out-of-stock (single button, no icon) keeps the old rounded/centered look */
body.single-ew_product .ew-pdp-actions .ew-btn-block:not(.ew-pdp-cta) { flex: 1; margin: 10px 18px; }

/* WhatsApp button moves into normal page flow (not fixed) */
.ew-pdp-wa-row { padding: 0 18px 18px; }

/* Leave enough room at the bottom of the page so the fixed bar
   never covers the WhatsApp button or reviews section beneath it. */
body.single-ew_product .ew-app { padding-bottom: 84px; }

@supports (padding-top: env(safe-area-inset-top)) {
  body.single-ew_product .ew-pdp-actions {
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
  body.single-ew_product .ew-app {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }
}

/* ════════════════════════════════════════
   FORM FIELDS (used in login, address, register)
   ════════════════════════════════════════ */
.ew-field { margin-bottom: 16px; }
.ew-field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ew-text); margin-bottom: 6px; }
.ew-field-label .ew-req { color: var(--ew-danger); }
.ew-field-input,
.ew-field-select,
.ew-field-textarea {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--ew-border); border-radius: 10px;
  font-size: 14px; color: var(--ew-text); background: #fff;
  font-family: inherit; outline: none;
}
.ew-field-input:focus,
.ew-field-select:focus,
.ew-field-textarea:focus { border-color: var(--ew-navy); }
.ew-field-input::placeholder { color: #a0aab5; }
.ew-field-hint { font-size: 11.5px; color: var(--ew-text-muted); margin-top: 4px; }

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
.ew-footer {
  background: var(--ew-navy);
  color: #b4c5d6;
  padding: 28px 18px 20px;
  margin-top: 40px;
  font-size: 12.5px;
}
.ew-footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 14px; margin-bottom: 18px; }
.ew-footer-col h4 { color: #fff; font-size: 13px; margin-bottom: 10px; font-weight: 700; }
.ew-footer-col ul { list-style: none; }
.ew-footer-col li { padding: 4px 0; }
.ew-footer-col a { color: #b4c5d6; text-decoration: none; font-size: 12px; }
.ew-footer-col a:hover { color: #fff; }
.ew-footer-bottom {
  border-top: 1px solid #1e4a73; padding-top: 14px;
  text-align: center; font-size: 11px; color: #8aa4be;
}

/* ════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════ */
.ew-screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal;
}

/* ════════════════════════════════════════════════════════════
   DESKTOP / LAPTOP RESPONSIVE LAYER
   Everything below only activates at min-width: 1024px and above.
   The mobile experience (everything above this point in the file)
   is completely untouched — these rules only ADD desktop styling
   on top, they never override anything below the breakpoint.
   ════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

  /* Desktop background: the page background (--ew-bg, #f4f6f9) and the
     app's own white background are too visually similar — on desktop
     that made the centered container invisible, looking like the
     content stretched edge-to-edge with no margin at all. Darken the
     outer background and add a real shadow so the content area reads
     clearly as a distinct, centered card. */
  body {
    background: #e4e9f0;
  }
  .ew-app {
    max-width: 1280px;
    padding-bottom: 0; /* mobile bottom-nav spacer no longer needed */
    box-shadow: 0 0 0 1px rgba(13,53,86,0.06), 0 20px 50px -12px rgba(13,53,86,0.18);
  }

  /* Mobile bottom tab bar doesn't belong on desktop — the header
     nav (converted below) covers the same destinations. */
  .ew-bottom-nav { display: none !important; }

  /* ─── Header: keep the same hamburger + logo layout as mobile,
     just give it more breathing room on a wider screen ─── */
  /* ─── Header: instead of a navy bar stretching the full app width
     with just internal padding, make the bar itself narrower and
     centered — same visible gap on the outside as content sections
     now have. ─── */
  .ew-header {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 24px;
    border-radius: 0 0 16px 16px;
  }
  .ew-header-center .custom-logo,
  .ew-header-center img.custom-logo,
  .ew-header-center a img {
    width: 168px !important;
    height: 31px !important;
    max-width: 168px !important;
    max-height: 31px !important;
  }

  /* Search bar: same floating style as mobile, just centered with a
     sensible max-width instead of stretching edge-to-edge. */
  .ew-search-wrap {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  /* ─── Side menu (hamburger drawer) stays exactly as it is on
     mobile — same slide-out panel, same trigger. Only make the panel
     itself a little wider since there's more screen to use. ─── */
  .ew-side-menu {
    width: 340px;
    border-radius: 0 16px 16px 0;
  }

  /* ─── Content width: use the SAME sizing method as the header/footer
     (max-width + centered margin, not padding) so everything lines up
     exactly — 1000px, matching the header/footer bars precisely. ─── */
  .ew-section,
  .ew-subheader,
  .ew-tr-wrap,
  main > div[style*="padding:16px"],
  main > div[style*="padding: 16px"] {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
  }

  /* ─── Homepage: PCB gallery / spare parts already sit inside
     .ew-section, which now caps width at 1000px — no extra width
     rule needed here, just let them fill their parent naturally. ─── */

  /* Product grids (main spare-parts listing) — mobile uses a 2-column
     grid; widen to 4 columns on desktop. Already inside a width-capped
     parent, so this only needs to change the column count. */
  .ew-product-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* ─── Homepage "Spare Parts" row: mobile uses tiny fixed 100px cards
     for a horizontal-scroll strip — on desktop that looks disproportion-
     ately small on a wide screen, so give the cards (and their square
     images) a proper standard size, and let them wrap into rows
     instead of forcing a horizontal scroll. ─── */
  .ew-spare-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .ew-spare-card {
    width: 160px;
  }

  /* ─── Homepage "Free Tools": the MOSFET + Component Library cards
     were designed as full-width mobile banners — on a wide desktop
     screen a single full-width banner looks stretched and thin, so
     place them side-by-side instead. The SMD image banner above stays
     full-width since it's meant to be a wide promotional banner. ─── */
  .ew-tools-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .ew-tools-second { margin-top: 0; }
  .ew-tools-pair > a {
    padding: 20px 22px;
  }

  /* ─── Homepage info-cards (Refer & Earn, Can't Find PCB, WhatsApp,
     Partner Program): mobile stacks these full-width one after another
     — on desktop that stretches each card thin and awkward across the
     whole screen, so arrange them as a proper 2-column grid instead. ─── */
  .ew-info-cards-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 0 24px;
    box-sizing: border-box;
  }
  .ew-info-cards-wrap .ew-info-card,
  .ew-info-cards-wrap > div,
  .ew-info-cards-wrap > a {
    margin: 0 !important;
  }

  /* ─── Footer: mobile uses tiny 2-column, 11-13px fonts (fine for a
     narrow phone) — on desktop those look illegibly small and cramped,
     so use the full 4-column layout with proper desktop-readable
     font sizes, centered within a sensible max-width. ─── */
  .ew-footer {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 24px;
    border-radius: 16px 16px 0 0;
  }
  .ew-footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
  }
  .ew-footer-col h4 { font-size: 15px; margin-bottom: 14px; }
  .ew-footer-col li { padding: 6px 0; }
  .ew-footer-col a { font-size: 13.5px; }
  .ew-footer-bottom { font-size: 12.5px; }

  /* Fixed bottom action bar on the single-product page (Add to Cart /
     Buy Now) — keep it, but constrain its width to match the app
     container instead of stretching across the full browser width. */
  body.single-ew_product .ew-pdp-actions {
    max-width: 1280px;
  }

  /* ─── Site-wide small-text fix (AdSense flags tiny text) ───
     Almost every page uses inline font-size styles (not CSS classes),
     so instead of editing dozens of files line-by-line, this catches
     every small inline font-size used anywhere in the theme and bumps
     it up ~2px on desktop only. Mobile sizes (everything above this
     media query) are completely unaffected. */
  [style*="font-size:9px"], [style*="font-size: 9px"]     { font-size: 11px !important; }
  [style*="font-size:9.5px"], [style*="font-size: 9.5px"] { font-size: 11.5px !important; }
  [style*="font-size:10px"], [style*="font-size: 10px"]   { font-size: 12px !important; }
  [style*="font-size:10.5px"], [style*="font-size: 10.5px"] { font-size: 12.5px !important; }
  [style*="font-size:11px"], [style*="font-size: 11px"]   { font-size: 13px !important; }
  [style*="font-size:11.5px"], [style*="font-size: 11.5px"] { font-size: 13.5px !important; }
  [style*="font-size:12px"], [style*="font-size: 12px"]   { font-size: 14.5px !important; }
  [style*="font-size:12.5px"], [style*="font-size: 12.5px"] { font-size: 15px !important; }
  [style*="font-size:13px"], [style*="font-size: 13px"]   { font-size: 15.5px !important; }
  [style*="font-size:13.5px"], [style*="font-size: 13.5px"] { font-size: 16px !important; }
  [style*="font-size:14px"], [style*="font-size: 14px"]   { font-size: 16.5px !important; }
  [style*="font-size:14.5px"], [style*="font-size: 14.5px"] { font-size: 17px !important; }
}

/* Large desktop monitors: a little extra breathing room */
@media (min-width: 1440px) {
  .ew-app { max-width: 1400px; }
  .ew-pcb-grid,
  .ew-spare-scroll,
  .ew-product-grid {
    max-width: 1320px;
  }
}
