body {
  background-color: black;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Previene scroll orizzontale globalmente */
html {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Search Overlay Styles */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.search-overlay.active {
  display: flex;
}

.search-container {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.search-header h3 {
  color: white;
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: white;
}

#search-input,
#order-input {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
  word-wrap: break-word;
}

#search-input::placeholder,
#order-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.search-result-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.3s ease;
  overflow-x: hidden;
  word-wrap: break-word;
  box-sizing: border-box;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-item h4 {
  color: white;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.search-result-item p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-container {
    width: 95%;
    max-width: none;
    padding: 1.5rem;
    margin: 1rem auto;
    max-height: 85vh;
    border-radius: 12px;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .search-header {
    margin-bottom: 1rem;
  }

  .search-header h3 {
    font-size: 1.3rem;
  }

  #search-input,
  #order-input {
    padding: 0.8rem;
    font-size: 16px; /* Previene lo zoom su iOS */
  }
}

/* Media query per schermi molto piccoli */
@media (max-width: 480px) {
  .search-container {
    width: 98%;
    padding: 1rem;
    margin: 0.5rem auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .search-header h3 {
    font-size: 1.2rem;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .close-btn {
    font-size: 1.8rem;
  }
}

.back-to-home-container {
  margin-top: 10px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.back-to-home {
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1000;
}

.drop {
  width: 100%;
  height: 5%;
  margin-top: 2%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 999;
  color: white;
}

.filters-container {
  display: flex;
  justify-content: center;
  padding: 1rem 2rem;
  margin-bottom: 1rem;
}

.categories-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.categories-filter label {
  color: white;
  font-size: 0.9rem;
}

.categories-filter select {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
}

.categories-filter select option {
  background: #1a1a1a;
  color: white;
}


/* Stili per il form di contatto */
.form-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
}

.form-message.success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.3);
  color: #28a745;
}

.form-message.error {
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

/* Stili per lo shop */
.loading {
  text-align: center;
  padding: 3rem;
  color: #ffffff;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.product-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

/* Stili per il carosello */
.image-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.carousel-image.active {
  opacity: 1;
}

.carousel-image:first-child {
  opacity: 1;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.dot.active,
.dot:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

.new-badge,
.sold-out-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.new-badge {
  background: #28a745;
  color: white;
}

.sold-out-badge {
  background: #dc3545;
  color: white;
}

/* Stili per il pulsante preferiti */
.favorite-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 35px;
  height: 35px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.favorite-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.favorite-btn svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.favorite-btn.favorited svg {
  fill: #e74c3c;
}

.favorite-btn:not(.favorited) svg {
  fill: rgba(255, 255, 255, 0.7);
}

.favorite-btn:not(.favorited):hover svg {
  fill: rgba(255, 255, 255, 0.9);
}

.product-info {
  padding: 1.5rem;
  color: #ffffff;
}

.product-name {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.product-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.product-price {
  margin-bottom: 1rem;
}

.product-stock {
  margin-bottom: 1rem;
}

.product-stock small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.original-price {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.6);
  margin-right: 0.5rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #ffffff;
}

.product-sizes {
  margin-bottom: 1.5rem;
}

.product-sizes label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.sizes {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.size {
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 0.8rem;
  background: transparent;
  color: #ffffff;
}

.size.unavailable {
  opacity: 0.5;
  text-decoration: line-through;
}

.add-to-cart-btn {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #ffffff;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.error-message {
  text-align: center;
  padding: 3rem;
  color: #ffffff;
}

.error-message h3 {
  color: #dc3545;
  margin-bottom: 1rem;
}

.retry-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.5rem;
  }

  .product-info {
    padding: 1rem;
  }

  .carousel-dots {
    bottom: 8px;
    gap: 6px;
  }

  .dot {
    width: 6px;
    height: 6px;
  }
}