/* Luxury Dark Theme per Siwa Tex-Mex */
:root {
  --bg-main: #0a0a0c;
  --bg-card: #151518;
  --bg-card-hover: #1e1e24;
  --text-main: #f0f0f0;
  --text-muted: #888;
  --accent-gold: #d4af37;
  --accent-gold-dark: #aa8c2c;
  --accent-silver: #c0c0c0;
  --border-color: #333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.05), transparent 50%),
                    radial-gradient(circle at 85% 30%, rgba(232, 107, 139, 0.05), transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
header {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 10, 12, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--accent-gold);
  letter-spacing: 2px;
  font-weight: 700;
}

.nav-links button {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 30px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: color 0.3s;
}

.nav-links button:hover, .nav-links button.active {
  color: var(--accent-gold);
}

/* Shop Grid */
.shop-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.shop-header {
  text-align: center;
  margin-bottom: 40px;
}

.shop-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  margin-bottom: 10px;
  font-weight: 400;
}

.shop-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-color: var(--accent-gold);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.product-color {
  font-size: 13px;
  color: var(--accent-gold);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-btn {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 10px 15px;
  border-radius: 30px;
  text-align: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.product-card:hover .product-btn {
  background: var(--accent-gold);
  color: #000;
}

/* Configuratore Layout */
.configurator-view-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.configurator-view {
  display: flex;
  flex: 1;
  height: calc(100vh - 71px);
  position: relative;
}

@media (max-width: 992px) {
  .configurator-view-wrapper {
    height: auto;
    overflow: visible;
  }
  .configurator-view {
    flex-direction: column;
    overflow-y: visible;
    overflow-x: hidden;
  }
  .preview-container {
    flex-direction: column !important;
    overflow: visible !important;
  }
  .mobile-hidden {
    display: none !important;
  }
}

.preview-container {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
}

.configurator-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: relative;
}

/* AI Magic Bar */
.ai-magic-bar {
  background: linear-gradient(135deg, #1e1e24, #121215);
  border-radius: 12px;
  padding: 15px 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.ai-magic-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #d4af37, #e86b8b, #6bb9e8);
}

.ai-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
}

.ai-btn {
  background: linear-gradient(135deg, #d4af37, #b5952f);
  color: #111;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: transform 0.2s;
}
.ai-btn:hover { transform: scale(1.05); }

/* Anteprima Strumento */
.preview-container {
  flex: 1;
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .preview-container {
    flex-direction: column !important;
  }
}

.preview-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Overlays e posizionamenti */
.overlay {
  position: absolute;
  pointer-events: none; /* Lascia passare i click se serve, ma i bottoni li intercettano */
}
.grille-overlay {
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain;
}

/* Manual Controls Panel (Right sidebar) */
.accordion-display {
  flex: 0 0 65%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  align-self: flex-start;
  top: 0;
  height: 100%;
  border-right: 1px solid #333;
  padding: 20px;
  background: #000000;
  z-index: 10;
}

.manual-sidebar {
  flex: 1 1 35%;
  height: 100%;
  width: 350px;
  background: rgba(20, 20, 25, 0.85);
  backdrop-filter: blur(15px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding: 25px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 30px rgba(0,0,0,0.5);
  z-index: 50;
}

@media (max-width: 992px) {
  .accordion-display {
    flex: 0 0 auto;
    height: 45vh;
    border-right: none;
    border-bottom: 1px solid #333;
  }
  .manual-sidebar {
    height: auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: visible;
  }
}

.sidebar-title {
  font-size: 16px;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cart Summary */
.cart-summary {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.cart-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
  color: #ccc;
}
.cart-item strong { color: #fff; }
.btn-checkout {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-gold), #b5952f);
  color: #000;
  border: none;
  padding: 15px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 20px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}
.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Utility per i controlli interattivi (Slider piccoli) */
.slider-group {
  margin-bottom: 12px;
}
.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 4px;
}
.slider-group input[type=range] {
  width: 100%;
  appearance: none;
  background: #333;
  height: 4px;
  border-radius: 2px;
}
.slider-group input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 50%;
  cursor: pointer;
}

