/* ==========================================================
   MAIN DESIGN SYSTEM & CSS TOKENS
   Multi-Category E-Commerce Platform (Pisteuo)
   ========================================================== */

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

:root {
  /* Brand Palette */
  --primary: #075cff;
  --primary-hover: #0048d8;
  --primary-light: #eaf2ff;
  --primary-glow: rgba(7, 92, 255, 0.2);

  --accent: #002766;
  --accent-hover: #001a47;
  --accent-light: #e8eef8;

  --brand-navy: #001f52;
  --brand-blue: #075cff;
  --brand-blue-deep: #003fbd;
  --brand-gradient: linear-gradient(135deg, #001f52 0%, #003fbd 55%, #075cff 100%);

  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  /* Neutral Dark / Light */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #93c5fd;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 40px -15px rgba(15, 23, 42, 0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  max-width: 100%;
}

/* Utility Containers */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-fluid {
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

main,
section,
.container,
.container-fluid,
.grid > *,
.nav-wrapper > *,
.footer-grid > * {
  min-width: 0;
}

/* Micro Header / Top Bar */
.top-bar {
  background: var(--brand-navy);
  color: #dbeafe;
  font-size: 0.8125rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-bar a:hover {
  color: #ffffff;
}

/* Main Navigation Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #dbeafe;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.brand-logo img {
  width: auto;
  max-width: 160px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo .brand-icon {
  color: var(--primary);
  font-size: 1.75rem;
}

.brand-logo .brand-highlight {
  color: var(--primary);
}

/* Global Search Bar */
.search-container {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  transition: all var(--transition-fast);
}

.search-input-group:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-input-group input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9375rem;
  color: var(--text-main);
}

.search-input-group .search-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.search-input-group .search-btn:hover {
  background: var(--primary-hover);
}

/* Nav Action Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
  transition: all var(--transition-fast);
}

.nav-action-btn:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.nav-action-btn .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Category Navigation Strip */
.category-nav-strip {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav-strip::-webkit-scrollbar {
  display: none;
}

.category-nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  white-space: nowrap;
}

.category-nav-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.category-nav-link:hover, .category-nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Footer */
.main-footer {
  margin-top: auto;
  background: var(--brand-gradient);
  color: #bfdbfe;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .top-bar .flex-between {
    gap: 0.75rem;
  }
  .top-bar .flex-between > * {
    min-width: 0;
  }
  .nav-wrapper {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .brand-logo img {
    width: auto;
    max-width: 140px;
    height: 58px;
  }
  .nav-actions {
    margin-left: auto;
    gap: 0.25rem;
  }
  .nav-action-btn {
    padding: 0.5rem;
  }
  .search-container {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    width: 100%;
  }
  .search-input-group input {
    min-width: 0;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .container,
  .container-fluid {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .top-bar { font-size: 0.7rem; }
  .top-bar .flex-between { align-items: flex-start; }
  .top-bar .flex-between > :first-child { flex: 1; }
  .flex-between {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .nav-wrapper { gap: 0.5rem; }
  .brand-logo img { width: auto; max-width: 120px; height: 52px; }
  .nav-action-btn span:not(.badge-count) { display: none; }
  .search-input-group { padding-left: 1rem; }
  .search-input-group input { font-size: 0.875rem; }
  .main-footer { padding-top: 2.5rem; }
}
