:root{
  --max-width:1100px;
  --accent:#fa4f00;
  --muted:#6b7280;
  --card-border:#e6e6e6;
  --bg:#f7f7f8;
  --placeholder:#efefef;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:#111}
.container{max-width:var(--max-width);margin:0 auto;padding:20px}
.site-header{background:#fff;border-bottom:1px solid var(--card-border)}
.logo{font-weight:700;color:var(--accent);text-decoration:none;font-size:20px}
.hero{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}
.subtitle{color:var(--muted);margin:4px 0 0}
.updated{color:var(--muted);text-align:right;font-size:14px}
.disclosure{color:var(--muted);font-size:14px;margin-top:12px}
.privacy-body{color:var(--muted);font-size:14px;margin-top:12px}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;margin-top:18px}
.card{background:#fff;border:1px solid var(--card-border);border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:10px}
.card .top{display:flex;justify-content:space-between;align-items:center}
.rank{font-weight:700;color:#333}
.score{background:#0b7;color:#fff;padding:6px 8px;border-radius:6px;font-weight:700}
/*.imgWrap{width:100%;height:0;padding-bottom:66%;position:relative;border-radius:6px;overflow:hidden;background:var(--placeholder);display:flex;align-items:center;justify-content:center}
/*.imgWrap img { height: 0; transition: height .2s ease; } /* bad if left */
/* Ensure the wrapper reserves space and the image fills it */
.imgWrap {
  width: 100%;
  /* Reserve an aspect ratio to avoid collapse and layout shift */
  /*aspect-ratio: 16 / 9; /* adjust to your preferred ratio */
  overflow: hidden;
  display: block;
  object-position: center;
  height: auto;
  width: auto;
}
/* Make the image fill the wrapper and center the visible area */
.imgWrap img {
  display: block;
  width: auto;
  height: auto;
  object-fit: cover;       /* cover fills the box while preserving aspect ratio */
  object-position: center; /* center the image inside the box */
}
.imgWrap img.loaded { height: auto; }

h1{margin:8px 0 4px;font-size:20px}
h2{margin:8px 0 4px;font-size:18px}
h3{margin:8px 0 4px;font-size:16px}
.specs{color:var(--muted);font-size:14px;margin:0}
.meta{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:8px}
.cta{background:var(--accent);color:#fff;padding:6px 6px;border-radius:6px;text-decoration:none;font-weight:700}
.details{color:var(--muted);text-decoration:none;font-size:14px;border:none;background:none;cursor:pointer;padding:6px}
.merchant{color:var(--muted);font-size:13px;margin-top:6px}

.site-footer{background:#fff;border-top:1px solid var(--card-border);padding:18px 0;margin-top:40px;text-align:center}

/* Modal styles */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:1000}
.modal[aria-hidden="false"]{display:flex}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.45)}
.modal-panel{position:relative;z-index:1001;width:min(980px,96%);max-height:90vh;overflow:auto;background:#fff;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,0.2);padding:18px}
.modal-close{position:absolute;right:12px;top:8px;background:transparent;border:0;font-size:28px;line-height:1;color:#333;cursor:pointer}
.modal-content{outline:none}
.modal-grid{display:flex;gap:18px;flex-wrap:wrap}
.modal-img{flex:1 1 420px;min-width:100px}
.modal-img img{width: auto;height:auto;border-radius:8px;display:block;opacity:0;transition:opacity .35s ease}
.modal-img img.loaded{opacity:1}
.modal-meta{flex:1 1 320px;min-width:260px}
.modal-meta h1{margin:0 0 8px;font-size:22px}
.modal-meta p{margin:25px 0;color:var(--muted)}
.modal-buy{margin-top:12px}
.modal-buy .cta{padding:12px 16px;font-size:16px}

/* Focus styles */
.modal-close:focus, .cta:focus, .details:focus, .card a:focus {outline:3px solid rgba(255,111,0,0.25);outline-offset:2px}

/* Load sentinel (invisible) */
.load-sentinel{height:1px;width:1px;opacity:0;pointer-events:none}

/* Responsive */
@media (max-width:640px){
  .hero{flex-direction:column;align-items:flex-start}
  .updated{text-align:left}
  .modal-grid{flex-direction:column}
}

.categories-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;margin-top:18px}
.category-tile{background:#fff;border:1px solid var(--card-border);border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:10px;cursor:pointer;text-decoration:none;color:inherit}
.category-tile .thumb{width:auto;height:auto;border-radius:6px;overflow:hidden;background:var(--placeholder);display:flex;align-items:center;justify-content:center}
.category-tile img{width:100%;height:100%;object-fit:contain;display:block}
.category-tile h3{margin:6px 0 0;font-size:18px}
.category-tile p{color:var(--muted);font-size:14px;margin:0}
.category-preview{display:flex;gap:8px;margin-top:8px}
.category-preview .mini{flex:1;min-width:0}
.category-view{margin-top:18px}
#back-to-cats{margin-bottom:12px}

.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 20px;
}

.category-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: #333;
  border: 1px solid #eee;
  transition: box-shadow .2s ease;
}

.category-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
}

:root {
  color-scheme: light dark;
}

/* Floating banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  background: #222;
  color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 9999;
  font-size: 14px;
  transform: translateY(20px);
  opacity: 0;
  animation: cookie-slide-in 0.4s ease-out forwards;
}

@keyframes cookie-slide-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner p {
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.cookie-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cookie-buttons button {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

/* Buttons */
#accept-cookies {
  background: #4caf50;
  color: #fff;
}

#reject-cookies {
  background: #e53935;
  color: #fff;
}

#open-settings,
#save-settings {
  background: #555;
  color: #fff;
}

/* Settings panel */
.cookie-settings {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  color: #000;
  padding: 20px;
  border-top: 2px solid #ccc;
  z-index: 9999;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

.cookie-settings label {
  display: block;
  margin: 8px 0;
}

/* Dark mode friendliness */
@media (prefers-color-scheme: dark) {
  .cookie-banner {
    background: #111;
    color: #f5f5f5;
  }
  .cookie-settings {
    background: #222;
    color: #f5f5f5;
    border-top-color: #444;
  }
}

/* Utility */
.hidden {
  display: none;
}

.manage-cookies-link {
  font-size: 13px;
  justify-content: center;
}