/* ============================================================
   PARTSPRO — Hoja de Estilos Principal
   Marca: E-Vision / Adjacent S.A — Rojo, Azul, Poppins
   ============================================================ */

:root {
  --primary: #de061c;
  --primary-dark: #b00516;
  --blue: #0075bb;
  --blue-dark: #005c93;
  --dark: #1a1a1a;
  --dark-2: #2d2d2d;
  --mid: #5c5c5c;
  --light: #f7f7f7;
  --light-gray: #E7E6E6;
  --border: #e3e2e0;
  --white: #fff;
  --success: #1a7a3c;
  --danger: #de061c;
  --warning: #d4830a;
  --info: #0075bb;
  --font: 'Poppins', sans-serif;
  --font-display: 'Poppins', sans-serif;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--light);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

ul { list-style: none; }

/* ── TOP BAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--dark);
  color: #aaa;
  font-size: 12px;
  padding: 7px 0;
  font-weight: 400;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: #ccc; }
.topbar a:hover { color: var(--white); text-decoration: none; }
.badge-ws {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: .5px;
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none !important;
  flex-shrink: 0;
  font-family: var(--font-display);
}
.logo-mark {
  font-size: 36px;
  color: var(--primary);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
}
.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.5px;
  font-style: italic;
  text-transform: uppercase;
}
.logo-text strong { color: var(--blue); font-weight: 900; }

.search-bar {
  display: flex;
  flex: 1;
  max-width: 540px;
}
.search-bar input {
  flex: 1;
  border: 2px solid var(--border);
  border-right: none;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--blue); }
.search-bar button {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 22px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background .2s;
}
.search-bar button:hover { background: var(--blue-dark); }

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

.cart-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  position: relative;
  transition: background .2s;
  text-decoration: none !important;
}
.cart-btn:hover { background: var(--primary-dark); color: #fff !important; }
.cart-badge {
  background: var(--dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}

/* ── MAIN NAV ─────────────────────────────────────────────── */
.main-nav {
  background: var(--blue);
}
.main-nav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.main-nav a {
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  display: block;
  transition: background .2s;
  text-decoration: none !important;
}
.main-nav a:hover { background: rgba(0,0,0,.15); color: #fff; }
.main-nav .nav-highlight { background: var(--primary); }
.main-nav .nav-highlight:hover { background: var(--primary-dark); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none !important;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-dark:hover { background: #333; color: #fff; }
.btn-outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-outline-sm { padding: 7px 14px; font-size: 13px; border: 1px solid var(--border); color: var(--mid); border-radius: var(--radius); }
.btn-outline-sm:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-info { background: var(--info); color: #fff; border-color: var(--info); }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-danger  { background: #fbdadd; color: #7d0413; border-left: 4px solid var(--primary); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.alert-info    { background: #d6ecf7; color: #004a73; border-left: 4px solid var(--blue); }
.alert-close { cursor: pointer; font-size: 18px; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 2px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--mid); margin-top: 4px; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 8px; }

/* ── PRODUCT GRID ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.product-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.product-card:hover .img-wrap img { transform: scale(1.05); }
.product-card .card-info { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-card .sku { font-size: 11px; color: var(--mid); letter-spacing: .5px; text-transform: uppercase; }
.product-card h3 { font-size: 15px; font-weight: 600; margin: 4px 0 8px; line-height: 1.3; flex: 1; }
.product-card .price { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--primary); }
.product-card .ws-price { font-size: 12px; color: var(--success); font-weight: 600; }
.product-card .stock-badge { font-size: 11px; margin: 6px 0; }
.stock-in { color: var(--success); }
.stock-low { color: var(--warning); }
.stock-out { color: var(--danger); }
.product-card .card-actions { display: flex; gap: 8px; margin-top: 12px; }
.product-card .card-actions .btn { flex: 1; text-align: center; font-size: 13px; padding: 8px 10px; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  padding: 70px 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.hero-inner { position: relative; max-width: 620px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.hero h1 span { color: var(--primary); -webkit-text-stroke: 0; }
.hero p { font-size: 18px; color: rgba(255,255,255,.85); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── SECTION HEADERS ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
}
.section-header h2 span { color: var(--primary); }

/* ── CATEGORIES STRIP ─────────────────────────────────────── */
.cat-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: thin;
}
.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 130px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none !important;
  color: var(--dark) !important;
}
.cat-chip:hover { border-color: var(--blue); box-shadow: 0 4px 16px rgba(0,117,187,.15); color: var(--blue) !important; transform: translateY(-2px); }
.cat-chip .cat-icon { font-size: 32px; margin-bottom: 8px; }
.cat-chip .cat-name { font-weight: 700; font-size: 13px; }

/* ── TRUST BAR ────────────────────────────────────────────── */
.trust-bar {
  background: var(--dark);
  color: #fff;
  padding: 16px 0;
}
.trust-bar .container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
}
.trust-item { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.trust-item .icon { font-size: 22px; }

/* ── SIDEBAR LAYOUT ───────────────────────────────────────── */
.sidebar-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
.sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 120px;
}
.sidebar h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--blue);
}
.sidebar ul li { margin-bottom: 2px; }
.sidebar ul li a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--dark);
  font-size: 14px;
  transition: background .15s;
  text-decoration: none !important;
}
.sidebar ul li a:hover, .sidebar ul li a.active { background: var(--light-gray); color: var(--primary); }

/* ── TABLES ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
table th {
  background: var(--dark);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
}
table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #fafafa; }
.table-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ── STATUS BADGES ───────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.status-pending  { background: #fff3cd; color: #856404; }
.status-paid     { background: #d4edda; color: #155724; }
.status-shipped  { background: #d6ecf7; color: #004a73; }
.status-delivered{ background: #d4edda; color: #155724; }
.status-cancelled{ background: #fbdadd; color: #7d0413; }
.status-unpaid   { background: #fbdadd; color: #7d0413; }
.status-processing { background: #d6ecf7; color: #004a73; }
.status-draft       { background: #e6e6e6; color: #444; }
.status-ordered     { background: #d6ecf7; color: #004a73; }
.status-partially_received { background: #fff3cd; color: #856404; }
.status-received    { background: #d4edda; color: #155724; }
.status-scheduled   { background: #fff3cd; color: #856404; }
.status-completed   { background: #d4edda; color: #155724; }

/* ── ADMIN LAYOUT ─────────────────────────────────────────── */
.admin-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 110px);
  gap: 0;
}
.admin-sidebar {
  background: var(--dark-2);
  color: #ccc;
  padding: 24px 0;
}
.admin-sidebar .admin-logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid #444;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.admin-sidebar .admin-logo span { color: var(--primary); }
.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: #bbb;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none !important;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(222,6,28,.15);
  color: #fff;
  border-right: 3px solid var(--primary);
}
.admin-sidebar nav .nav-section {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
  padding: 16px 20px 6px;
}
.admin-content { padding: 28px 32px; background: var(--light); }
.admin-page-title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  margin-bottom: 24px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  border-top: 3px solid var(--blue);
}
.stat-card .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--mid); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 800; margin-top: 4px; }
.stat-card.alert-stat { border-top-color: var(--primary); }
.stat-card.alert-stat .stat-value { color: var(--primary); }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  text-decoration: none !important;
  color: var(--dark);
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── UTILITIES ───────────────────────────────────────────── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.py-4 { padding: 32px 0; }
.py-5 { padding: 48px 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--mid); font-size: 13px; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: #aaa;
  padding: 48px 0 0;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-grid h4 {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 14px;
}
.footer-grid p { font-size: 13px; line-height: 1.7; }
.footer-grid ul li { margin-bottom: 6px; }
.footer-grid ul li a { color: #999; font-size: 13px; transition: color .15s; }
.footer-grid ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  background: #111;
  padding: 14px 0;
  margin-top: 40px;
  font-size: 12px;
  color: #666;
}

/* ── WHOLESALER PORTAL ───────────────────────────────────── */
.ws-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  color: #fff;
  padding: 36px 32px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  border-left: 4px solid var(--primary);
}
.ws-hero h2 { font-family: var(--font-display); font-size: 25px; font-weight: 800; }
.ws-hero .discount-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  padding: 8px 24px;
  border-radius: var(--radius);
  margin: 12px 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .search-bar { order: 3; width: 100%; max-width: 100%; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 36px; }
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}
