* { box-sizing: border-box; }

:root {
  --text-primary: #0f0f0f;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #efefef;
  --border-color: #e0e0e0;
  --accent: #e80c00;
  --accent-hover: #c40a00;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=SF+Mono:wght@400;500&display=swap');

body.wgc-no-scroll {
  overflow: hidden;
}

/* ===== MODAL ===== */
.wgc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

.wgc-modal.is-open {
  display: flex;
}

.wgc-modal__overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.wgc-modal__panel {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-width: none;
  max-height: none;
  background: var(--bg-primary);
  border-radius: 0;
  overflow: hidden;
  z-index: 1;
}

@supports not (height: 100dvh) {
  .wgc-modal__panel {
    height: 100vh;
    min-height: 100vh;
  }
}

.wgc-modal__content {
  height: 100%;
}

/* ===== BUTTON ===== */
.wgc-open-modal {
    margin-top: 10px;
  width: 100%;
  padding: 6px;
  background: #0f0f0f;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.wgc-open-modal:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.wgc-open-modal img {
  width: 16px;
  height: auto;
}

/* ===== CONFIGURATOR ===== */
.wgc-configurator {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== TOPBAR ===== */
.wgc-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(180deg, rgba(250,250,250,1) 0%, rgba(255,255,255,0.95) 100%);
  border-bottom: 1px solid rgba(224,224,224,0.5);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
}

.wgc-topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232,12,0,0.1) 50%, transparent 100%);
}

.wgc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.wgc-brand::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff3333 100%);
  border-radius: 12px;
  background-image: url('https://www.poliottica.com/wp-content/uploads/2026/03/remix-new-black.168a1aed.svg');
  background-size: 60%;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: lighten;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(232,12,0,0.15);
}

.wgc-topbar:hover .wgc-brand::before {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(232,12,0,0.25);
}

.wgc-product-name {
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wgc-x {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.06) 100%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.wgc-x::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(232,12,0,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.wgc-x::before {
  content: '✕';
  font-size: 20px;
  color: var(--text-primary);
  font-weight: 300;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.wgc-x:hover {
  background: linear-gradient(135deg, rgba(232,12,0,0.1) 0%, rgba(232,12,0,0.15) 100%);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(232,12,0,0.15);
}

.wgc-x:active {
  transform: scale(0.95);
}

/* ===== MAIN LAYOUT ===== */
.wgc-main {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 0;
  flex: 1;
  min-height: 0;
}

/* ===== LEFT PREVIEW ===== */
.wgc-left {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

.wgc-preview {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 850px;
  max-height: 950px;
  aspect-ratio: 1 / 1;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wgc-frame-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 2;
  pointer-events: none;
}

.wgc-lens-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  mix-blend-mode: multiply;
}

.wgc-logo-layer,
.wgc-logo-layer-right {
  position: absolute;
  height: auto;
  z-index: 7;
  pointer-events: none;
  display: none;
  max-width: 100%;
}

/* ===== RIGHT SIDEBAR ===== */
.wgc-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
}

.wgc-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  background: var(--bg-primary);
  padding: 0 24px;
}

.wgc-tab-btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border-bottom: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  margin-bottom: 0;
}

.wgc-tab-btn:hover {
  color: var(--text-primary);
}

.wgc-tab-btn.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ===== STEPS CONTAINER ===== */
.wgc-steps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 20px;
}

.wgc-steps::-webkit-scrollbar {
  width: 6px;
}

.wgc-steps::-webkit-scrollbar-track {
  background: transparent;
}

.wgc-steps::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}

.wgc-steps::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

.wgc-steps-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  transition: none;
}

.wgc-step {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: auto;
  border-bottom: 1px solid var(--border-color);
  padding: 0;
}

.wgc-step:last-child {
  border-bottom: none;
}

.wgc-step__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0px;
  padding: 24px 24px 0;
  border-bottom: none;
  justify-content: space-between;
  flex-wrap: wrap;
}

.wgc-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
  background: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

.wgc-step.is-active .wgc-step__num {
  background: var(--accent);
}

.wgc-step__title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  flex-grow: 1;
}

.wgc-step__body {
  padding: 16px 24px 16px;
  margin-bottom: 0;
}

.wgc-color-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-family: 'SF Mono', monospace;
}

.wgc-color-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.wgc-color-price {
  font-weight: 600;
  font-size: 11px;
  color: var(--accent);
  margin-left: 6px;
  font-family: 'SF Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===== SWATCHES ===== */
.wgc-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 0;
}

.wgc-swatch {
  aspect-ratio: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.wgc-swatch:hover {
  transform: scale(1.12);
  border-color: var(--text-secondary);
}

.wgc-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 12, 0, 0.2);
}

/* ===== LENS TABS ===== */
.wgc-lens-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  border-bottom: none !important;
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: auto;
  align-items: center;
}

.wgc-lens-tab {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.wgc-lens-tab:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.wgc-lens-tab.is-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== LENS GRID ===== */
.wgc-group {
  display: none;
  margin-bottom: 0;
}

.wgc-group.is-active {
  display: block;
}

.wgc-group__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.wgc-lens-card {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wgc-lens-card:hover {
  transform: scale(1.15);
}

.wgc-lens-card .wgc-swatch {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  box-shadow: none;
  margin: 0;
  box-sizing: border-box !important;
}

.wgc-lens-card .wgc-swatch:hover {
  transform: scale(1.12);
  border-color: var(--text-secondary);
}

.wgc-lens-card.is-active .wgc-swatch {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 12, 0, 0.2);
}

/* ===== CASES ===== */
.wgc-cases-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.wgc-case-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.wgc-case-card:hover {
  transform: translateY(-2px);
}

.wgc-case-card.is-active {
  transform: scale(0.98);
}

.wgc-case-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

.wgc-case-card:hover .wgc-case-img {
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

.wgc-case-card.is-active .wgc-case-img {
  border-color: var(--accent);
  background: #f6f6f6;
  box-shadow: 0 0 0 2px rgba(232, 12, 0, 0.15);
}

.wgc-case-img img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.wgc-case-name {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  margin-bottom: 0;
  line-height: 1.3;
}

.wgc-case-price {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0;
  font-family: 'SF Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===== FOOTER ===== */
.wgc-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-primary);
  flex-shrink: 0;
  margin-top: auto;
}

.wgc-total {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wgc-total__label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
}

.wgc-total__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'SF Mono', monospace;
}

.wgc-cta {
  flex: 1;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.wgc-cta:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.wgc-cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wgc-step__info {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .wgc-main {
    grid-template-columns: 1fr;
  }

  .wgc-left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    min-height: 350px;
    max-height: 40vh;
  }

  .wgc-preview {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 768px) {
  .wgc-topbar {
    padding: 0 20px;
    height: 64px;
  }

  .wgc-modal__panel {
    height: 100dvh;
    min-height: 100dvh;
  }

  .wgc-brand::before {
    width: 36px;
    height: 36px;
  }

  .wgc-product-name {
    font-size: 13px;
    max-width: 100%;
  }

  .wgc-x {
    width: 40px;
    height: 40px;
  }

  .wgc-x::before {
    font-size: 18px;
  }

  .wgc-left {
    padding: 20px;
    min-height: 300px;
    max-height: 38vh;
  }

  .wgc-right {
    max-height: 62vh;
  }

  .wgc-step {
    min-height: 25vh;
  }

  .wgc-step__head {
    padding: 16px 16px 0;
    flex-wrap: nowrap;
  }

  .wgc-step__body {
    padding: 12px 16px 16px;
  }

  .wgc-swatches {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .wgc-group__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .wgc-cases-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .wgc-tab-nav {
    padding: 0 16px;
  }

  .wgc-tab-btn {
    font-size: 11px;
    padding: 12px 0;
  }

  .wgc-lens-tabs {
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .wgc-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .wgc-total__value {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .wgc-topbar {
    padding: 0 14px;
    height: 52px;
  }

  .wgc-brand::before {
    width: 24px;
    height: 24px;
  }

  .wgc-product-name {
    font-size: 11px;
    margin-left: 0;
    max-width: 100%;
  }

  .wgc-x {
    width: 32px;
    height: 32px;
  }

  .wgc-x::before {
    font-size: 14px;
  }

  .wgc-left {
    padding: 14px;
    min-height: 260px;
    max-height: 35vh;
  }

  .wgc-preview {
    border-radius: 8px;
  }

  .wgc-tab-nav {
    padding: 0 12px;
  }

  .wgc-tab-btn {
    font-size: 10px;
    padding: 10px 0;
  }

  .wgc-step {
    min-height: 20vh;
  }

  .wgc-step__head {
    padding: 12px 12px 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .wgc-step__title {
    flex-grow: 1;
  }

  .wgc-step__body {
    padding: 10px 12px 12px;
  }

  .wgc-swatches {
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
  }

  .wgc-group__grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
  }

  .wgc-lens-card {
    border-radius: 0;
  }

  .wgc-cases-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .wgc-case-card {
    flex-direction: column;
    text-align: center;
    padding: 0;
    gap: 12px;
  }

  .wgc-case-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 10px;
    border: 2px solid var(--border-color);
  }

  .wgc-lens-tabs {
    margin-left: 0;
    width: 100%;
    margin-bottom: 8px;
  }

  .wgc-footer {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .wgc-step__body {
    padding: 10px 12px 12px;
  }

  .wgc-total {
    order: 0;
    flex-basis: auto;
  }

  .wgc-cta {
    order: 0;
    flex-basis: auto;
    padding: 10px 12px;
    font-size: 11px;
  }
}

.note_personalizza {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}