/* =============================================
   EuroCustomAutos — Shop page
   ============================================= */

/* --- Filter bar --- */
.shop-toolbar {
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}

.shop-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  max-width: var(--container);
  margin: 0 auto;
  height: 56px;
}

.filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px;
  height: 56px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dust);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -1px;
}
.filter-tab:hover { color: var(--asphalt); }
.filter-tab.active {
  color: var(--asphalt);
  border-bottom-color: var(--volt);
}

.filter-tab-count {
  font-size: 11px;
  background: var(--border);
  color: var(--dust);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.filter-tab.active .filter-tab-count {
  background: var(--asphalt);
  color: var(--concrete);
}

.shop-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.shop-sort label { font-size: 12px; color: var(--dust); white-space: nowrap; }
.shop-sort select {
  font-size: 13px;
  font-weight: 500;
  color: var(--asphalt);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237A7670' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
  transition: border-color var(--transition);
}
.shop-sort select:focus { border-color: var(--asphalt); }

/* --- Shop layout --- */
.shop-main {
  padding: 48px 0 80px;
  min-height: 60vh;
}

.shop-result-count {
  font-size: 13px;
  color: var(--dust);
  margin-bottom: 28px;
}
.shop-result-count strong { color: var(--asphalt); }

/* --- Product grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-card {
  background: var(--offwhite);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.product-card:hover { background: var(--concrete); }

.product-image {
  aspect-ratio: 4/3;
  background: var(--concrete);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--dust);
  opacity: 0.35;
}
.product-image-placeholder svg { width: 40px; height: 40px; }
.product-image-placeholder span { font-size: 11px; letter-spacing: 0.06em; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

/* Multi-image cycling dots on product card */
.product-image-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.product-img-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.3s ease, transform 0.3s ease;
}
.product-img-dot.active {
  background: rgba(255,255,255,0.95);
  transform: scale(1.3);
}

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

.product-category {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 6px;
}

.product-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--asphalt);
  line-height: 1.1;
  margin-bottom: 4px;
}

.product-subtitle {
  font-size: 13px;
  color: var(--dust);
  margin-bottom: 16px;
}

.product-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.product-price { display: flex; flex-direction: column; gap: 2px; }
.product-price-note { font-size: 10px; color: var(--dust); text-transform: lowercase; }
.product-price-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--asphalt);
  line-height: 1;
}
.product-price-amount .currency { font-size: 14px; vertical-align: top; margin-top: 3px; display: inline-block; }

.product-add {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--asphalt);
  border-bottom: 2px solid var(--volt);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: gap var(--transition);
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.product-card:hover .product-add { gap: 10px; }

/* No results */
.shop-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--dust);
}
.shop-empty h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--asphalt);
  margin-bottom: 8px;
}
.shop-empty p { font-size: 15px; margin-bottom: 24px; }

/* --- Product detail modal --- */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.product-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.product-modal {
  background: var(--offwhite);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform var(--transition);
}
.product-modal-overlay.open .product-modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--dust);
  cursor: pointer;
  background: none;
  transition: var(--transition);
}
.modal-close:hover { border-color: var(--asphalt); color: var(--asphalt); }

.modal-body { padding: 28px; }
.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.modal-image {
  aspect-ratio: 1;
  background: var(--concrete);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.modal-image-placeholder { opacity: 0.25; }
.modal-image-placeholder svg { width: 56px; height: 56px; }

/* Modal image carousel */
.modal-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(26,26,26,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background var(--transition);
}
.modal-carousel-arrow:hover { background: rgba(26,26,26,0.9); }
.modal-carousel-prev { left: 10px; }
.modal-carousel-next { right: 10px; }

/* Finish toggle (e.g. Clear / Red) overlaid on modal media */
.modal-finish-toggle {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  background: rgba(26,26,26,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  overflow: hidden;
  z-index: 3;
}
.modal-finish-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  padding: 6px 16px;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.modal-finish-btn.active {
  background: var(--volt);
  color: var(--asphalt);
}

.modal-img-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.modal-img-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background 0.3s, transform 0.3s;
}
.modal-img-dot.active {
  background: white;
  transform: scale(1.3);
}

.modal-info {}
.modal-info .product-category { margin-bottom: 8px; }
.modal-info h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--asphalt);
  line-height: 1.05;
  margin-bottom: 4px;
}
.modal-info .product-subtitle {
  font-size: 14px;
  color: var(--dust);
  margin-bottom: 16px;
}
.modal-info p {
  font-size: 14px;
  color: var(--dust);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-specs { margin-bottom: 20px; }
.modal-specs h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 10px;
}
.modal-specs ul { display: flex; flex-direction: column; gap: 6px; }
.modal-specs li {
  font-size: 14px;
  color: var(--asphalt);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-specs li::before {
  content: '';
  width: 16px; height: 1px;
  background: var(--asphalt);
  flex-shrink: 0;
  opacity: 0.3;
}

.modal-finishes { margin-bottom: 24px; }
.modal-finishes h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 10px;
}
.finish-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.finish-tag {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--dust);
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.modal-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--asphalt);
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}
.modal-price-note { font-size: 12px; font-family: var(--font-body); font-weight: 400; color: var(--dust); }

/* --- Cart drawer --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.5);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--offwhite);
  border-left: 1px solid var(--border-strong);
  z-index: 3001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-drawer-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--asphalt);
}
.cart-count-label { font-size: 13px; color: var(--dust); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--dust);
  text-align: center;
  padding: 40px;
}
.cart-empty svg { opacity: 0.2; }
.cart-empty p { font-size: 15px; }

.cart-item {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.cart-item-image {
  width: 64px; height: 64px;
  background: var(--concrete);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-image svg { opacity: 0.2; }

.cart-item-details { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--asphalt);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-sub { font-size: 12px; color: var(--dust); margin-bottom: 10px; }
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--asphalt);
  background: none;
  transition: var(--transition);
}
.qty-btn:hover { border-color: var(--asphalt); }
.qty-display { font-size: 14px; font-weight: 500; color: var(--asphalt); min-width: 16px; text-align: center; }
.cart-item-remove {
  font-size: 12px;
  color: var(--dust);
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--transition);
  margin-left: auto;
}
.cart-item-remove:hover { color: var(--asphalt); }

.cart-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--asphalt);
  flex-shrink: 0;
  text-align: right;
}

.cart-drawer-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  flex-shrink: 0;
  background: var(--concrete);
}
.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--dust);
}
.cart-summary-row.total {
  font-size: 18px;
  font-weight: 500;
  color: var(--asphalt);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cart-summary-row.total span:last-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}
.cart-checkout-btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}
.cart-continue {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--dust);
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--transition);
  padding: 8px;
}
.cart-continue:hover { color: var(--asphalt); }

/* Past builds (wheels) */
.past-builds-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.past-build-item {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.past-build-item:last-child { border-bottom: none; }
.past-build-name { font-weight: 500; color: var(--asphalt); }
.past-build-spec { color: var(--dust); }
.past-build-price { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--asphalt); white-space: nowrap; }

/* Deposit note */
.modal-deposit-note {
  font-size: 12px;
  color: var(--dust);
  padding: 8px 12px;
  background: var(--concrete);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .products-grid { grid-template-columns: 1fr; }
  .shop-toolbar-inner { gap: 12px; }
  .shop-sort label { display: none; }
  .cart-drawer { width: 100vw; }
}
