/* Stile VEXION Shop – identico a index.html (tema chiaro, Space Grotesk, Inter) */
:root {
  --bg: #ececec;
  --panel: rgba(255,255,255,0.78);
  --panel-strong: #ffffff;
  --text: #101114;
  --muted: #5a6370;
  --line: rgba(16,17,20,0.08);
  --green: #5ecb16;
  --yellow: #ffd400;
  --shadow: 0 18px 40px rgba(0,0,0,0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(94,203,22,0.08) 0%, rgba(94,203,22,0) 28%),
    linear-gradient(180deg, #f2f3f4 0%, #e7e8ea 100%);
}

img { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar { padding: 20px 0 0; }

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand a { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 12px; }

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--line);
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
}

.nav a:hover { background: rgba(16,17,20,0.05); }

.hero { padding: 36px 0 26px; }

.hero h1 {
  margin: 18px 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -1px;
}

.hero p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.cta-row, .actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 160px;
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  cursor: pointer;
  font: inherit;
}

button.btn { font-family: "Space Grotesk", sans-serif; }

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0,0,0,0.08);
}

.btn-primary {
  background: var(--yellow);
  color: #121212;
  border-color: var(--yellow);
}

.btn-secondary {
  background: var(--panel-strong);
  color: var(--text);
  border-color: rgba(16,17,20,0.10);
}

.btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.section {
  padding: 24px 0;
}

.section-head { margin-bottom: 20px; }

.section h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(22px, 3.5vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.5px;
}

.section-sub, .tag {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* Card stile index (feature-card / variant) */
.hero-card, .feature-card, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  color: var(--text);
}

.card p, .card .body p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

.card .body { padding: 0; }

/* Grid prodotti (come variants) */
.grid, .features {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 18px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card { overflow: hidden; transition: transform .18s ease; }
.product-card:hover { transform: translateY(-2px); }

.thumb {
  background: #d9d9d9;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -22px -22px 16px -22px;
}

.thumb img, .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-price { color: var(--text); font-weight: 700; font-size: 15px; }
.text-decoration-line-through { text-decoration: line-through; color: var(--muted) !important; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,212,0,0.25);
  color: #7c6600;
}
.badge-esaurito-dettaglio {
  display: inline-block;
  background: #c92a2a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
}

/* Carrello: icon + preview (fixed in pagina, oppure dentro topbar) */
.cart-icon-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.cart-icon-container .btn { min-width: unset; padding: 12px 18px; }

/* Carrello integrato nella topbar (Default.aspx) */
.cart-in-topbar { position: relative; display: flex; align-items: center; z-index: 100; }
.cart-in-topbar .btn-cart {
  min-width: unset;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.cart-in-topbar .badge {
  background: #c92a2a;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
}
.cart-in-topbar .cart-preview {
  top: 100%;
  right: 0;
  margin-top: 8px;
  position: absolute;
}

.cart-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
}
.cart-preview-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.cart-preview-close:hover { color: var(--text); }
.cart-preview-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(201,42,42,0.15);
  color: #c92a2a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}
.cart-preview-remove:hover { background: rgba(201,42,42,0.3); }
.cart-preview-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 16px 0; margin: 0; }

.cart-preview {
  position: fixed;
  top: 75px;
  right: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 300px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: var(--shadow);
}

.cart-preview-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  gap: 0;
}

.cart-preview-item:last-child { border-bottom: none; }
.cart-preview-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 12px;
}

.cart-preview-item-info { flex: 1; }
.cart-preview-item-name { font-weight: 600; margin-bottom: 4px; color: var(--text); }
.cart-preview-item-quantity { color: var(--muted); font-size: 13px; }
.cart-preview-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

/* Pagina carrello */
.cart-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.cart-item:last-child { border-bottom: none; }
.cart-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.cart-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.cart-summary h4 { font-family: "Space Grotesk", sans-serif; margin-bottom: 14px; color: var(--text); }
.cart-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.cart-empty h3 { font-family: "Space Grotesk", sans-serif; color: var(--text); }
.cart-empty i { font-size: 48px; color: var(--muted); margin-bottom: 16px; opacity: 0.8; }

.quantity-control {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 120px;
}

.quantity-control button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}

.quantity-control input {
  flex: 1;
  text-align: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 8px;
  font-size: 14px;
}

/* Form */
.form-control, input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 15px;
  font-family: "Inter", sans-serif;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(94,203,22,0.15);
}

.form-label, .form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.form-group { margin-bottom: 18px; }

/* Tabelle */
.vexion-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.vexion-table th, .vexion-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.vexion-table th {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vexion-table img { max-width: 80px; max-height: 80px; object-fit: cover; border-radius: 12px; }

/* Alert */
.alert {
  padding: 14px 18px;
  border-radius: 16px;
  margin: 12px 0;
  border: 1px solid;
}

.alert-danger { background: rgba(220,53,69,0.08); border-color: rgba(220,53,69,0.25); color: #c92a2a; }
.alert-info { background: rgba(94,203,22,0.08); border-color: rgba(94,203,22,0.25); color: var(--muted); }

/* Order success / thank you */
.order-success { text-align: center; padding: 40px 20px; }
.order-success i { font-size: 56px; color: var(--green); margin-bottom: 16px; }
.order-success h1 { font-family: "Space Grotesk", sans-serif; color: var(--text); }
.order-details { margin-top: 24px; }
.order-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.order-item:last-child { border-bottom: none; }

/* Debug */
.debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(16,17,20,0.92);
  color: #e7e8ea;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 12px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.debug-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.debug-title { font-weight: 700; color: var(--yellow); }
.debug-close { cursor: pointer; }
.debug-content { white-space: pre-wrap; }
.log-entry { margin-bottom: 4px; padding: 2px 0; border-left: 3px solid var(--green); padding-left: 8px; }
.log-error { border-left-color: #e74c3c; }
.log-warning { border-left-color: var(--yellow); }

/* Modal immagine */
.vexion-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; }
.vexion-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  z-index: 9999;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow);
}

.vexion-modal img { max-width: 100%; max-height: 85vh; display: block; border-radius: 16px; }
.vexion-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.image-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  cursor: pointer;
  border: 1px solid var(--line);
}

.image-grid img:hover { border-color: var(--green); }
.image-container { position: relative; }
.image-container .zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0,0,0,0.5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.image-container:hover .zoom-icon { opacity: 1; }
.img-thumbnail { border: 1px solid var(--line); border-radius: 16px; }
.product-image-placeholder-dettaglio {
  min-height: 200px;
  background: #e8e9eb;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.product-image-placeholder-dettaglio i { font-size: 48px; opacity: 0.5; }
.home-icon-fixed { position: fixed; top: 20px; left: 20px; z-index: 9999; }
.product-description { white-space: pre-line; color: var(--muted); line-height: 1.7; }
.product-name { font-family: "Space Grotesk", sans-serif; color: var(--text); margin-bottom: 12px; }
.ms-2 { margin-left: 10px; }

/* Admin: drag-drop, products grid */
.drag-drop-area {
  border: 2px dashed rgba(16,17,20,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  background: var(--panel);
  color: var(--muted);
}

.drag-drop-area.dragover { border-color: var(--green); background: rgba(94,203,22,0.06); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.product-image-placeholder {
  width: 100%;
  height: 200px;
  background: #e7e8ea;
  border-radius: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 40px;
}

.btnEdit { background: var(--green) !important; color: #fff !important; border-color: var(--green) !important; }
.btnDelete { background: #c92a2a !important; color: #fff !important; border-color: #c92a2a !important; }

/* Utility */
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.d-none { display: none !important; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.spinner-border {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--line);
  border-right-color: var(--green);
  border-radius: 50%;
  animation: vexion-spin .6s linear infinite;
  vertical-align: -0.2em;
}

@keyframes vexion-spin { to { transform: rotate(360deg); } }
.spinner-border-sm { width: 0.95rem; height: 0.95rem; }

/* Footer come index */
.footer {
  padding: 30px 0 50px;
  color: #68707c;
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* Row/col per layout senza Bootstrap */
.v-row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.v-col { padding: 0 10px; }
.v-col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.v-col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.v-col-6 { flex: 0 0 50%; max-width: 50%; }
.v-col-8 { flex: 0 0 66.666%; max-width: 66.666%; }

@media (max-width: 720px) {
  .topbar-inner { border-radius: 24px; flex-direction: column; align-items: flex-start; }
  .v-col-2, .v-col-4, .v-col-6, .v-col-8 { flex: 0 0 100%; max-width: 100%; }
  .cart-item img { width: 80px; height: 80px; }
}
