/* ============================================================
   CPAPFinder - Style Sheet
   Design tokens synchronized with drcpap.pl
   Extracted from cpapfinder-mockup-final.html
   ============================================================ */

:root {
  /* drcpap.pl design tokens */
  --navy: #1a2744;
  --navy-light: #243352;
  --teal: #1f8578;
  --teal-light: #166d62;
  --teal-bright: #2cb5a4;
  --teal-bg: #edf8f6;
  --warm: #f5f2ed;
  --warm-dark: #ebe6dd;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-bg: #fffbeb;
  --text: #2c2c2c;
  --muted: #71717a;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --red: #ef4444;
  --green: #22c55e;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.1);
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--text); background: #fff; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }
a { text-decoration: none; color: inherit; }

/* LAYOUT */
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.section { padding: 72px 0; }
.section-title { font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.section-subtitle { color: var(--muted); font-size: .95rem; margin-bottom: 32px; }

/* NAV */
.nav-top { background: var(--navy); color: white; }
.nav-main { background: white; border-bottom: 1px solid var(--slate-200); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.nav-link { font-size: 14px; font-weight: 500; color: var(--slate-600); padding: 12px 16px; transition: all .2s; border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; background: none; border-top: none; border-left: none; border-right: none; }
.nav-link:hover { color: var(--teal); border-bottom-color: var(--teal); }
.nav-link.active { color: var(--teal); border-bottom-color: var(--teal); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-dropdown-trigger svg { transition: transform .2s; }
.nav-dropdown.open .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 1px); left: 0; min-width: 220px;
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.1); padding: 8px 0; z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  font-size: 14px; font-weight: 500; color: var(--slate-700); text-decoration: none;
  transition: background .15s;
}
.nav-dropdown-item:hover { background: var(--slate-50); color: var(--teal); }

/* External nav links */
.nav-link-ext { font-size: 13px; }

/* SEARCH */
.search-bar { background: white; border: 2px solid var(--slate-200); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.search-bar:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,133,120,.12); }
.search-bar input { border: none; outline: none; font-size: 15px; padding: 12px 16px; flex: 1; background: transparent; font-family: inherit; }
.search-bar select { border: none; background: var(--slate-50); padding: 8px 12px; border-radius: 6px; font-size: 13px; color: var(--slate-600); margin-right: 6px; outline: none; cursor: pointer; font-family: inherit; }
.search-btn { background: var(--teal); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: background .2s; }
.search-btn:hover { background: var(--teal-light); }

/* Search dropdown */
.search-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--slate-200); border-top: none; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); z-index: 150; display: none; max-height: 320px; overflow-y: auto; }
.search-dropdown.visible { display: block; }
.search-dropdown-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .15s; }
.search-dropdown-item:hover, .search-dropdown-item.highlighted { background: var(--slate-50); }
.search-dropdown-item .search-match { color: var(--teal); font-weight: 700; }

/* CARDS */
.card { background: white; border-radius: var(--radius); border: 1px solid var(--slate-200); transition: .2s; overflow: hidden; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-product { cursor: pointer; }

/* BUTTONS - pill shape matching drcpap.pl */
.btn-primary { background: var(--teal); color: white; font-weight: 700; padding: 13px 26px; border-radius: 50px; border: none; cursor: pointer; font-size: .88rem; transition: .2s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-primary:hover { background: var(--teal-light); color: white; }
.btn-secondary { background: transparent; color: var(--text); font-weight: 700; padding: 13px 26px; border-radius: 50px; border: 1.5px solid #d4d0c8; cursor: pointer; font-size: .88rem; transition: .2s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost { background: transparent; color: rgba(255,255,255,.75); font-weight: 700; padding: 13px 26px; border-radius: 50px; border: 1.5px solid rgba(255,255,255,.2); cursor: pointer; font-size: .88rem; transition: .2s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-ghost:hover { border-color: var(--teal-bright); color: var(--teal-bright); }
.btn-amber { background: var(--amber); color: var(--navy); font-weight: 700; padding: 13px 26px; border-radius: 50px; border: none; cursor: pointer; font-size: .88rem; transition: .2s; font-family: inherit; }
.btn-amber:hover { background: var(--amber-light); }

/* BADGES */
.expert-badge { background: linear-gradient(135deg, var(--teal), #166d62); color: white; font-size: .7rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; letter-spacing: .1em; text-transform: uppercase; }
.expert-badge svg { width: 14px; height: 14px; }
.nfz-badge { background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; letter-spacing: .3px; }
.variant-label { font-size: 11px; color: var(--slate-400); font-weight: 500; }
.tag { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }

/* PRICE */
.price-main { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 28px; color: var(--navy); }
.price-old { text-decoration: line-through; color: var(--slate-400); font-size: 14px; }
.price-nfz { background: var(--teal-bg); color: var(--teal); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

/* RATING */
.rating-bar { height: 6px; border-radius: 3px; background: var(--slate-200); overflow: hidden; }
.rating-fill { height: 100%; border-radius: 3px; background: var(--teal); transition: width .6s ease; }
.star { color: var(--amber); }
.star-empty { color: var(--slate-300); }

/* FILTERS */
.filter-group { border-bottom: 1px solid var(--slate-100); padding: 16px 0; }
.filter-title { font-weight: 600; font-size: 13px; color: var(--slate-700); cursor: pointer; display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .5px; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; color: var(--slate-600); cursor: pointer; }
.filter-option:hover { color: var(--teal); }
.filter-option.disabled { opacity: .4; pointer-events: none; }
.filter-chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid var(--slate-200); background: white; cursor: pointer; transition: all .2s; }
.filter-chip:hover, .filter-chip.active { background: var(--teal-bg); border-color: var(--teal); color: var(--teal); }

/* TABS */
.tab { padding: 12px 24px; font-weight: 600; font-size: 14px; color: var(--slate-500); border-bottom: 2px solid transparent; cursor: pointer; transition: all .2s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab:hover { color: var(--slate-700); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* SHOP ROW */
.shop-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 8px; transition: background .2s; gap: 16px; }
.shop-row:hover { background: var(--slate-50); }
.shop-row.best { background: var(--teal-bg); border: 1px solid rgba(13,148,136,.2); }

/* EXPERT SECTION */
.expert-section { background: linear-gradient(135deg, var(--teal-bg), #ddf0ed); border: 1px solid rgba(31,133,120,.12); border-radius: var(--radius); }

/* SPEC TABLE */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td, .spec-table th { padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--slate-100); }
.spec-table th { text-align: left; font-weight: 600; color: var(--slate-500); background: var(--slate-50); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.spec-table tr:hover td { background: var(--slate-50); }
.spec-highlight { background: var(--teal-bg) !important; font-weight: 600; color: var(--teal); }

/* VARIANT SELECTOR */
.variant-pills { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.variant-pill { padding: 8px 18px; border-radius: 50px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--navy); color: var(--navy); background: white; cursor: pointer; transition: all .2s; font-family: inherit; }
.variant-pill:hover { border-color: var(--teal); color: var(--teal); }
.variant-pill.active { background: var(--teal); border-color: var(--teal); color: white; }
.variant-pill.disabled { opacity: 0.4; cursor: not-allowed; border-color: var(--slate-300); color: var(--slate-400); }

/* VARIANT SUMMARY TABLE */
.variant-summary { border: 1px solid var(--slate-200); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.variant-summary-header { display: grid; grid-template-columns: 1.5fr 1fr 1fr; padding: 6px 14px; font-size: 11px; color: var(--slate-400); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; background: var(--slate-50); border-bottom: 1px solid var(--slate-200); }
.variant-summary-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; padding: 8px 14px; font-size: 13px; align-items: center; border-bottom: 1px solid var(--slate-100); cursor: pointer; transition: background .15s; }
.variant-summary-row:last-child { border-bottom: none; }
.variant-summary-row:hover { background: var(--slate-50); }
.variant-summary-row.active { background: var(--teal-bg); font-weight: 600; }
.variant-summary-row .label { color: var(--slate-600); }
.variant-summary-row .price { font-weight: 700; color: var(--navy); text-align: right; }
.variant-summary-row .price-nfz { font-weight: 600; color: var(--teal); text-align: right; font-size: 12px; }
.variant-summary-row .no-data { color: var(--slate-400); text-align: right; }

/* RANKING TABS */
.ranking-tab { padding: 10px 22px; border-radius: 50px; font-size: 14px; font-weight: 600; border: 1.5px solid var(--slate-300); color: var(--slate-600); background: white; cursor: pointer; transition: all .2s; font-family: inherit; }
.ranking-tab:hover { border-color: var(--teal); color: var(--teal); }
.ranking-tab.active { background: var(--navy); border-color: var(--navy); color: white; }

/* COMPARE BAR */
.compare-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); color: white; padding: 16px 24px; z-index: 200; transform: translateY(100%); transition: transform .3s; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 -4px 20px rgba(0,0,0,.2); }
.compare-bar.visible { transform: translateY(0); }

/* COMPARE CHECKBOX */
.compare-check { width: 20px; height: 20px; border: 2px solid var(--slate-300); border-radius: 4px; cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; justify-content: center; background: white; }
.compare-check:hover { border-color: var(--teal); }
.compare-check.active { background: var(--amber); border-color: var(--amber); }
.compare-check.active::after { content: '⇆'; color: white; font-size: 11px; }

/* HERO */
.hero { background: var(--navy); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; top: -50%; right: -20%; width: 60%; height: 200%; background: radial-gradient(ellipse, rgba(31,133,120,.12) 0%, transparent 70%); pointer-events: none; }

/* PRODUCT IMAGE PLACEHOLDER */
.product-img { background: #fff; border: 1px solid var(--slate-200); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--slate-400); }
.product-img svg { opacity: .4; }

/* BREADCRUMB */
.breadcrumb { font-size: 13px; color: var(--slate-400); display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--slate-500); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--teal); }

/* TOOLTIP */
.tooltip { position: relative; }
.tooltip::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--navy); color: white; padding: 6px 12px; border-radius: 6px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tooltip:hover::after { opacity: 1; }

/* FORM ELEMENTS */
.check { width: 18px; height: 18px; border: 2px solid var(--slate-300); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; cursor: pointer; }
.check.checked { background: var(--teal); border-color: var(--teal); }
.check.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 700; }
.radio { width: 18px; height: 18px; border: 2px solid var(--slate-300); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; cursor: pointer; }
.radio.selected { border-color: var(--teal); }
.radio.selected::after { content: ''; width: 8px; height: 8px; background: var(--teal); border-radius: 50%; }
.toggle { width: 44px; height: 24px; border-radius: 12px; background: var(--slate-300); position: relative; cursor: pointer; transition: background .2s; }
.toggle.on { background: var(--teal); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.toggle.on::after { transform: translateX(20px); }
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--slate-200); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--teal); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(13,148,136,.3); }

/* TOAST */
.toast { position: fixed; top: 20px; right: 20px; padding: 14px 24px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 500; transform: translateX(120%); transition: transform .3s ease; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.toast.visible { transform: translateX(0); }
.toast.success { background: var(--teal); color: white; }
.toast.warning { background: var(--amber); color: var(--navy); }
.toast.error { background: var(--red); color: white; }

/* SEARCH RESULTS */
.search-results-container { max-width: 800px; }

/* LOADING / ERROR / EMPTY STATES */
.state-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; text-align: center; padding: 48px 24px; }
.state-container h2 { font-size: 24px; color: var(--navy); margin-bottom: 12px; }
.state-container p { color: var(--slate-500); font-size: 15px; margin-bottom: 24px; max-width: 400px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--slate-200); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeInCards { from { opacity: 0; } to { opacity: 1; } }
.card-animate { animation: fadeInCards .15s ease; }

/* ARTICLE CARD (blog-style, homepage + product page) */
.article-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--teal);
}
.article-card h4 { transition: color .15s; }
.article-card:hover h4 { color: var(--teal) !important; }

/* CATEGORY CARD image zoom on hover */
.category-card:hover img { transform: scale(1.06); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }

/* FOOTER */
.site-footer { background: var(--slate-50); border-top: 1px solid var(--slate-200); padding: 48px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
.footer-heading { font-weight: 700; margin-bottom: 16px; font-size: 15px; }
.footer-links { list-style: none; font-size: 14px; color: var(--slate-600); line-height: 2; }
.footer-links a { color: inherit; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid var(--slate-200); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--slate-500); }

/* Footer CPAPblog branding */
.footer-cpapblog {
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-cpapblog-link {
  display: flex; align-items: center; gap: 16px; text-decoration: none; flex-wrap: wrap;
}
.footer-cpapblog-logo { display: flex; align-items: center; gap: 10px; }
.footer-cpapblog-desc { font-size: 13px; color: var(--slate-500); }
.footer-cpapblog-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-cpapblog-links a {
  font-size: 13px; font-weight: 600; color: var(--teal); text-decoration: none;
  padding: 6px 14px; border: 1px solid var(--teal); border-radius: 50px; transition: all .2s;
}
.footer-cpapblog-links a:hover { background: var(--teal); color: white; }

/* RESPONSIVE */
@media(max-width:1080px) {
  .container { padding: 0 24px; }
}
@media(max-width:768px) {
  .container { padding: 0 20px; }
  .section { padding: 56px 0; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .footer-cpapblog { flex-direction: column; text-align: center; }
  .footer-cpapblog-links { justify-content: center; }

  /* Nav: hide top bar, compact nav */
  .nav-top { display: none; }
  #main-nav { display: none; }
  .search-bar { max-width: 100% !important; }
  #search-category { display: none; }
}
@media(max-width:480px) {
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .btn-primary, .btn-secondary, .btn-ghost, .btn-amber { padding: 11px 20px; font-size: .82rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
