/* ── Jerin Medical Supplies — design system ─────────────────────────── */
:root {
  --teal-900: #0b3b36;
  --teal-700: #0d6b5f;
  --teal-600: #0f9488;
  --teal-500: #14b8a6;
  --teal-100: #e6fbf8;
  --teal-50:  #f3fdfc;
  --ink-900:  #0f172a;
  --ink-700:  #334155;
  --ink-500:  #64748b;
  --ink-300:  #cbd5e1;
  --ink-100:  #f1f5f9;
  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --red-500:  #dc2626;
  --white:    #ffffff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .14);
  --font-head: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); color: var(--ink-900);
  background: var(--white); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .5em; color: var(--teal-900); }
p { margin: 0 0 1em; color: var(--ink-700); }
a { color: var(--teal-700); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ── Header / Nav ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink-100);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; color: var(--teal-900); }
.brand-mark { display: flex; color: var(--teal-600); }
.brand-accent { color: var(--teal-600); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { font-weight: 500; color: var(--ink-700); font-size: .95rem; position: relative; transition: color .15s; }
.site-nav a:hover { color: var(--teal-700); }
.lang-toggle { border: 1px solid var(--ink-300); border-radius: 20px; padding: 6px 14px !important; }
.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: -10px; right: -16px; background: var(--gold-500); color: var(--white);
  font-size: .68rem; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--ink-900); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; padding: 13px 26px;
  border-radius: 999px; border: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--teal-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold-500); color: var(--white); }
.btn-gold:hover { background: #b45309; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--teal-600); color: var(--teal-700); }
.btn-outline:hover { background: var(--teal-50); }
.btn-ghost { background: var(--ink-100); color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-300); }
.btn-danger { background: var(--red-500); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 55%, var(--teal-600) 100%);
  color: var(--white); padding: 90px 0 100px; position: relative; overflow: hidden;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(160deg, rgba(11,59,54,.85) 0%, rgba(13,107,95,.78) 55%, rgba(15,148,136,.68) 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 3;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.12), transparent 45%);
}
.hero-inner { position: relative; z-index: 4; max-width: 640px; }
.hero h1 { color: var(--white); font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.15; }
.hero p { color: rgba(255,255,255,.88); font-size: 1.15rem; max-width: 520px; }
.hero-cta { margin-top: 28px; }

/* ── Sections ─────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--teal-50); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.why-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 32px 26px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); transition: transform .2s, box-shadow .2s;
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.why-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--teal-100); color: var(--teal-700);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px;
}

/* ── Catalog ──────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-chip {
  padding: 9px 20px; border-radius: 999px; border: 1.5px solid var(--ink-300); background: var(--white);
  font-weight: 600; font-size: .88rem; color: var(--ink-700); cursor: pointer; transition: all .15s;
}
.filter-chip.active, .filter-chip:hover { border-color: var(--teal-600); color: var(--teal-700); background: var(--teal-50); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.product-card {
  background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.product-media {
  height: 140px; background: linear-gradient(135deg, var(--teal-100), var(--teal-50));
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
  overflow: hidden;
}
.product-media img { max-height: 92px; max-width: 72%; object-fit: contain; }
.product-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-600); font-weight: 700; }
.product-name { font-size: 1.05rem; font-weight: 600; color: var(--ink-900); margin: 0; }
.product-desc { font-size: .85rem; color: var(--ink-500); flex: 1; }
.product-meta { display: flex; align-items: baseline; justify-content: space-between; }
.product-price { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--teal-800, var(--teal-700)); }
.product-price small { font-size: .7rem; font-weight: 500; color: var(--ink-500); }
.stock-pill { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.stock-in { background: #dcfce7; color: #166534; }
.stock-low { background: #fef3c7; color: #92400e; }
.stock-out { background: #fee2e2; color: #991b1b; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-stepper { display: flex; align-items: center; border: 1.5px solid var(--ink-300); border-radius: 999px; overflow: hidden; }
.qty-stepper button { background: var(--ink-100); border: none; width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer; color: var(--ink-700); }
.qty-stepper input { width: 42px; text-align: center; border: none; font-weight: 600; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Tables (cart / account / admin) ──────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--ink-100); }
table.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data-table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-500); background: var(--ink-100); padding: 14px 18px; font-weight: 600;
}
table.data-table td { padding: 16px 18px; border-top: 1px solid var(--ink-100); font-size: .92rem; vertical-align: middle; }
table.data-table tr:hover td { background: var(--teal-50); }

.status-pill { font-size: .75rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; display: inline-block; }
.status-pending_payment { background: #fef3c7; color: #92400e; }
.status-paid { background: #dbeafe; color: #1e40af; }
.status-fulfilled { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-card {
  background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-sm); max-width: 480px; margin: 0 auto;
}
.form-card-wide { max-width: 760px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; color: var(--ink-700); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--ink-300); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .95rem; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--teal-500); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-alert { padding: 13px 18px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 20px; }
.form-alert-error { background: #fee2e2; color: #991b1b; }
.form-alert-success { background: #dcfce7; color: #166534; }
.form-alert-info { background: var(--teal-50); color: var(--teal-800, var(--teal-700)); border: 1px solid var(--teal-100); }
.form-links { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--ink-500); }

/* ── Payment method selector ──────────────────────────────────────── */
.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.pay-option {
  border: 1.5px solid var(--ink-300); border-radius: var(--radius-md); padding: 18px; text-align: center;
  cursor: pointer; font-weight: 600; transition: all .15s;
}
.pay-option.selected { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-700); }
.pay-option:hover { border-color: var(--teal-500); }

/* ── Cart / Summary ───────────────────────────────────────────────── */
.summary-box {
  background: var(--ink-100); border-radius: var(--radius-md); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.summary-row { display: flex; justify-content: space-between; font-size: .95rem; color: var(--ink-700); }
.summary-row.total { font-size: 1.2rem; font-weight: 700; color: var(--ink-900); border-top: 1px solid var(--ink-300); padding-top: 12px; }

/* ── Admin layout ─────────────────────────────────────────────────── */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--teal-900); color: var(--white); padding: 28px 18px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand { color: var(--white); margin-bottom: 36px; }
.admin-sidebar .brand-accent { color: var(--teal-300, #5eead4); }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.75); padding: 11px 14px;
  border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; margin-bottom: 4px; transition: all .15s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.1); color: var(--white); }
.admin-main { flex: 1; padding: 36px 40px; background: var(--ink-100); min-height: 100vh; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--white); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-card .stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--teal-700); }
.stat-card .stat-label { font-size: .82rem; color: var(--ink-500); margin-top: 4px; }
.panel { background: var(--white); border-radius: var(--radius-md); padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 28px; }
.panel h3 { margin-bottom: 20px; }
.mobile-admin-toggle { display: none; }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px; background: var(--ink-900); color: var(--white);
  padding: 14px 22px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .9rem;
  opacity: 0; transform: translateY(12px); transition: all .25s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer { background: var(--teal-900); color: rgba(255,255,255,.7); padding: 48px 0; margin-top: 60px; }
.footer-inner { text-align: center; }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--white); margin-bottom: 8px; }
.footer-tagline { color: rgba(255,255,255,.6); font-size: .9rem; }
.footer-rights { font-size: .8rem; color: rgba(255,255,255,.45); margin: 0; }

/* ── Utilities ────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state .btn { margin-top: 16px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-sidebar { position: fixed; left: -240px; z-index: 200; transition: left .2s; box-shadow: var(--shadow-lg); }
  .admin-sidebar.open { left: 0; }
  .admin-main { padding: 24px; }
  .mobile-admin-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: var(--teal-900); color: var(--white);
    border: none; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer;
  }
}
@media (max-width: 860px) {
  .why-grid { grid-template-columns: 1fr; }
  .pay-options { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: 72px; left: 0; right: 0; background: var(--white); flex-direction: column;
    align-items: flex-start; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--ink-100);
    box-shadow: var(--shadow-md); transform: translateY(-130%); opacity: 0; transition: all .25s; pointer-events: none;
  }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .hero { padding: 56px 0 64px; text-align: center; }
  .hero-inner { max-width: 100%; }
  .hero p { margin-left: auto; margin-right: auto; }
  .section { padding: 48px 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .product-body { padding: 14px; }
  .brand-text { font-size: 1.05rem; }
}
