/* ============================================================
   PC Shop — Main Stylesheet
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --transition: .2s ease;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Cairo', 'Noto Sans Arabic', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
body[dir="rtl"] { font-family: var(--font-arabic); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ---- Google Fonts loader (added via PHP) ---- */

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
}
.navbar-logo img {
  height: 36px;
  width: auto;
  border-radius: 6px;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.navbar-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lang-select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}
.lang-select:focus { outline: 2px solid var(--primary); }
.hamburger { display: none; cursor: pointer; background: none; border: none; padding: 6px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg, var(--text));
  color: #fff;
  min-height: 420px;
  display: flex;
  align-items: center;
}
.hero-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .35;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.2) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px;
  width: 100%;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 700px;
}
.hero p {
  font-size: 1.1rem;
  opacity: .85;
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition);
}
.hero-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ============================================================
   PRODUCT GRID / FILTER BAR
   ============================================================ */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-bar select:focus { outline: none; border-color: var(--primary); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--surface2);
  overflow: hidden;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-img .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}
.badge {
  position: absolute;
  top: 10px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
body:not([dir="rtl"]) .badge { left: 10px; }
body[dir="rtl"] .badge { right: 10px; }
.badge-featured { background: var(--primary); color: #fff; }
.badge-discount { background: #fee2e2; color: var(--danger); }
.badge-condition-new { background: #dcfce7; color: var(--success); }
.badge-condition-used { background: #fef9c3; color: var(--warning); }
.badge-condition-refurbished { background: #e0e7ff; color: #4338ca; }

.product-card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text);
}
.product-card-specs {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.spec-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.product-card-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.price-final {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}
.price-original {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price-save {
  font-size: .75rem;
  background: #fee2e2;
  color: var(--danger);
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
}
.product-card-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da854; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-full { width: 100%; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ============================================================
   PRODUCT DETAIL PAGE
   ============================================================ */
.product-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.product-gallery-main {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.thumb:hover, .thumb.active { border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { display: flex; flex-direction: column; gap: 20px; }
.product-info-name { font-size: 1.75rem; font-weight: 800; line-height: 1.25; }
.product-info-condition {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 99px;
  width: fit-content;
}
.product-info-price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.product-info-price { font-size: 2.25rem; font-weight: 900; color: var(--primary); }
.product-info-original { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.product-specs-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.spec-row {
  display: grid;
  grid-template-columns: 40% 60%;
  border-bottom: 1px solid var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-label, .spec-value {
  padding: 10px 16px;
  font-size: .875rem;
}
.spec-label { font-weight: 600; background: var(--surface2); color: var(--text-secondary); }
.spec-value { color: var(--text); }
.product-description h3 { font-weight: 700; margin-bottom: 10px; }
.product-description p { color: var(--text-secondary); line-height: 1.8; font-size: .95rem; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform .2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.3rem; padding: 4px; transition: color var(--transition); }
.modal-close:hover { color: var(--text); }
.modal-product-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.modal-product-summary img {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.modal-product-name { font-weight: 600; font-size: .9rem; }
.modal-product-price { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-label span { color: var(--danger); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: border-color var(--transition);
  background: var(--surface);
  color: var(--text);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ============================================================
   WHATSAPP BUBBLE
   ============================================================ */
.wa-bubble {
  position: fixed;
  bottom: 28px;
  z-index: 500;
  width: 56px;
  height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: wa-pulse 2.5s infinite;
}
body:not([dir="rtl"]) .wa-bubble { right: 28px; }
body[dir="rtl"] .wa-bubble { left: 28px; }
.wa-bubble:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,.5); }
.wa-bubble svg { width: 30px; height: 30px; fill: #fff; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,.4); }
  50% { box-shadow: 0 4px 32px rgba(37,211,102,.7); }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 28px 24px;
  font-size: .85rem;
  margin-top: 60px;
}
footer strong { color: #fff; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 4px;
  }
  .hamburger { display: flex; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 1.75rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .modal { padding: 24px; }
  .modal-actions { flex-direction: column; }
}

/* ============================================================
   ADMIN — shared basic overrides are in admin.css
   ============================================================ */
