/* ════════════════════════════════════════════
   SmartValGuiden – Gemensam CSS  (shared.css)
   Inkluderas på alla sidor.
   ════════════════════════════════════════════ */

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

/* ── CSS-VARIABLER ── */
:root {
  --navy: #0f2a52;
  --navy-light: #1a3f78;
  --green: #2a7a4b;
  --green-light: #34a060;
  --gold: #e8a020;
  --white: #ffffff;
  --off-white: #f6f8fc;
  --gray: #6b7a99;
  --gray-light: #e8edf5;
  --text: #1a2640;
  --red: #e53935;
  --red-light: #fce4ec;
  --shadow: 0 4px 24px rgba(15,42,82,0.10);
  --shadow-lg: 0 8px 40px rgba(15,42,82,0.16);
}

html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; color: var(--text); line-height: 1.6; }

/* ── NAVBAR ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 64px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.logo { font-size: 1.3rem; font-weight: 800; color: white; text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--green-light); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: rgba(255,255,255,0.82); text-decoration: none; font-size: 0.88rem; font-weight: 600; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active-nav { color: var(--green-light); }
.nav-cta { background: var(--green); color: white !important; padding: 0.45rem 1.1rem; border-radius: 6px; }
.nav-cta:hover { background: var(--green-light) !important; }

/* ── HAMBURGER ── */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; z-index: 201; }
.hamburger span { display: block; width: 24px; height: 2.5px; background: white; border-radius: 2px; transition: all 0.3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--navy); z-index: 200; flex-direction: column;
  padding: 2rem 5%; overflow-y: auto; animation: fadeDown 0.25s ease;
}
.mobile-menu.open { display: flex; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-menu a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 1.1rem; font-weight: 700; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); transition: color 0.2s; }
.mobile-menu a:hover { color: var(--green-light); }
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu .mob-cta { margin-top: 1.5rem; background: var(--green); color: white !important; text-align: center; padding: 1rem; border-radius: 10px; border-bottom: none !important; }

/* ── MOBILANPASSNING (nav) ── */
@media (max-width: 600px) { .nav-links { display: none; } .hamburger { display: flex; } }

/* ── SIDLADDNINGS-INDIKATOR ── */
#page-loader {
  position: fixed; top: 0; left: 0; width: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  z-index: 9999; transition: width 0.4s ease, opacity 0.5s ease;
}

/* ── BREADCRUMB ── */
.breadcrumb { padding: 0.8rem 5%; font-size: 0.78rem; color: var(--gray); background: var(--off-white); border-bottom: 1px solid var(--gray-light); }
.breadcrumb a { color: var(--green); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* ── SIDHUVUD – GRADIENT + SVG-MÖNSTER ── */
.article-header, .cat-header, .admin-page-header, .page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1e5799 100%);
  position: relative; overflow: hidden; color: white;
}
.article-header::before, .cat-header::before, .admin-page-header::before, .page-header::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── METADATA I SIDHUVUD ── */
.article-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.meta-tag { background: rgba(52,160,96,0.2); border: 1px solid rgba(52,160,96,0.4); color: #7dd9a5; padding: 0.25rem 0.8rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.meta-date, .meta-read { font-size: 0.78rem; color: rgba(255,255,255,0.55); }

/* ── ARTIKEL-LAYOUT (2-kolumner med sidebar) ── */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; padding: 2.5rem 5%; max-width: 1200px; margin: 0 auto; align-items: start; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

/* ── SEKTIONER ── */
.section { padding: 50px 5%; }
.section-alt { background: var(--off-white); }
.section-title { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: 1.5rem; }
.section-title span { display: block; width: 36px; height: 4px; background: var(--green); border-radius: 2px; margin-top: 5px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-lead { color: var(--gray); font-size: 0.92rem; line-height: 1.8; max-width: 780px; font-family: 'Lora', serif; margin-bottom: 1.5rem; }
.see-all { color: var(--green); text-decoration: none; font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

/* ── STJÄRN-BETYG ── */
.stars { color: var(--gold); font-size: 0.82rem; letter-spacing: 2px; margin-bottom: 0.4rem; }
.stars span { color: var(--gray); font-size: 0.75rem; margin-left: 4px; }

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-card { background: var(--off-white); border: 1.5px solid var(--gray-light); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.2rem; }
.sidebar-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }

/* ── SCORE-BAR ── */
.score-bar { flex: 1; height: 6px; background: var(--gray-light); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; background: var(--green); border-radius: 3px; }

/* ── MEDALJ-FÄRGER ── */
.rank-1, .r1 { background: #d4af37; }
.rank-2, .r2 { background: #a0a0a0; }
.rank-3, .r3 { background: #cd7f32; }

/* ── VERDICT-BOX (sidebar) ── */
.verdict-box { background: var(--navy); color: white; border-radius: 14px; padding: 1.5rem; margin-bottom: 1.2rem; }
.verdict-box h4 { font-size: 0.9rem; margin-bottom: 0.8rem; }
.verdict-box p { font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.6; font-family: 'Lora', serif; }
.verdict-score { font-size: 2.5rem; font-weight: 800; color: var(--green-light); text-align: center; margin: 1rem 0 0.3rem; }
.verdict-label { text-align: center; font-size: 0.75rem; color: rgba(255,255,255,0.55); }

/* ── KÖP-KNAPP ── */
.btn-buy { display: inline-block; background: var(--green); color: white; padding: 0.6rem 1.1rem; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.78rem; white-space: nowrap; transition: background 0.2s; }
.btn-buy:hover { background: var(--green-light); }
.btn-back,
.btn-back-dyn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  color: white;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.2);
  margin-top: 1.5rem;
}
.btn-back:hover,
.btn-back-dyn:hover { background: rgba(255,255,255,0.22); }

/* ── PUBLIKA INFONOTER ── */
.affiliate-note {
  background: #f0fdf4;
  border-left: 3px solid var(--green);
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  color: #2d6a4f;
  margin-bottom: 1.5rem;
  border-radius: 0 6px 6px 0;
}

/* ── PRODUKTBILDER ── */
.product-hero-media {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e8edf5, #c8d4ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.product-hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.45rem;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.16));
}
.spotlight-media {
  background: linear-gradient(135deg, #eef3fb, #d9e3f3);
  border: 1px solid var(--gray-light);
  border-radius: 16px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
  font-size: 3rem;
}
.spotlight-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.6rem;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.14));
}

/* ── STARTSIDA – TOPPVAL ── */
.top-picks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}
.top-pick-card {
  background: white;
  border: 1.5px solid var(--gray-light);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.top-pick-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #edf3fb;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  align-self: flex-start;
}
.top-pick-main {
  display: flex;
  gap: 0.95rem;
  align-items: stretch;
}
.top-pick-card .product-hero-media {
  flex: 0 0 42%;
  width: auto;
  height: auto;
  min-height: 176px;
  padding: 0.7rem;
  align-self: stretch;
  justify-content: center;
  overflow: hidden;
}
.top-pick-card .product-hero-image {
  width: 100%;
  height: 100%;
  max-width: 188px;
  max-height: 188px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  mix-blend-mode: normal;
  filter: drop-shadow(0 14px 28px rgba(15,42,82,0.16));
}
.top-pick-copy {
  flex: 0 1 58%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.top-pick-brand {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 0.28rem;
}
.top-pick-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 0.45rem;
}
.top-pick-desc {
  color: var(--gray);
  font-size: 0.82rem;
  line-height: 1.65;
  font-family: 'Lora', serif;
}
.top-pick-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.top-pick-meta-item {
  background: var(--off-white);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
}
.top-pick-meta-item strong {
  display: block;
  font-size: 0.64rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.24rem;
}
.top-pick-meta-item span {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}
.top-pick-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.top-pick-cta,
.top-pick-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.78rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
}
.top-pick-cta {
  background: var(--green);
  color: white;
  flex: 1;
}
.top-pick-cta:hover { background: var(--green-light); }
.top-pick-secondary {
  border: 1.5px solid var(--gray-light);
  color: var(--navy);
  background: white;
}
.top-pick-secondary:hover {
  border-color: #c7d6ea;
  box-shadow: var(--shadow);
}

/* ── STARTSIDA – SEO-LÄNKAR & FAQ ── */
.seo-link-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.seo-link-card,
.faq-card {
  background: white;
  border: 1.5px solid var(--gray-light);
  border-radius: 18px;
  padding: 1.25rem;
}
.seo-link-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.seo-link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #c7d6ea;
}
.seo-link-card strong,
.faq-card h3 {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0.55rem;
}
.seo-link-card span,
.faq-card p {
  color: var(--gray);
  font-size: 0.84rem;
  line-height: 1.7;
  font-family: 'Lora', serif;
}

@media (max-width: 900px) {
  .top-picks-grid,
  .seo-link-grid,
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .top-pick-main { flex-direction: column; }
  .top-pick-card .product-hero-media {
    flex-basis: auto;
    min-height: 156px;
  }
  .top-pick-meta { grid-template-columns: 1fr; }
}

/* ── TOAST-NOTIFIERING ── */
#toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: white; padding: 0.75rem 1.5rem; border-radius: 50px; font-size: 0.83rem; font-weight: 700; box-shadow: 0 8px 32px rgba(0,0,0,0.22); z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FOOTER ── */
footer { background: #080f1c; color: rgba(255,255,255,0.55); padding: 30px 5%; text-align: center; font-size: 0.78rem; margin-top: 3rem; }

/* ── FADE-UP ANIMATION ── */
.fade-up {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.5s cubic-bezier(.22,.68,0,1.1), transform 0.5s cubic-bezier(.22,.68,0,1.1);
}
.fade-up.visible { opacity: 1; transform: none; }
.fade-up:nth-child(2) { transition-delay: 0.07s; }
.fade-up:nth-child(3) { transition-delay: 0.14s; }
.fade-up:nth-child(4) { transition-delay: 0.21s; }
.fade-up:nth-child(5) { transition-delay: 0.28s; }
.fade-up:nth-child(6) { transition-delay: 0.35s; }
.fade-up:nth-child(7) { transition-delay: 0.42s; }
.fade-up:nth-child(8) { transition-delay: 0.49s; }

/* ── PRODUKTKORT – BADGE ── */
.card-badge { position: absolute; top: 12px; left: 12px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; padding: 0.25rem 0.7rem; border-radius: 50px; z-index: 2; }
.badge-best   { background: var(--gold);    color: #3a2000; }
.badge-budget { background: var(--green);   color: white; }
.badge-new    { background: var(--navy);    color: white; }
.badge-value  { background: #7c3aed;        color: white; }

/* ── FILTER-CHIP (filterpiller) ── */
.chip { padding: 0.32rem 0.9rem; border-radius: 50px; border: 1.5px solid var(--gray-light); background: white; font-size: 0.75rem; font-weight: 600; color: var(--gray); cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.chip:hover   { border-color: var(--green); color: var(--green); }
.chip.active  { background: var(--green); border-color: var(--green); color: white; }

/* ── PLUS/MINUS-LISTA (artikel och produktsida) ── */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.5rem 0; }
@media (max-width: 600px) { .pros-cons { grid-template-columns: 1fr; } }
.pros, .cons { border-radius: 12px; padding: 1rem 1.2rem; }
.pros { background: #f0faf4; border: 1.5px solid #b2dfce; }
.cons { background: #fff5f5; border: 1.5px solid #fecdd3; }
.pros h4 { color: var(--green); font-size: 0.85rem; font-weight: 800; margin-bottom: 0.7rem; }
.cons h4 { color: var(--red);   font-size: 0.85rem; font-weight: 800; margin-bottom: 0.7rem; }
.pros ul, .cons ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.pros li, .cons li { font-size: 0.8rem; line-height: 1.5; padding-left: 1.2rem; position: relative; }
.pros li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cons li::before { content: '✗'; position: absolute; left: 0; color: var(--red);   font-weight: 700; }

/* ── KÖP-LÄNK I JÄMFÖRELSETABELL (ersätter inline hover) ── */
.btn-buy-link { display: block; background: var(--green); color: white; padding: 0.6rem 0.8rem; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.75rem; text-align: center; width: 100%; transition: background 0.2s; }
.btn-buy-link:hover { background: var(--green-light); }

/* ── RIPPLE-EFFEKT (används av initRipple() i shared.js) ── */
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0); animation: rippleAnim 0.55s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ── BRAND-LOGGOR ── */
.brand-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: none;
}
.card-brand img.brand-logo {
  height: 16px;
}

/* ── DARK MODE ── */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #1a4080;
    --navy-light: #2a5ca8;
    --white: #1a1f2e;
    --off-white: #12172a;
    --gray: #8a9bbf;
    --gray-light: #2a3450;
    --text: #e8ecf4;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  }
  body { background: #12172a; color: #e8ecf4; }
  .table-wrapper, .specs-section, .product-hero, .sidebar-card { background: #1e2640; }
  .admin-table tbody tr:hover td { background: #1a2035; }
  nav { background: #0a1628; }
  footer { background: #060d1a; }
}

/* ── TANGENTBORDSNAVIGERING: Focus-stilar (WCAG 2.1 AA) ── */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ── SKIP-NAVIGATION (tillgänglighet för tangentbordsanvändare) ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--navy);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ── PREFERS-REDUCED-MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── FOKUSSTILAR — tangentbordsnavigering (WCAG 2.1 AA) ── */
:focus-visible {
  outline: 2.5px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) {
  outline: none;
}
/* Starkare fokus för knappar */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2.5px solid var(--green);
  outline-offset: 2px;
}

/* ── HOPPA TILL INNEHÅLL — skip link (WCAG 2.4.1) ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  background: var(--green);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

