/* ============================================================
   OUTLET M ITALIA — stile condiviso frontend + backend
   Base dark/industrial + tocchi "liquid glass"
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --ink: #f0ede8;
  --muted: #9a9a92;
  --muted-2: #6b6b64;
  --red: #E5241B;
  --green: #3AAA48;
  --hairline: rgba(255,255,255,0.08);
  --glass-bg: rgba(255,255,255,0.045);
  --glass-bg-strong: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.10);
  --radius: 14px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Lato', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── background ambience (glass needs something to blur) ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 700px 500px at 15% 0%, rgba(229,36,27,0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 15%, rgba(58,170,72,0.08), transparent 60%);
  pointer-events: none;
}

/* ── glass utility ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 30px rgba(0,0,0,0.35);
}
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* ── HEADER ── */
.site-bar {
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  padding: 0 5vw;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.site-logo { display: flex; align-items: center; gap: 10px; }
.site-logo img { height: 28px; width: auto; }
.site-logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink);
}
.site-logo-text span { color: var(--red); }
.site-bar-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red);
  border: 1px solid rgba(229,36,27,0.4);
  padding: 4px 12px; border-radius: 2px;
}

/* ── PAGE HEAD (titolo pagina catalogo) ── */
.page-head {
  max-width: 1100px; margin: 0 auto;
  padding: 40px 5vw 24px;
}
.page-head-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 3.5px;
  text-transform: uppercase; color: var(--red);
  margin-bottom: 14px;
}
.page-head-label::before {
  content: ''; display: block; width: 24px; height: 1px; background: var(--red);
}
.page-head-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 800; line-height: 0.95;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.page-head-sub {
  margin-top: 12px; font-size: 15px; font-weight: 300;
  color: var(--muted); max-width: 520px; line-height: 1.6;
}

/* ── FILTER / SEARCH BAR ── */
.filter-bar-wrap {
  position: sticky; top: 56px; z-index: 40;
  max-width: 1100px; margin: 0 auto;
  padding: 14px 5vw;
}
.filter-bar {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
}
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 15px; width: 100%;
  font-family: 'Lato', sans-serif;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box svg { flex-shrink: 0; opacity: 0.6; }

.chips-row {
  display: flex; gap: 8px; overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
  padding-bottom: 2px;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; white-space: nowrap;
  color: var(--muted); border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: all .2s ease;
}
.chip.active {
  color: var(--ink);
  border-color: rgba(229,36,27,0.5);
  background: rgba(229,36,27,0.14);
}

/* ── DIVIDER ── */
.section-divider {
  max-width: 1100px; margin: 0 auto;
  padding: 0 5vw;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 24px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--hairline);
}
.section-divider-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--muted-2);
  white-space: nowrap;
}

/* ── CARDS GRID ── */
.cards-section { max-width: 1100px; margin: 0 auto; padding: 0 5vw 80px; margin-top: 15px; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted-2);
  font-size: 14px;
}

/* ── PRODUCT CARD ── */
.pcard {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .3s, transform .25s;
}
.pcard:hover { border-color: rgba(229,36,27,0.35); transform: translateY(-3px); }
.pcard-img {
  width: 100%; aspect-ratio: 4/3;
  background: #161616;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .pcard-img img { transform: scale(1.04); }
.pcard-img-placeholder {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 40px; font-weight: 800; letter-spacing: -1px;
  color: rgba(255,255,255,0.06); text-transform: uppercase; user-select: none;
}
.pcard-badge {
  position: absolute; top: 12px; left: 12px;
  color: #fff; font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
  padding: 5px 12px; border-radius: 999px; z-index: 2;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.pcard-badge.cond-nuovo { background: rgba(58,170,72,0.85); }
.pcard-badge.cond-usato { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.2); }
.pcard-badge.cond-ricambi { background: rgba(229,36,27,0.85); }

.pcard-body { padding: 20px 18px 22px; display: flex; flex-direction: column; flex: 1; }
.pcard-category {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px;
}
.pcard-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.3px; line-height: 1.15; margin-bottom: 8px;
}
.pcard-meta {
  font-size: 12px; color: var(--muted); margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.pcard-sep { height: 1px; background: var(--hairline); margin-bottom: 14px; }
.pcard-prices { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pcard-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px; font-weight: 800; color: var(--red); line-height: 1;
}
.pcard-price small { font-size: 16px; font-weight: 700; vertical-align: super; margin-right: 1px; }
.pcard-iva { font-size: 11px; color: var(--muted-2); text-align: right; line-height: 1.3; }

/* ── FOOTER ── */
.outlet-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 5vw 100px;
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
}
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 800; letter-spacing: 2px;
  flex-shrink: 0;
}
.footer-logo span { color: var(--red); }

.footer-contacts { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-contact-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.footer-contact-pill:hover {
  border-color: rgba(229,36,27,0.4);
  background: rgba(229,36,27,0.08);
  transform: translateY(-1px);
}
.footer-contact-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.footer-contact-icon.icon-phone { background: rgba(229,36,27,0.14); color: var(--red); }
.footer-contact-icon.icon-whatsapp { background: rgba(37,211,102,0.16); color: #25D366; }
.footer-contact-icon.icon-email { background: rgba(255,255,255,0.08); color: var(--muted); }
.footer-contact-text { display: flex; flex-direction: column; line-height: 1.25; }
.footer-contact-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted-2);
}
.footer-contact-value { font-size: 13px; font-weight: 600; color: var(--ink); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding-top: 20px; border-top: 1px solid var(--hairline);
}
.footer-note { font-size: 12px; color: var(--muted-2); line-height: 1.6; max-width: 460px; }
.footer-admin-link {
  font-size: 11px; color: var(--muted-2); letter-spacing: 1px;
  border: 1px solid var(--hairline); padding: 6px 12px; border-radius: 999px;
  transition: color .2s, border-color .2s; white-space: nowrap;
}
.footer-admin-link:hover { color: var(--muted); border-color: var(--glass-border); }

@media (max-width: 640px) {
  .footer-contacts { flex-direction: column; align-items: stretch; }
  .footer-contact-pill { padding: 10px 16px 10px 10px; }
}

/* ============================================================
   PAGINA PRODOTTO
   ============================================================ */
.product-page { max-width: 1100px; margin: 0 auto; padding: 24px 5vw 120px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 20px;
}
.back-link:hover { color: var(--ink); }

.product-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }

/* galleria */
.gallery-main {
  aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
  background: #161616; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: start;
  aspect-ratio: 4/3; background: #161616;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hairline); }
.gallery-dot.active { background: var(--red); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--hairline); opacity: 0.6; cursor: pointer;
}
.gallery-thumb.active { opacity: 1; border-color: var(--red); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* info */
.product-category-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}
.product-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(28px, 5vw, 42px); font-weight: 800;
  text-transform: uppercase; line-height: 1.05; margin-bottom: 16px;
}
.product-price-block { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.product-price { font-family: 'Barlow Condensed', sans-serif; font-size: 42px; font-weight: 800; color: var(--red); }
.product-price small { font-size: 20px; vertical-align: super; }
.product-iva { font-size: 12px; color: var(--muted-2); }

.spec-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.spec-chip {
  padding: 8px 14px; border-radius: 999px; font-size: 12px;
  color: var(--muted); display: flex; gap: 6px; align-items: center;
}
.spec-chip b { color: var(--ink); font-weight: 700; }

.product-desc { font-size: 15px; color: var(--muted); line-height: 1.75; margin-bottom: 26px; white-space: pre-line; }

/* contact card */
.contact-card { padding: 26px 24px; }
.contact-agente { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.contact-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.06); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 18px;
  flex-shrink: 0;
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-name-label { font-size: 11px; color: var(--muted-2); letter-spacing: 1px; text-transform: uppercase; }
.contact-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 18px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 10px; border: none;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-whatsapp { background: #25D366; color: #05170a; }
.btn-call { background: var(--glass-bg-strong); color: var(--ink); border: 1px solid var(--glass-border); }
.btn-email { background: transparent; color: var(--muted); border: 1px solid var(--hairline); }

@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 26px; }
}
@media (min-width: 861px) {
  .gallery-track, .gallery-dots { display: none; }
  .gallery-main-wrap { display: block; }
}
@media (max-width: 860px) {
  .gallery-main { display: none; }
}

/* ── RESPONSIVE generali ── */
@media (max-width: 760px) {
  .cards-grid { grid-template-columns: 1fr; gap: 12px; }
  .cards-section { margin-top: 15px; }
  .pcard { transform: none !important; }
  .page-head { padding: 28px 5vw 18px; }
  .filter-bar-wrap { top: 56px; }
}

/* ============================================================
   BACKEND (login, dashboard, form)
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-box { width: 100%; max-width: 380px; padding: 36px 30px; }
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-tag {
  text-align: center; font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 28px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--hairline);
  color: var(--ink); font-size: 15px; font-family: 'Lato', sans-serif;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(229,36,27,0.5); outline: none;
}
.field-hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.btn-primary {
  width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none;
  background: var(--red); color: #fff; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; font-size: 14px; transition: opacity .15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase;
}
.btn-danger { background: rgba(229,36,27,0.15); border: 1px solid rgba(229,36,27,0.4); color: var(--red); }
.error-msg {
  background: rgba(229,36,27,0.12); border: 1px solid rgba(229,36,27,0.35);
  color: #ff8b83; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 18px;
}
.success-msg {
  background: rgba(58,170,72,0.12); border: 1px solid rgba(58,170,72,0.35);
  color: #7fd98a; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 18px;
}

/* dashboard layout */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 24px 5vw 16px; gap: 16px; flex-wrap: wrap;
}
.dash-title { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 800; text-transform: uppercase; }
.dash-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-nav a {
  padding: 9px 16px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--glass-border); background: var(--glass-bg);
}
.dash-nav a.active { color: var(--ink); border-color: rgba(229,36,27,0.5); background: rgba(229,36,27,0.14); }
.dash-content { max-width: 1200px; margin: 0 auto; padding: 0 5vw 80px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.data-table th {
  text-align: left; padding: 12px 16px; font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted-2); border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
.thumb-mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #161616; }
.badge-stato {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; display: inline-block;
}
.badge-stato.attivo { background: rgba(58,170,72,0.15); color: #7fd98a; }
.badge-stato.venduto { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-stato.bozza { background: rgba(255,180,0,0.12); color: #e0b64a; }
.row-actions { display: flex; gap: 8px; }
.row-actions a { font-size: 11px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--hairline); color: var(--muted); }
.row-actions a:hover { color: var(--ink); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-card { padding: 22px; margin-bottom: 20px; }
.settings-card h3 {
  font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 800;
  text-transform: uppercase; margin-bottom: 16px; letter-spacing: 0.5px;
}
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--hairline); gap: 10px;
}
.list-item:last-child { border-bottom: none; }
.list-item-name { font-size: 14px; }
.list-item-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); color: var(--muted); background: transparent;
}
.icon-btn:hover { color: var(--ink); }

.photo-upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.photo-slot {
  aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px dashed var(--glass-border);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background: rgba(255,255,255,0.02); cursor: pointer;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot .plus { font-size: 26px; color: var(--muted-2); }
.photo-slot .remove-photo {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; z-index: 2;
}

.top-bar-mobile-menu-btn { display: none; }
