/*
Theme Name: Glovo Wheel
Description: Mobile, tablet and desktop friendly WooCommerce theme with editable service menus, a spinning category wheel, listings, requests, rewards and profiles.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: glovo-wheel
License: GPLv2 or later
*/

:root {
  --gw-brand: #6D28D9;
  --gw-brand-ink: #FFFFFF;
  --gw-brand-soft: #EDE9FE;
  --gw-yellow: #FFC244;
  --gw-ink: #1B1B1B;
  --gw-muted: #6B6B6B;
  --gw-bg: #F6F6F3;
  --gw-card: #FFFFFF;
  --gw-line: #E7E7E2;
  --gw-radius: 16px;
  --gw-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--gw-bg);
  color: var(--gw-ink);
  line-height: 1.5;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; }
:focus-visible { outline: 3px solid var(--gw-brand); outline-offset: 3px; }

.gw-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.gw-skip:focus { left: 12px; }

.gw-container { width: min(100% - 32px, var(--gw-max)); margin-inline: auto; }
@media (min-width: 768px) { .gw-container { width: min(100% - 48px, var(--gw-max)); } }
.gw-main { padding: 16px 0 56px; }

/* ---------- Header ---------- */
.gw-header { position: sticky; top: 0; z-index: 50; background: var(--gw-card); border-bottom: 1px solid var(--gw-line); }
.admin-bar .gw-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .gw-header { top: 32px; } }
.gw-header__inner { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.gw-logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--gw-brand); }
.gw-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
.gw-nav::-webkit-scrollbar { display: none; }
.gw-menu { display: flex; gap: 18px; list-style: none; margin: 0; padding: 4px 0; white-space: nowrap; }
.gw-menu a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.gw-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.gw-header .search-form { display: flex; }
.gw-header .search-field { width: 120px; padding: 8px 14px; border: 1px solid var(--gw-line); border-radius: 999px; background: var(--gw-bg); font: inherit; font-size: .9rem; }
.gw-header .search-submit { display: none; }
.gw-cart { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: var(--gw-brand); color: var(--gw-brand-ink); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.gw-cart__count { background: var(--gw-yellow); color: var(--gw-ink); border-radius: 999px; padding: 0 7px; font-size: .8rem; }
@media (min-width: 600px) { .gw-header .search-field { width: 180px; } }
@media (min-width: 900px) { .gw-nav { order: 0; width: auto; overflow: visible; } }

/* ---------- Buttons and forms ---------- */
.gw-btn, .gw-card .button, .button {
  display: inline-block; background: var(--gw-brand); color: var(--gw-brand-ink); border: 0;
  border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none;
  text-align: center; cursor: pointer; margin-top: auto;
}
.gw-btn:hover, .gw-card .button:hover { filter: brightness(1.08); }
.gw-form .gw-fields { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 700px) { .gw-form .gw-fields { grid-template-columns: 1fr 1fr; } }
.gw-form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.gw-form input, .gw-form select, .gw-form textarea, .gw-filters input, .gw-filters select {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--gw-line);
  border-radius: 10px; background: #fff; width: 100%;
}
.gw-notice { background: var(--gw-brand-soft); color: #4C1D95; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }
.gw-note { color: var(--gw-muted); font-size: .9rem; }
.gw-login { max-width: 360px; }

/* ---------- Menu tiles (home) ---------- */
.gw-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 0 0; }
.gw-tile {
  display: flex; align-items: flex-end; min-height: 120px; padding: 16px;
  border-radius: var(--gw-radius); background: var(--tile, var(--gw-brand)); color: #fff;
  text-decoration: none; font-weight: 700; font-size: 1.05rem; line-height: 1.2;
}
.gw-tile:hover { filter: brightness(1.06); }
@media (min-width: 1024px) {
  .gw-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .gw-tile { min-height: 160px; font-size: 1.15rem; }
}
.gw-subcat { display: inline-block; background: #fff; border: 1px solid var(--gw-line); border-radius: 999px; padding: 8px 14px; margin: 0 8px 8px 0; text-decoration: none; font-weight: 600; }

/* ---------- Entries ---------- */
.gw-entry { background: var(--gw-card); border-radius: var(--gw-radius); padding: 20px; }
@media (min-width: 768px) { .gw-entry { padding: 32px; } }
.gw-entry-title { font-size: 1.6rem; margin: 0 0 12px; }
.gw-lead { color: var(--gw-muted); margin: 0 0 16px; }
.gw-panel__title { font-size: 1.3rem; margin: 24px 0 12px; font-weight: 700; }
.gw-panel[hidden] { display: none; }
.gw-meta { font-size: .9rem; color: var(--gw-muted); }

/* ---------- Product and listing grid: 2 columns on mobile and tablet, 4 on desktop ---------- */
.gw-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .gw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.gw-card { background: var(--gw-card); border-radius: var(--gw-radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.gw-card__link { text-decoration: none; }
.gw-card img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.gw-card__title { font-size: .98rem; margin: 6px 0 0; font-weight: 700; }
.gw-card__price { font-weight: 700; }
.gw-single-img { border-radius: 12px; margin-bottom: 12px; }

/* ---------- Filters ---------- */
.gw-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--gw-card); padding: 12px; border-radius: var(--gw-radius); margin-bottom: 16px; }
.gw-filters label { display: grid; gap: 4px; font-size: .85rem; flex: 1 1 140px; }

/* ---------- Profile and rewards ---------- */
.gw-profile { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.gw-avatar img { border-radius: 50%; width: 96px; height: 96px; object-fit: cover; }
.gw-stat { background: var(--gw-brand); color: #fff; border-radius: var(--gw-radius); padding: 18px; display: grid; gap: 4px; margin-bottom: 16px; }
.gw-stat strong { font-size: 2rem; }
.gw-ledger { list-style: none; padding: 0; margin: 0; }
.gw-ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gw-line); }

/* ---------- Wheel ---------- */
.gw-front { display: block; }
.gw-wheel-section { text-align: center; padding: 12px 0 8px; }
.gw-wheel {
  position: relative; width: min(88vw, 420px); aspect-ratio: 1 / 1; margin: 0 auto;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.gw-wheel:active { cursor: grabbing; }
.gw-wheel::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 40%, var(--gw-brand-soft) 100%);
  border: 2px dashed #C4B5FD;
}
.gw-wheel__item {
  position: absolute; left: 50%; top: 50%; width: clamp(64px, 22%, 104px);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit;
  transform: translate(-50%, -50%) scale(calc(0.82 + var(--prox, 0) * 0.28));
  will-change: transform;
}
.js .gw-wheel:not(.is-ready) .gw-wheel__item { visibility: hidden; }
.gw-wheel__circle {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: var(--gw-card);
  border: 3px solid var(--gw-card); box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  display: grid; place-items: center; transition: border-color .2s;
}
.gw-wheel__item.is-active .gw-wheel__circle { border-color: var(--gw-brand); }
.gw-wheel__img { width: 100%; height: 100%; object-fit: cover; }
.gw-wheel__fallback { font-weight: 800; font-size: 1.4rem; }
.gw-wheel__label { font-size: .75rem; font-weight: 700; background: var(--gw-card); padding: 2px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.gw-wheel__hub {
  position: absolute; left: 50%; top: 50%; width: 36%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%); border-radius: 50%; background: var(--gw-brand); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 12px; font-weight: 800;
  font-size: clamp(.95rem, 3.6vw, 1.3rem); box-shadow: 0 10px 30px rgba(109, 40, 217, .35); pointer-events: none;
}
.gw-wheel__hint { color: var(--gw-muted); font-size: .9rem; margin: 14px 0 0; }
@media (min-width: 600px) { .gw-wheel { width: min(70vw, 480px); } }
@media (min-width: 1280px) {
  .gw-front { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: start; }
  .gw-wheel-section { position: sticky; top: 110px; padding-top: 24px; }
  .gw-wheel { width: min(100%, 460px); }
}

/* ---------- Footer ---------- */
.gw-footer { background: var(--gw-ink); color: #ddd; padding: 28px 0; font-size: .9rem; }
.gw-footer a { color: #fff; }
.gw-footer__inner { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
@media (min-width: 768px) { .gw-footer__inner { flex-direction: row; justify-content: space-between; align-items: center; } }
.gw-footer .gw-menu { flex-wrap: wrap; gap: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Menu wheels (home, sub-menus, shortcode) ---------- */
.gw-menu-wheel { padding-top: 8px; }
.gw-menu-wheel .gw-wheel__item { text-decoration: none; color: inherit; }
.gw-menu-circle { background: var(--c, var(--gw-brand)); color: #fff; border-color: #fff; }
.gw-menu-circle .gw-wheel__fallback { color: #fff; font-size: clamp(1.1rem, 4vw, 1.8rem); font-weight: 800; }
.gw-menu-wheel .gw-wheel__label { white-space: normal; text-align: center; max-width: 120px; line-height: 1.2; font-weight: 700; }
.gw-menu-wheel .gw-wheel__hub { font-size: clamp(.85rem, 3.2vw, 1.1rem); }
.gw-back { display: inline-block; margin-bottom: 8px; color: var(--gw-brand); font-weight: 700; text-decoration: none; }

/* Menu wheel tap targets: the centre hub opens the active circle; clear space under a sticky header */
.gw-menu-wheel { scroll-margin-top: 110px; }
.gw-menu-wheel .gw-wheel__hub { pointer-events: auto; cursor: pointer; flex-direction: column; gap: 2px; }
.gw-menu-wheel .gw-wheel__item { -webkit-tap-highlight-color: transparent; min-width: 64px; min-height: 64px; }
.gw-hub-tap { font-size: .7rem; font-weight: 400; opacity: .9; }

/* Per-menu colours: --c is the menu background, --t is its text colour, --wbg is the menu-area background */
.gw-menu-wheel { --wbg: #EDE9FE; }
.gw-menu-wheel .gw-wheel::before {
	background: radial-gradient(circle, #fff 0 40%, var(--wbg) 100%);
	border-color: var(--wbg);
}
.gw-menu-circle { background: var(--c, #6D28D9); color: var(--t, #FFFFFF); }
.gw-menu-circle .gw-wheel__fallback { color: var(--t, #FFFFFF); }
.gw-menu-wheel .gw-wheel__label {
	background: var(--c, #6D28D9);
	color: var(--t, #FFFFFF);
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.gw-menu-wheel .gw-wheel__hub { background: var(--gw-card); color: var(--gw-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.gw-menu-wheel .gw-hub-tap { color: var(--gw-muted); }
