/* ============================================
   GIANNI PACE GIOIELLI - Catalog Styles
   ============================================ */

/* Page Header */
.page-header {
  padding: 180px 0 80px;
  background: linear-gradient(180deg, var(--black) 0%, var(--black-soft) 100%);
  text-align: center;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--gold);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.breadcrumb a {
  color: var(--gray);
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb span {
  color: var(--gray-dark);
}

.breadcrumb span:last-child {
  color: var(--gold);
}

/* Page Title */
.page-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.page-subtitle {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gray-light);
  margin: 0;
}

/* Catalog Section */
.catalog-section {
  background: var(--black);
  padding-bottom: 100px;
}

/* Catalog Filters */
.catalog-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 60px;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 28px;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gray);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transition: left 0.3s ease;
  z-index: -1;
}

.filter-btn:hover {
  border-color: var(--gold) !important;
  background: var(--gold) !important;
  color: var(--black) !important;
}

.filter-btn:hover::before {
  left: 0;
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
}

.filter-btn.active::before {
  left: 0;
}

/* Products Grid - Catalog Version */
.products-grid.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  transition: opacity 0.3s ease;
}

/* Product Card - Enhanced for Catalog */
.products-grid.catalog .product-card {
  background: var(--black-soft);
  border: 1px solid transparent;
  transition: all 0.4s ease;
}

.products-grid.catalog .product-card:hover {
  border-color: var(--gold);
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(212, 175, 55, 0.15);
}

.products-grid.catalog .product-image {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

.products-grid.catalog .product-image img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 10% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  box-sizing: border-box !important;
  transition: transform 0.6s ease;
}

.products-grid.catalog .product-card:hover .product-image img {
  transform: scale(1.08);
}

/* Quick View Overlay */
.products-grid.catalog .product-image::after {
  content: 'Dettagli';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
}

.products-grid.catalog .product-card:hover .product-image::after {
  opacity: 1;
  transform: translateY(0);
}

/* Product Info - Catalog */
.products-grid.catalog .product-info {
  padding: 25px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.products-grid.catalog .product-category {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.products-grid.catalog .product-name {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.products-grid.catalog .product-link {
  font-size: 0.7rem;
  color: var(--gold);
}

.products-grid.catalog .product-link:hover {
  color: var(--gold-light);
}

/* No Products Message */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

.no-products p {
  color: var(--gray);
  font-size: 1.1rem;
}

/* Loading State */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 2px solid var(--black-lighter);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 25px;
  animation: spin 1s linear infinite;
}

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

.loading-spinner p {
  color: var(--gray);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

/* CTA Section */
.cta-section {
  background: var(--black-soft);
  padding: 100px 0;
}

.cta-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-content h2 {
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Product Count Badge (Optional) */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.6rem;
  font-weight: 600;
  border-radius: 50%;
  margin-left: 8px;
}

.filter-btn.active .filter-count {
  background: var(--black);
  color: var(--gold);
}

/* ============================================
   Responsive Styles for Catalog
   ============================================ */

@media (max-width: 992px) {
  .page-header {
    padding: 150px 0 60px;
  }

  .catalog-filters {
    gap: 10px;
    margin-bottom: 50px;
  }

  .filter-btn {
    padding: 12px 20px;
    font-size: 0.65rem;
  }

  .products-grid.catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 130px 0 50px;
  }

  .breadcrumb {
    font-size: 0.7rem;
    gap: 10px;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 576px) {
  .page-header {
    padding: 120px 0 40px;
  }

  .catalog-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 10px 16px;
    font-size: 0.6rem;
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .products-grid.catalog {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .cta-section {
    padding: 70px 0;
  }
}

/* ============================================
   Product Modal Additional Styles
   ============================================ */

/* Product Modal - Elegant Flip Effect */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.product-modal.active {
  opacity: 1;
  visibility: visible;
}

.product-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.product-modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  background: #111;
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  overflow: hidden;
  transform: perspective(1200px) rotateY(-20deg) scale(0.85);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.1);
}

.product-modal.active .product-modal-content {
  transform: perspective(1200px) rotateY(0deg) scale(1);
  opacity: 1;
}

.product-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 45px;
  height: 45px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold);
  font-size: 26px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
}

.product-modal-close:hover {
  background: var(--gold);
  color: #000;
  transform: rotate(90deg);
}

.product-modal-gallery {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  min-height: 350px;
}

.product-modal-main-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-main-image img {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  animation: modalImageFlip 0.7s ease 0.15s both;
}

@keyframes modalImageFlip {
  0% {
    opacity: 0;
    transform: rotateY(-30deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
}

.product-modal-info {
  flex: 1;
  padding: 45px 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  background: #111;
}

.product-modal-info .product-category {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  display: block;
  animation: fadeSlideUp 0.5s ease 0.25s both;
}

.product-modal-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 20px;
  line-height: 1.3;
  animation: fadeSlideUp 0.5s ease 0.35s both;
}

.product-modal-info .product-description {
  color: #999;
  line-height: 1.8;
  margin-bottom: 25px;
  font-size: 0.95rem;
  animation: fadeSlideUp 0.5s ease 0.45s both;
}

.product-modal-info .product-specs {
  margin-bottom: 25px;
  animation: fadeSlideUp 0.5s ease 0.55s both;
}

.product-modal-info .product-specs h4 {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.product-modal-info .product-specs dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 15px;
}

.product-modal-info .product-specs dt {
  color: #777;
  font-size: 0.85rem;
}

.product-modal-info .product-specs dd {
  color: #fff;
  font-weight: 500;
  text-align: right;
  font-size: 0.9rem;
}

.product-modal-info .btn-modal-close {
  margin-top: 25px;
  align-self: flex-start;
  animation: fadeSlideUp 0.5s ease 0.65s both;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 14px 35px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-modal-info .btn-modal-close:hover {
  background: var(--gold);
  color: #000;
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Responsive */
@media (max-width: 900px) {
  .product-modal-content {
    flex-direction: column;
    max-height: 95vh;
    transform: perspective(1200px) rotateX(-15deg) scale(0.85);
  }
  
  .product-modal.active .product-modal-content {
    transform: perspective(1200px) rotateX(0deg) scale(1);
  }
  
  .product-modal-gallery {
    min-height: 250px;
    max-height: 40vh;
    padding: 20px;
  }
  
  .product-modal-main-image img {
    max-height: 35vh;
  }
  
  .product-modal-info {
    padding: 25px 20px;
  }
  
  .product-modal-info h2 {
    font-size: 1.4rem;
  }
  
  .product-modal-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
}

/* Animation for filter change */
.products-grid.catalog.filtering {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================
   Search Bar
   ============================================ */
.catalog-search {
  position: relative;
  max-width: 500px;
  margin: 0 auto 40px;
}

.search-input {
  width: 100%;
  padding: 16px 50px 16px 25px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.search-input::placeholder {
  color: #666;
}

.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--gold);
  pointer-events: none;
}

/* ============================================
   Modal Buttons & WhatsApp
   ============================================ */
.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

.btn-whatsapp-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  padding: 14px 25px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-whatsapp-product:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-product svg {
  flex-shrink: 0;
}

/* ============================================
   Zoom Overlay
   ============================================ */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.zoom-overlay.active {
  opacity: 1;
  visibility: visible;
}

.zoom-overlay img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.zoom-close:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* Zoom hint */
.product-modal-main-image {
  position: relative;
  cursor: zoom-in;
}

.zoom-hint {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 15px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-modal-main-image:hover .zoom-hint {
  opacity: 1;
}

.zoom-icon {
  font-style: normal;
  margin-right: 5px;
}

@media (max-width: 768px) {
  .modal-buttons {
    gap: 10px;
  }
  
  .btn-whatsapp-product {
    padding: 12px 20px;
    font-size: 0.75rem;
  }
  
  .zoom-hint {
    display: none;
  }
  
  .zoom-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Placeholder per categorie senza immagine */
.category-placeholder {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--black-soft) 0%, var(--black) 100%);
  color: var(--gold);
  padding: 20px;
  text-align: center;
}

.category-placeholder svg {
  opacity: 0.7;
}

.category-placeholder span {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white-soft);
  opacity: 0.7;
}
