:root {
      --bg: #0f172a;         /* slate-900 */
      --panel: #111827;      /* gray-900 */
      --muted: #94a3b8;      /* slate-400 */
      --text: #e5e7eb;       /* gray-200 */
      --brand: #22c55e;      /* emerald-500 */
      --brand-600: #16a34a;  /* emerald-600 */
      --accent: #38bdf8;     /* sky-400 */
      --warn: #fbbf24;       /* amber-400 */
      --error: #ef4444;      /* red-500 */
      --radius: 16px;
      --shadow: 0 10px 30px rgba(0,0,0,.45);
    }
    * { box-sizing: border-box; }
    html, body { height: 100%; }
/* prevent accidental horizontal scroll on small devices */
html, body { overflow-x: hidden; }
    body {
      margin: 0;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
      background: radial-gradient(1200px 800px at 80% -10%, rgba(56,189,248,.15), transparent 50%),
                  radial-gradient(1000px 600px at -10% 10%, rgba(34,197,94,.12), transparent 50%),
                  var(--bg);
      color: var(--text);
      line-height: 1.6;
    }
    a { color: var(--accent); text-decoration: none; }
    img { max-width: 100%; display: block; }
    .container { width: 100%; max-width: 1100px; padding: 0 1rem; margin: 0 auto; }
    /* ensure inner blocks use full width of the container */
    .category-group, .category-list, .card { width: 100%; box-sizing: border-box; }

    /* Header */
    header {
      position: sticky; top: 0; z-index: 50;
      backdrop-filter: blur(8px);
      background: rgba(15,23,42,.75);
      border-bottom: 1px solid rgba(148,163,184,.15);
    }
    .nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
    .brand { display:flex; align-items:center; gap:.6rem; font-weight: 700; letter-spacing:.3px; }
    .brand .logo { width: 34px; aspect-ratio:1; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: var(--shadow); }
    .brand img { height:32px; width:auto; border-radius:6px; box-shadow: var(--shadow); }
    .nav a { color: var(--text); opacity:.9; }
    .nav-links { display:flex; gap:1rem; flex-wrap: wrap; align-items:center; }
    .cta { background: var(--brand); color: #041318; padding: .6rem 1rem; border-radius: 999px; font-weight: 700; }
    .cta:hover { background: var(--brand-600); }
    .lang { margin-left:.25rem; border:1px solid rgba(148,163,184,.25); background: rgba(2,6,23,.3); color: var(--text); padding:.45rem .6rem; border-radius:10px; cursor:pointer; }

    /* Hero */
    .hero { padding: 3rem 0 2rem; display:grid; grid-template-columns: 1.2fr .8fr; gap:2rem; align-items:center; }
    .hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0 0 .75rem; }
    .hero p { color: var(--muted); margin: 0 0 1rem; }
    .hero .card { background: linear-gradient(180deg, rgba(17,24,39,.8), rgba(17,24,39,.6)); border: 1px solid rgba(148,163,184,.2); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
    .badges { display:flex; gap:.6rem; flex-wrap:wrap; margin:.5rem 0 1.25rem; }
    .badge { border:1px solid rgba(56,189,248,.35); color: #cdefff; padding:.35rem .6rem; border-radius: 999px; font-size:.875rem; }
    .hero-img { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
    .hero-img img { width: 100%; height: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }

    /* Grid */
    .grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:1rem; }
    @media (max-width: 960px){ .hero{ grid-template-columns:1fr; } .grid{ grid-template-columns: 1fr 1fr; } }
    @media (max-width: 640px){ .grid{ grid-template-columns: 1fr; } }

    /* Cards */
    .card { background: rgba(17,24,39,.65); border:1px solid rgba(148,163,184,.15); border-radius: var(--radius); padding:1rem; box-shadow: var(--shadow); }
    .card h3 { margin:.2rem 0 .4rem; font-size: 1.1rem; }
    .kpi { display:flex; gap:.75rem; align-items:center; color: var(--muted); font-size:.95rem; }

    /* Section */
    section { padding: 2rem 0; }
    section h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 .75rem; }
    .muted { color: var(--muted); }

    /* Catalog */
    .product { display:flex; gap:.75rem; align-items:flex-start; }
    .product .pic { width: 54px; height:54px; border-radius: 12px; background: linear-gradient(135deg, rgba(56,189,248,.25), rgba(34,197,94,.25)); border:1px solid rgba(148,163,184,.2); }
    .pill { display:inline-flex; align-items:center; gap:.4rem; font-size:.85rem; padding:.3rem .6rem; border-radius: 999px; border:1px solid rgba(148,163,184,.25); color: var(--muted); }

    /* Table */
    table { width:100%; border-collapse: collapse; }
    th, td { padding:.6rem .5rem; text-align:left; border-bottom:1px dashed rgba(148,163,184,.25); }
    th { color: #cbd5e1; font-weight:600; }

    /* Forms */
    form { display:grid; gap:.75rem; }
    input, select, textarea, button { font: inherit; }
    .field { display:grid; gap:.35rem; }
    .control { padding:.7rem .8rem; border-radius: 10px; border:1px solid rgba(148,163,184,.25); background: rgba(2,6,23,.3); color: var(--text); }
/* make controls reliably fit the available width */
.control { min-height:44px; font-size:16px; width:100%; box-sizing:border-box; }
    .control:focus { outline: 2px solid var(--accent); }
/* ensure long text (product names, titles) wraps on small screens */
.card, .category-title, .product-name { overflow-wrap: anywhere; word-break: break-word; }
.product-name { white-space: normal; }

    .btn { background: var(--brand); color:#041318; border:none; padding:.8rem 1rem; border-radius: 12px; font-weight: 700; cursor:pointer; }
    .btn.secondary { background: rgba(56,189,248,.15); color:#cdefff; border:1px solid rgba(56,189,248,.35); }
    .btn:disabled { opacity:.6; cursor: not-allowed; }

    .two { display:grid; grid-template-columns: 1fr 1fr; gap:1rem; }
    @media (max-width: 640px){ .two{ grid-template-columns:1fr; } }

    /* Footer */
    footer { padding: 1.25rem 0 2.5rem; color: var(--muted); border-top: 1px solid rgba(148,163,184,.15); }

    /* Toast */
    .toast { position: fixed; right: 1rem; bottom: 1rem; background: #052e1a; color:#d1fae5; border:1px solid rgba(16,185,129,.4); border-radius: 10px; padding:.8rem 1rem; box-shadow: var(--shadow); opacity:0; transform: translateY(10px); transition: .3s ease; }
    .toast.show { opacity:1; transform: translateY(0); }

    /* Gallery images */
    .gallery { display:grid; grid-template-columns: 1fr 1fr; gap:1rem; }
    @media (max-width:640px){ .gallery{ grid-template-columns:1fr; } }

    /* Floating CTA */
    .floating-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display:flex; justify-content:center; padding: .5rem; }
    .floating-cta .btn { width: min(480px, 100%); border-radius: 999px; box-shadow: var(--shadow); }
    @media (min-width: 960px){ .floating-cta{ right: 1rem; left: auto; bottom: 1rem; } .floating-cta .btn{ width:auto; } }
    /* Mobile-first UX tweaks */
    @media (max-width: 960px){
      .nav-links{ display:none; }
      .menu-btn{ display:inline-flex; }
    }
    .menu-btn{ display:none; align-items:center; gap:.5rem; padding:.5rem .75rem; border-radius:10px; border:1px solid rgba(148,163,184,.25); background: rgba(2,6,23,.3); color:var(--text); cursor:pointer; }
    .mobile-panel{ position: fixed; inset: 56px 0 auto 0; background: rgba(2,6,23,.98); border-top:1px solid rgba(148,163,184,.15); box-shadow: var(--shadow); display:none; z-index: 55; }
    .mobile-panel.open{ display:block; }
    .mobile-panel nav{ display:grid; gap:.5rem; padding: .75rem 1rem 1rem; }
    .mobile-panel a, .mobile-panel button{ padding:.8rem 1rem; border-radius:12px; background: rgba(15,23,42,.6); color:var(--text); border:1px solid rgba(148,163,184,.15); text-align:center; }

    /* Big tap targets */
    .btn{ min-height:48px; }
    .control{ min-height:44px; font-size:16px; }

    /* Toast on mobile */
    @media (max-width:640px){
      .toast{ left: 1rem; right: 1rem; }
    }

    /* Floating CTA already present */

    /* Category grouping styles */
    .category-group { margin-bottom: 1.25rem; }
    .category-title {
      background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
      padding: 0.75rem 1rem;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }
    .category-title::after {
      content: '\25B6'; /* triangle */
      transform: rotate(90deg);
      transition: transform .18s ease;
      opacity: .9;
    }
    .category-title[aria-expanded='true']::after { transform: rotate(270deg); }

    .category-list {
      margin-top: 0.75rem;
      display: block;
      overflow: hidden;
      transition: max-height .28s ease, padding .18s ease, margin .18s ease;
      max-height: 9999px; /* expanded by default in CSS terms, collapsed controlled by class */
    }
    .category-list.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
    .category-list.open { max-height: 2000px; padding-top: 0.75rem; }
    .category-list .card.product { margin: 0 0 0.75rem 0; padding: 0.9rem 1rem; }

    /* Mobile-first responsive improvements */
@media (max-width: 960px) {
  .container { padding: 0 1rem; max-width: 100%; }
  header .nav { flex-direction: row; align-items: center; gap: .5rem; }
  .brand { gap: .5rem; }
  .brand .logo { width: 38px; height: 38px; border-radius: 8px; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .hero { grid-template-columns: 1fr; gap: 1rem; padding: 2rem 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  .card { padding: .9rem; }
}

@media (max-width: 720px) {
  /* ensure no horizontal scroll */
  html, body { overflow-x: hidden; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  .brand .logo { width: 36px; height: 36px; }
  .hero { padding: 1.5rem 0; }
  .grid { grid-template-columns: 1fr; }
  .category-title, .product-title { padding: .6rem .75rem; }
  .product-title .product-price-small { display: none; }
  .product-details.open { padding-top: .5rem; }
  .floating-cta { padding: .6rem; }
  .floating-cta .btn { width: calc(100% - 2rem); max-width: none; }
  footer .container { padding: 0 1rem; }
  .mobile-panel { left: 0; right: 0; top: 56px; }
}

@media (max-width: 420px) {
  .brand span { font-size: 15px; }
  .hero h1 { font-size: 20px; }
  .btn { font-size: 15px; }
  .control { font-size: 15px; padding: .65rem .7rem; }
  .category-list .card.product { padding: .7rem; }
}

/* make mobile panel full height under header */
.mobile-panel { max-height: calc(100vh - 56px); overflow-y: auto; }

/* collapse animation smoothing */
.category-list { transition: max-height .32s cubic-bezier(.2,.9,.2,1), padding .2s ease; }
.product-details { transition: max-height .28s cubic-bezier(.2,.9,.2,1), padding .18s ease; }

/* safe area for floating CTA on iOS */
.floating-cta { padding-bottom: calc(env(safe-area-inset-bottom) + .5rem); }

/* ensure large tap targets */
.product-title, .category-title { min-height:44px; }

    /* Mobile-specific adjustments */
    @media (max-width: 720px) {
      .container { padding-left: 1rem; padding-right: 1rem; }
      .category-group { margin-bottom: 1rem; }
      .category-title {
        padding: 0.7rem 0.9rem;
        font-size: 1rem;
        border-radius: 10px;
      }
      .category-title::after { font-size: 0.9rem; }
      .category-list .card.product { padding: 0.8rem; margin-bottom: 0.7rem; }
      .card.product .product-name { font-size: 1rem; }
      .card.product .muted { font-size: 0.9rem; }
      /* make hero card stack nicely */
      .hero { gap: 1rem; }
      .hero .card.hero-img { order: 2; }
      .hero > div:first-child { order: 1; }
      /* extra small screens tweaks */
      @media (max-width: 420px) {
        .btn { padding: .75rem .85rem; font-size: 15px; }
        .control { padding: .6rem .7rem; font-size: 15px; }
        section { padding: 1rem 0; }
      }
    }

    /* Slightly larger spacing on small desktops */
    @media (min-width: 721px) and (max-width: 1000px) {
      .category-list .card.product { padding: 1rem; margin-bottom: 0.9rem; }
      .category-title { padding: 0.8rem 1rem; }
    }

    /* Product entry within category */
    .product-entry { margin-bottom: 0.5rem; }
    .product-title {
      padding: 0.65rem 0.8rem; background: rgba(255,255,255,0.02); border-radius: 8px; cursor: pointer; display:flex; justify-content:space-between; align-items:center; gap:0.6rem;
    }
    .product-title:focus { outline: 2px solid rgba(56,189,248,.18); }
    .product-title .product-price-small { color: var(--muted); font-size: 0.95rem; }

    .product-details { overflow: hidden; transition: max-height .25s ease, padding .18s ease; max-height:0; padding-top:0; }
    .product-details.open { max-height: 1200px; padding-top: .6rem; }
    .product-details .card.product { margin: 0; padding: .8rem; }

    /* ensure categories and entries take full width */
    .category-group, .category-list, .product-entry { width: 100%; }

    /* improve spacing on very small screens */
    @media (max-width: 420px) {
      .product-title { padding: .6rem .65rem; font-size: 15px; }
      .product-title .product-price-small { font-size: 14px; }
      .category-title { padding: .6rem .65rem; }
      .category-list .card.product { padding: .7rem; }
    }