/* ============================================================
   RS PrimeCommerce — Global Stylesheet
   Design tokens, reset, typography, header, footer, utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --primary:        #152048;
  --primary-dark:   #0d1633;
  --primary-light:  #1e3166;
  --teal:           #e85d04;
  --teal-dark:      #c04b00;
  --teal-light:     #f97316;
  --bg:             #f5f6fa;
  --bg-alt:         #eef0f7;
  --card:           #ffffff;
  --text:           #111827;
  --text-2:         #374151;
  --muted:          #6b7280;
  --muted-light:    #9ca3af;
  --border:         #e5e7eb;
  --border-light:   #f3f4f6;
  --success:        #22c55e;
  --success-dark:   #16a34a;
  --warning:        #f59e0b;
  --error:          #ef4444;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 16px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:      0 16px 48px rgba(0,0,0,0.12);
  --radius-sm:      6px;
  --radius:         12px;
  --radius-lg:      18px;
  --radius-xl:      24px;
  --radius-full:    9999px;
  --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h:       70px;
  --topbar-h:       36px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; line-height: 1.35; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { font-size: 0.95rem; color: var(--text-2); }

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.grid { display: grid; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.3px;
  transition: var(--transition); cursor: pointer; border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(21,32,72,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  box-shadow: 0 6px 20px rgba(21,32,72,0.5);
  transform: translateY(-1px);
}
.btn-teal {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(232,93,4,0.35);
}
.btn-teal:hover {
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
  box-shadow: 0 6px 20px rgba(232,93,4,0.5);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary); color: #fff;
  transform: translateY(-1px);
}
.btn-outline-teal {
  background: transparent; color: var(--teal-dark);
  border: 2px solid var(--teal);
}
.btn-outline-teal:hover {
  background: var(--teal); color: #fff;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg); border-color: var(--muted-light);
}
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* ── Star Rating ────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; }
.star-filled { fill: var(--warning); stroke: none; }
.star-empty  { fill: #e5e7eb; stroke: none; }
.rating-text { font-size: 0.8rem; color: var(--muted); margin-left: 4px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--error); color: #fff;
  font-size: 0.7rem; font-weight: 700; border-radius: var(--radius-full);
}
.badge-primary { background: var(--primary); }
.badge-teal    { background: var(--teal-dark); }
.badge-success { background: var(--success); }
.badge-sale    {
  background: var(--error); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.badge-new    {
  background: var(--teal-dark); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--muted); padding: 14px 0;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--muted-light); }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; color: var(--text);
  background: var(--card); transition: var(--transition-fast);
  outline: none;
}
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(232,93,4,0.14); }
.form-control.error { border-color: var(--error); }
.form-error {
  font-size: 0.78rem; color: var(--error); font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.form-error::before { content: '⚠'; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }

/* ── Top Announcement Bar ───────────────────────────────────── */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 50%, var(--teal-dark) 100%);
  color: #fff; font-size: 0.78rem; font-weight: 500;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: center; gap: 32px;
  letter-spacing: 0.2px;
  border-bottom: 2px solid var(--teal);
}
.topbar span { opacity: 0.85; }
.topbar strong { opacity: 1; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  height: var(--header-h);
}
.header-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
/* Logo */
.header-logo { flex-shrink: 0; }
.header-logo img { height: 42px; width: auto; object-fit: contain; }

/* Search */
.header-search { flex: 1; max-width: 520px; position: relative; }
.header-search input {
  width: 100%; padding: 10px 16px 10px 44px;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  font-size: 0.88rem; color: var(--text); background: var(--bg);
  outline: none; transition: var(--transition-fast);
}
.header-search input:focus { border-color: var(--teal); background: var(--card); box-shadow: 0 0 0 3px rgba(232,93,4,0.13); }
.header-search input::placeholder { color: var(--muted-light); }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-icon svg { width: 18px; height: 18px; }
.search-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; border: none; width: 30px; height: 30px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: var(--transition-fast);
}
.search-btn:hover { opacity: 0.85; }
.search-btn svg { width: 14px; height: 14px; }

/* Header Icons */
.header-icons { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-icon-btn {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 0.68rem; font-weight: 500;
  transition: var(--transition-fast); gap: 2px;
}
.header-icon-btn:hover { background: var(--bg-alt); color: var(--primary); }
.header-icon-btn svg { width: 22px; height: 22px; }
.header-icon-btn .badge {
  position: absolute; top: 4px; right: 6px;
  min-width: 17px; height: 17px; font-size: 0.65rem;
}
.cart-icon-btn { color: var(--primary); }
.cart-icon-btn svg { stroke-width: 2.2px; }

/* Nav */
.site-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 4px;
}
.nav-link {
  padding: 12px 16px; font-size: 0.875rem; font-weight: 500;
  color: var(--text-2); border-radius: var(--radius-sm);
  transition: var(--transition-fast); position: relative;
  display: flex; align-items: center; gap: 4px;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 50%; right: 50%;
  height: 2px; background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 2px 2px 0 0; transition: var(--transition);
}
.nav-link:hover::after, .nav-link.active::after { left: 12px; right: 12px; }
.nav-dropdown { font-size: 10px; }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none; padding: 8px; color: var(--text-2);
  border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--bg-alt); }
.menu-toggle svg { width: 24px; height: 24px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #cbd5e1; margin-top: auto;
}
.footer-top {
  padding: 56px 0 40px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; max-width: 1320px; margin: 0 auto; padding-left: 24px; padding-right: 24px;
}
.footer-brand .footer-logo { height: 38px; width: auto; margin-bottom: 16px; filter: brightness(1.2); }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; color: #94a3b8; max-width: 280px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.social-link {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07); color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast); font-size: 0.85rem;
}
.social-link:hover { background: var(--primary); color: #fff; }
.footer-col h4 { color: #f1f5f9; font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.85rem; color: #94a3b8; transition: var(--transition-fast); }
.footer-col ul li a:hover { color: var(--teal); padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 24px; max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: #64748b;
}
.footer-payments { display: flex; gap: 8px; align-items: center; }
.payment-badge {
  background: rgba(255,255,255,0.08); border-radius: 4px;
  padding: 4px 8px; font-size: 0.7rem; font-weight: 600; color: #94a3b8;
}

/* ── Toast Notification ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--card); color: var(--text);
  padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); border-left: 4px solid var(--primary);
  font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  min-width: 260px; max-width: 340px;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast-icon { font-size: 1.1rem; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ── Quantity Stepper ───────────────────────────────────────── */
.qty-stepper {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  overflow: hidden; width: fit-content;
}
.qty-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); color: var(--text-2); font-size: 1.1rem; font-weight: 600;
  transition: var(--transition-fast); border: none; cursor: pointer; flex-shrink: 0;
}
.qty-btn:hover { background: var(--primary); color: #fff; }
.qty-input {
  width: 48px; text-align: center; border: none; outline: none;
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: var(--card); padding: 0 4px; height: 36px;
}

/* ── Page Hero ──────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #0a0f1e 0%, #152048 60%, #1e2f5e 100%);
  padding: 40px 0 32px; color: #fff; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(232,93,4,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero h1 { color: #fff; }
.page-hero .breadcrumb { color: rgba(255,255,255,0.7); }
.page-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.page-hero .breadcrumb a:hover { color: var(--teal-light); }
.page-hero .breadcrumb span { color: rgba(255,255,255,0.4); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: #c1cfe0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0b0c0; }

/* ── Section Headers ────────────────────────────────────────── */
.section-header { margin-bottom: 36px; }
.section-label {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.section-title { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; color: var(--text); }
.section-subtitle { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.section-divider {
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: var(--radius-full); margin-top: 10px;
}

/* ── Spinner / Loading ──────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .header-inner { gap: 12px; }
  .header-search { max-width: 200px; }
  .header-search input { font-size: 0.82rem; }
  .header-icon-btn span { display: none; }
  .nav-inner { flex-wrap: wrap; display: none; }
  .nav-inner.open { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 24px 12px; }
  .nav-link { width: 100%; }
  .menu-toggle { display: flex; }
  .topbar { font-size: 0.7rem; gap: 12px; }
  .topbar .hide-mobile { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 24px 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .footer-top { grid-template-columns: 1fr; }
  .header-search { display: none; }
}
