/* =====================================================================
   Part pública i àrea de client
   Estil: fons lila molt clar, targetes arrodonides i tenyides,
   degradat lila → rosa → corall, tipografia Inter molt negreta.
   ===================================================================== */
:root {
    --bg: #f6f8fe;
    --surface: #ffffff;
    --tint: #eef2fe;
    --tint-2: #e3eafd;
    --line: #e1e7f6;
    --ink: #111727;
    --ink-2: #465068;
    --muted: #8590a8;
    --primary: #2f5bea;
    --primary-dark: #1f45c9;
    --primary-soft: #e6edff;
    --pink: #7340e6;
    --pink-soft: #efe8ff;
    --mint: #0f7a5a;
    --mint-soft: #dcf5ec;
    --sky: #0e7fa8;
    --sky-soft: #dcf3fa;
    --peach: #b45309;
    --peach-soft: #fff1dc;
    --ok: #13805e;
    --warn: #a35c06;
    --err: #c42b4a;
    --grad: linear-gradient(135deg, #1e5eff 0%, #4f56f2 40%, #7a45ee 75%, #a24cf2 100%);
    --r-sm: 10px;
    --r: 16px;
    --r-lg: 24px;
    --shadow: 0 1px 2px rgba(20, 40, 110, .04), 0 8px 24px rgba(20, 40, 110, .06);
    --shadow-lg: 0 20px 50px rgba(30, 55, 150, .18);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.025em; font-weight: 800; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
h2 { font-size: 1.25rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.site-main { flex: 1; padding-bottom: 72px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.lead { color: var(--ink-2); font-size: 16px; margin: 0 0 4px; max-width: 640px; }
.ui-icon, .icon { width: 1em; height: 1em; vertical-align: -.125em; flex: none; }
.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--peach-soft); color: var(--peach); font-weight: 600; vertical-align: middle; }

/* ---------- Capçalera ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: -.02em; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; box-shadow: 0 4px 12px rgba(79, 86, 242, .3); }
.brand-logo.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; margin: 0 auto 18px; }
.site-nav { display: flex; gap: 4px; align-items: center; }
.nav-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav-pill:hover { background: var(--tint); color: var(--ink); }
.nav-pill.is-active { background: var(--pink-soft); color: var(--pink); font-weight: 600; }
.cart-count { background: var(--pink); color: #fff; border-radius: 99px; font-size: 10.5px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; font-weight: 700; font-style: normal; transition: transform .2s; }
.cart-count[hidden] { display: none; }
.cart-count.bump { transform: scale(1.35); }

/* Barra inferior (mòbil) */
.tabbar { display: none; }

/* ---------- Botons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: #c5d3f4; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(47, 91, 234, .28); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-white { background: #fff; border-color: #fff; color: var(--primary); }
.btn-white:hover { color: var(--primary-dark); background: #eef3ff; }
.btn-outline-white { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn-outline-white:hover { background: rgba(255, 255, 255, .18); color: #fff; border-color: #fff; }
.btn-mint { background: var(--mint-soft); border-color: var(--mint-soft); color: var(--mint); }
.btn-mint:hover { background: #c9eedf; border-color: #c9eedf; color: var(--mint); }
.btn-soft { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--tint-2); color: var(--primary-dark); }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 20px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; margin-bottom: 10px; }
.btn-incart { background: var(--mint-soft); border-color: var(--mint-soft); color: var(--mint); box-shadow: none; }
.btn-incart:disabled { cursor: default; opacity: 1; }
.btn-paypal { background: #ffc439; border-color: #ffc439; color: #111; }
.btn-paypal:hover { background: #f5b72a; border-color: #f5b72a; color: #111; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 17px; padding: 8px; border-radius: 10px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.icon-btn.danger:hover { background: #fdecee; color: var(--err); }

/* ---------- Formularis ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
input, textarea, select { font: 15px var(--font); padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #a8b1c6; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }

/* ---------- Avisos ---------- */
.flash-wrap:empty { display: none; }
.flash-wrap { padding-top: 16px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; margin: 0 0 8px; font-size: 14px; font-weight: 500; border: 0; }
.alert::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.alert-success { background: var(--mint-soft); color: var(--ok); }
.alert-error { background: #fdecee; color: var(--err); }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; margin: 12px 0; }
.notice .ui-icon { margin-top: 2px; }
.notice-warn { background: #fff4df; color: var(--warn); }
.notice-error { background: #fdecee; color: var(--err); }

/* ---------- Peces comunes ---------- */
.page-head { padding-top: 40px; margin-bottom: 8px; }
.block-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 36px 0 14px; }
.block-title > .ui-icon { color: var(--primary); }
.block-head { display: flex; justify-content: space-between; align-items: center; margin: 36px 0 14px; }
.block-head .block-title { margin: 0; }
.link-more { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.soft-card { background: var(--tint); border-radius: var(--r); padding: 22px 24px; color: var(--ink-2); line-height: 1.75; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.icon-square { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 20px; flex: none; overflow: hidden; }
.icon-square .cat-icon { width: 22px; height: 22px; object-fit: contain; }
.icon-square img.cat-icon { width: 100%; height: 100%; object-fit: cover; }
.icon-square.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.icon-square.sm .cat-icon { width: 15px; height: 15px; }
.icon-square.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }
.tint-lav { background: var(--primary-soft); color: var(--primary); }
.tint-pink { background: var(--pink-soft); color: var(--pink); }
.tint-mint { background: var(--mint-soft); color: var(--mint); }
.tint-sky { background: var(--sky-soft); color: var(--sky); }
.tint-peach { background: var(--peach-soft); color: var(--peach); }
.empty-state { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; justify-items: center; gap: 6px; color: var(--ink-2); }
.empty-state .btn { margin-top: 8px; }
.dot-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.dot-list li { position: relative; padding-left: 22px; }
.dot-list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 3px; background: var(--primary); }
.count-badge { font-size: 11px; font-weight: 600; background: var(--tint); color: var(--muted); padding: 1px 7px; border-radius: 99px; }

/* ---------- Inici ---------- */
.home { padding-top: 32px; }
.hero-card { position: relative; overflow: hidden; background: var(--grad); border-radius: 28px; padding: 44px 48px; display: flex; align-items: center; gap: 36px; color: #fff; box-shadow: var(--shadow-lg); }
.hero-blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); pointer-events: none; }
.hero-blob.b1 { width: 260px; height: 260px; right: -70px; top: -90px; }
.hero-blob.b2 { width: 140px; height: 140px; left: -50px; bottom: -60px; background: rgba(255, 255, 255, .1); }
.hero-avatar { width: 150px; height: 150px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .9); background: #fff; flex: none; overflow: hidden; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(15, 30, 90, .25); position: relative; }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-avatar span { font-size: 46px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-body { position: relative; min-width: 0; }
.hero-body h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 4px; color: #fff; }
.hero-tagline { margin: 0 0 12px; font-size: 17px; opacity: .92; }
.hero-chip { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .2); padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 500; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.tile { border-radius: var(--r); padding: 18px 12px; display: grid; justify-items: center; text-align: center; }
.tile strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.tile span { font-size: 13px; font-weight: 500; opacity: .85; }
.bio { font-size: 15.5px; }
.collection-list { display: grid; gap: 8px; }
.collection-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px 12px 12px; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.collection-row:hover { border-color: #c5d3f4; box-shadow: var(--shadow); color: var(--ink); transform: translateY(-1px); }
.collection-name { font-weight: 700; }
.collection-count { color: var(--muted); font-size: 13px; }
.collection-row .chevron { color: var(--muted); }
.latest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.latest-item { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--tint-2); }
.latest-item canvas { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .4s; }
.latest-item:hover canvas { transform: scale(1.04); }
.latest-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; color: #fff; font-size: 13px; font-weight: 600; background: linear-gradient(transparent, rgba(10, 20, 50, .65)); }

/* ---------- Galeria ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 22px 0 26px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px 12px; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.photo-grid { columns: 3 300px; column-gap: 20px; }
.photo-card { break-inside: avoid; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.photo-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.photo-frame { display: block; width: 100%; padding: 0; border: 0; background: var(--tint-2); cursor: zoom-in; position: relative; overflow: hidden; }
.photo-frame canvas, .cart-thumb canvas, .owned-thumb canvas { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .4s; }
canvas.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
canvas.is-ready { opacity: 1 !important; }
.photo-loading { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%) var(--tint-2); background-size: 250% 100%; animation: shimmer 1.4s infinite; }
.photo-frame.is-loaded .photo-loading { display: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(15, 20, 40, .55); color: #fff; display: grid; place-items: center; font-size: 14px; opacity: 0; transition: opacity .2s; }
.photo-frame:hover .zoom-hint { opacity: 1; }
.photo-tag { position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: var(--primary); font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.photo-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 14px; }
.photo-meta { display: grid; min-width: 0; }
.photo-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.photo-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.photo-price small { font-size: 11px; color: var(--muted); font-weight: 500; }


/* ---------- Visor lightGallery (tema de la web) ---------- */
.lg-fotos.lg-backdrop, .lg-backdrop { background: rgba(8, 12, 30, .96); }
.lg-fotos .lg-toolbar { background: linear-gradient(rgba(8, 12, 30, .55), transparent); }
.lg-fotos .lg-toolbar .lg-icon, .lg-fotos .lg-counter { color: #e3e8f7; }
.lg-fotos .lg-toolbar .lg-icon:hover { color: #fff; }
.lg-fotos .lg-counter { font-family: var(--font); font-weight: 600; font-size: 14px; }
.lg-fotos .lg-outer .lg-next, .lg-fotos .lg-outer .lg-prev { background: rgba(255, 255, 255, .1); color: #fff; border-radius: 50%; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; backdrop-filter: blur(6px); }
.lg-fotos .lg-outer .lg-next:hover:not(.disabled), .lg-fotos .lg-outer .lg-prev:hover:not(.disabled) { background: var(--primary); color: #fff; }
.lg-fotos .lg-image { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; border-radius: 6px; }
.lg-fotos .lg-outer .lg-sub-html { background: linear-gradient(transparent, rgba(8, 12, 30, .85) 40%); padding: 26px 20px 14px; }
.lg-cap { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; font-family: var(--font); }
.lg-cap-text { min-width: 0; }
.lg-cap h4 { margin: 0; color: #fff; font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-cap p { margin: 2px 0 0; color: #b9c2dc; font-size: 13.5px; }
.lg-cap p b { color: #fff; font-weight: 700; }
.lg-cap-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; padding: 10px 16px; border-radius: 12px; font: 600 14px var(--font); color: #fff; background: var(--grad); box-shadow: 0 6px 18px rgba(47, 91, 234, .4); text-decoration: none; }
.lg-cap-btn:hover { color: #fff; filter: brightness(1.08); }
.lg-cap-btn:disabled { opacity: .7; cursor: default; }
.lg-cap-btn.is-incart { background: rgba(255, 255, 255, .12); box-shadow: none; color: #b8f0d7; cursor: default; }
.lg-cap-btn.is-owned { background: #dcf5ec; color: var(--mint); box-shadow: none; }
.lg-fotos .lg-outer .lg-thumb-outer { background: rgba(8, 12, 30, .9); padding: 8px 0 10px; }
.lg-fotos .lg-outer .lg-thumb-item { border-radius: 10px; border: 2px solid transparent; opacity: .55; transition: opacity .2s, border-color .2s; }
.lg-fotos .lg-outer .lg-thumb-item:hover { opacity: .9; }
.lg-fotos .lg-outer .lg-thumb-item.active, .lg-fotos .lg-outer .lg-thumb-item:hover.active { border-color: #5a7bff; opacity: 1; }
.lg-fotos .lg-outer .lg-thumb-item img { border-radius: 8px; }
.lg-fotos .lg-progress-bar .lg-progress { background: var(--grad); }
/* Càrrega progressiva: indicador mentre arriba la foto gran i miniatures pendents */
.lg-fotos .lg-item:has(img.lg-image[src^="data:image/gif"])::after { content: ''; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .18); border-top-color: #7d95ff; animation: lg-spin .8s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }
.lg-fotos .lg-outer .lg-thumb-item { background: linear-gradient(100deg, #1a2040 30%, #262d55 50%, #1a2040 70%); background-size: 250% 100%; }
.lg-fotos .lg-outer .lg-thumb-item:not(.is-loaded) { animation: shimmer 1.4s infinite; }
.lg-fotos .lg-outer .lg-thumb-item:not(.is-loaded) img { opacity: 0; }
@media (max-width: 720px) {
    .lg-cap { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
    .lg-cap-btn { justify-content: center; }
}

/* ---------- Carret ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cart-layout .block-title:first-child { margin-top: 8px; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 16px; align-items: center; padding: 10px 10px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cart-thumb { width: 96px; aspect-ratio: 4/3; background: var(--tint-2); overflow: hidden; border-radius: 10px; }
.cart-info { display: grid; min-width: 0; }
.cart-info strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-info small { color: var(--muted); }
.cart-price { font-weight: 700; color: var(--primary); }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; color: var(--ink-2); font-size: 14px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list .ui-icon { color: var(--primary); margin-top: 3px; }
.summary-card { background: var(--tint); border-radius: var(--r-lg); padding: 22px; position: sticky; top: 84px; }
.summary-card h3 { margin-bottom: 12px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-2); font-size: 14px; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 20px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.billing { margin: 14px 0; font-size: 13px; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.billing summary { cursor: pointer; color: var(--ink-2); font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; }
.billing summary::-webkit-details-marker { display: none; }
.billing summary small { font-weight: 400; color: var(--muted); }
.billing label { display: grid; gap: 4px; margin-top: 10px; color: var(--ink-2); font-weight: 600; }
.billing input { padding: 9px 11px; font-size: 14px; border-radius: 10px; }

/* ---------- Entrar / registre ---------- */
.auth { display: grid; place-items: center; padding-top: 48px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 36px 32px; box-shadow: var(--shadow); text-align: center; }
.auth-card .form { text-align: left; margin-top: 22px; }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-card .lead { margin: 0 auto; font-size: 15px; }
.auth-card .center.small { margin-top: 16px; }

/* ---------- Àrea de client (amb barra lateral) ---------- */
.client-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; padding-top: 28px; align-items: start; }

.client-shell.no-side { grid-template-columns: 1fr; max-width: 860px; }
.client-side { background: var(--tint); border-radius: var(--r-lg); padding: 16px 12px; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; min-height: 420px; }
.client-user { display: flex; gap: 10px; align-items: center; padding: 4px 8px 14px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.client-user div { display: grid; min-width: 0; line-height: 1.3; }
.client-user strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-user small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left; }
.side-link:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.side-link.is-active { background: var(--pink-soft); color: var(--pink); font-weight: 600; }
.side-sep { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 2px; }
.side-sep form { margin: 0; }
.client-main h1 { font-size: 1.9rem; margin-bottom: 2px; }
.client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat-card { background: var(--tint); border-radius: var(--r); padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.stat-card .icon-square { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
.stat-card div { display: grid; line-height: 1.25; min-width: 0; }
.stat-card > div > span { font-size: 12.5px; color: var(--ink-2); }
.stat-card strong { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0; }
.stat-card small { font-size: 12px; color: var(--muted); }
.panel-card { background: var(--tint); border-radius: var(--r-lg); padding: 20px; margin-top: 16px; }
.panel-card > .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.panel-card > .panel-head h2 { font-size: 1.05rem; margin: 0; }
.owned-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.owned-card { background: var(--surface); border-radius: var(--r); overflow: hidden; display: grid; gap: 10px; padding-bottom: 14px; box-shadow: 0 1px 2px rgba(20, 40, 110, .05); }
.owned-card .btn { margin: 0 12px; }
.owned-thumb { aspect-ratio: 4/3; background: var(--tint-2); overflow: hidden; }
.owned-info { padding: 0 12px; display: grid; min-width: 0; }
.owned-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owned-info small { color: var(--muted); }
.list-rows { display: grid; gap: 8px; }
.list-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.list-row .num { font-weight: 700; white-space: nowrap; }
.list-row-main { display: grid; min-width: 0; line-height: 1.35; }
.list-row-main strong { font-size: 14px; }
.list-row-main small { color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 2px; }
.status-pill { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--mint-soft); color: var(--ok); }
.order-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.order-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; background: var(--surface); border-radius: 12px; }
.order-items li.total { background: transparent; font-size: 18px; font-weight: 800; grid-template-columns: 1fr auto; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.prose { font-size: 15.5px; }

/* ---------- Peu ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 13px; color: var(--muted); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Mòbil ---------- */
@media (max-width: 900px) {
    .cart-layout, .client-shell { grid-template-columns: 1fr; }
    .summary-card, .client-side { position: static; }
    .client-side { min-height: 0; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; scrollbar-width: none; }
    .client-side::-webkit-scrollbar { display: none; }
    .client-user, .side-sep { display: none; }
    .side-link { width: auto; white-space: nowrap; padding: 8px 12px; }
    .latest-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .wrap { padding: 0 16px; }
    .site-nav { display: none; }
    .header-inner { height: 56px; justify-content: center; }
    .site-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .site-footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
    .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
    .tabbar a { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; }
    .tab-icon { position: relative; width: 52px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-size: 19px; transition: background .15s; }
    .tab-icon .cart-count { position: absolute; top: -3px; right: 6px; }
    .tabbar a.is-active { color: var(--pink); }
    .tabbar a.is-active .tab-icon { background: var(--pink-soft); }
    .hero-card { flex-direction: column; text-align: center; padding: 32px 22px; border-radius: 24px; gap: 18px; }
    .hero-avatar { width: 116px; height: 116px; }
    .hero-actions { justify-content: center; }
    .stat-tiles { gap: 8px; }
    .tile { padding: 14px 6px; }
    .tile strong { font-size: 24px; }
    .tile span { font-size: 12px; }
    .page-head { padding-top: 24px; }
    .photo-grid { columns: 1; }
    .cart-item { grid-template-columns: 76px 1fr auto; }
    .cart-item .cart-price { grid-column: 2; grid-row: 2; }
    .cart-item form { grid-column: 3; grid-row: 1 / span 2; }
    .cart-thumb { width: 76px; }
    .auth { padding-top: 20px; }
    .auth-card { padding: 28px 20px; }
    .list-row { grid-template-columns: 1fr auto; }
    .list-row .icon-square { display: none; }
    .list-row .row-actions { grid-column: 1 / -1; }
    .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; gap: 10px; flex-direction: column; }
    .stat-card strong { font-size: 20px; }
    .stat-card:last-child { grid-column: 1 / -1; flex-direction: row; }
    .client-main h1 { font-size: 1.6rem; }
}

/* ---------- Mode manteniment ---------- */
.maint-body { min-height: 100vh; display: block; background: radial-gradient(1000px 500px at 15% -10%, #e3eafd, transparent), radial-gradient(800px 500px at 100% 110%, #efe8ff, transparent), var(--bg); }
.maint { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 32px 16px; }
.maint-card { position: relative; overflow: hidden; width: 100%; max-width: 620px; background: var(--grad); color: #fff; border-radius: 28px; padding: 48px 40px 40px; text-align: center; box-shadow: var(--shadow-lg); }
.maint-card > *:not(.hero-blob) { position: relative; }
.maint-icon { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; }
.maint-icon svg { width: 34px; height: 34px; }
.maint-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.maint-card h1 { color: #fff; font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 12px; }
.maint-lead { font-size: 16.5px; line-height: 1.6; opacity: .95; margin: 0 auto; max-width: 460px; }
.maint-until { margin: 26px auto 0; display: grid; gap: 12px; justify-items: center; }
.maint-until > span { font-size: 14px; font-weight: 600; background: rgba(255, 255, 255, .18); padding: 5px 14px; border-radius: 99px; }
.maint-count { display: grid; grid-template-columns: repeat(4, 76px); gap: 10px; }
.maint-count div { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: 16px; padding: 10px 4px 8px; display: grid; }
.maint-count b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.maint-count small { font-size: 11.5px; opacity: .85; }
.maint-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.maint-foot { margin: 0; font-size: 13px; }
.maint-foot a { color: var(--muted); }
.maint-preview { position: sticky; top: 0; z-index: 5; background: #111727; color: #fff; text-align: center; font-size: 13.5px; padding: 10px 16px; }
.maint-preview a { color: #9db4ff; font-weight: 600; margin-left: 6px; }
.maint-banner { background: #111727; color: #e3e8f7; font-size: 13.5px; }
.maint-banner .wrap { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap; text-align: center; }
.maint-banner b { color: #fff; }
.maint-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb547; box-shadow: 0 0 0 4px rgba(255, 181, 71, .2); }
.maint-banner a { color: #9db4ff; font-weight: 600; }
.auth-card .notice { text-align: left; }
@media (max-width: 520px) {
    .maint-card { padding: 36px 20px 28px; border-radius: 24px; }
    .maint-count { grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
    .maint-count b { font-size: 22px; }
}

/* ---------- Selector d'idioma (ES | CA) ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--tint); border: 1px solid var(--line); flex: none; }
.lang-switch a { font: 700 11.5px/1 var(--font, inherit); letter-spacing: .04em; color: var(--ink-2); padding: 6px 8px; border-radius: 7px; transition: background .15s, color .15s; }
.lang-switch a:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.lang-switch a.is-active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(17, 23, 39, .12); }
.header-inner .site-nav { margin-left: auto; }
.maint-lang { position: fixed; top: 14px; right: 14px; z-index: 5; }
@media (max-width: 720px) {
    .header-inner { justify-content: space-between; }
}
