/* Styles spécifiques à la page produits */

/* Page Header */
.page-header {
  padding-top: 120px;
  padding-bottom: 20px;
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
}

.back-button-container {
  margin-bottom: 2rem;
}

.back-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background-color: var(--primary-green);
  color: white;
  border: 2px solid transparent;
  border-radius: 8px;
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  z-index: 1;
  margin: 0.5rem 0 1.5rem;
  width: auto;
  min-width: 180px;
  text-decoration: none;
  visibility: visible !important;
  opacity: 1 !important;
}

.back-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--primary-green-dark);
  transition: width 0.3s ease;
  z-index: -1;
  border-radius: 8px;
}

.back-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.back-button:hover::before {
  width: 100%;
}

.back-button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.back-button svg {
  transition: transform 0.3s ease;
}

.back-button:hover svg {
  transform: translateX(-3px);
}

.page-header-content {
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.page-subtitle {
  max-width: 4xl;
  margin: 0 auto;
  color: var(--gray-600);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Categories Section */
.categories-section {
  padding: 2rem 0 4rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.category-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.category-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-xl);
}

.category-image {
  height: 250px;
  padding: 1rem;
  background-color: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

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

.category-content {
  padding: 1.5rem;
}

.category-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.category-icon {
  margin-right: 0.75rem;
  color: var(--primary-green);
  flex-shrink: 0;
}

.category-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gray-900);
}

.category-description {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  word-break: break-word;
}

.category-count {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Products Section */
.products-section {
  padding: 2rem 0 4rem;
  background: var(--gray-50);
  display: block;
  width: 100%;
  margin-top: 20px;
}

.products-section.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.products-header {
  margin-bottom: 2rem;
}

.back-to-categories {
  margin-bottom: 1.5rem;
  display: block !important;
  width: 100%;
  visibility: visible !important;
  opacity: 1 !important;
  padding-top: 120px;
}

.products-header-content {
  text-align: center;
}

.products-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.products-subtitle {
  color: var(--gray-600);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Product Filters */
.product-filters {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-bar svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(45, 143, 79, 0.1);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.product-card {
  background: white;
  border-radius: 1rem;
  overflow: visible;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  border: 3px solid var(--primary-green);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  height: 250px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: 1.5rem;
}

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

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

.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  background: var(--primary-green-dark);
  transform: scale(1.1);
}

.product-content {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.product-description {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  position: relative;
}

.product-description.truncated {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description.expanded {
  display: block;
}

.description-toggle {
  color: var(--primary-green);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: inline-block;
  transition: color 0.3s ease;
}

.description-toggle:hover {
  color: var(--primary-green-dark);
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.feature-tag {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}



.product-specs {
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.spec-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.spec-label {
  color: var(--gray-500);
  font-weight: 500;
}

.spec-value {
  color: var(--gray-800);
  font-weight: 600;
}

.product-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-secondary {
  background: transparent;
  color: var(--primary-green);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-green);
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: var(--primary-green);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: 2px solid #25D366;
  font-size: 0.9rem;
}

.btn-whatsapp:hover {
  background: #128C7E;
  border-color: #128C7E;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .page-header {
    padding-top: 110px;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .page-subtitle {
    font-size: 1rem;
  }

  .products-title {
    font-size: 1.75rem;
  }

  .products-subtitle {
    font-size: 1rem;
  }
  
  .back-button {
    width: 100%;
    min-width: 0;
    margin: 0.5rem 0 1rem;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
  }
  
  .categories-grid,
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .search-bar {
    max-width: none;
  }
  
  .category-content,
  .product-content {
    padding: 1rem;
  }
  
  .product-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .btn-secondary,
  .btn-whatsapp {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding-top: 108px;
    padding-bottom: 20px;
  }
  
  .page-title {
    font-size: 1.55rem;
    line-height: 1.25;
  }
  
  .back-button {
    min-width: 0;
    font-size: 0.95rem;
  }

  .categories-section,
  .products-section {
    padding: 1.5rem 0 3rem;
  }

  .category-card,
  .product-card {
    border-radius: 0.85rem;
  }
  
  .category-image {
    height: 180px;
  }
  
  .product-image-container {
    height: 180px;
  }
}

/* Green Header for Product Cards */
.product-header-green {
  background: linear-gradient(135deg, #2d8f4f 0%, #52c273 100%);
  padding: 1rem;
  border-radius: 1rem 1rem 0 0;
  text-align: center;
}

.product-name-header {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Product Body - Mockup Layout */
.product-body-mockup {
  position: relative;
  padding: 1.5rem;
  padding-top: 1.5rem;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-price-section {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  z-index: 5;
}

.product-meta-badge {
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary-green-dark);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.product-meta-badge-secondary {
  background: rgba(17, 24, 39, 0.08);
  color: var(--gray-800);
  border-color: rgba(17, 24, 39, 0.12);
}

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

.product-image-button {
  width: 100%;
  max-width: 280px;
  height: 280px;
  position: relative;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: zoom-in;
}

.product-static-image {
  cursor: default;
}

.product-image-zoom-label {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(17, 24, 39, 0.75);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

/* Align junction boxes center, supports right */
.product-card[data-category="boites"] .product-image-section {
  justify-content: center;
}

.product-card[data-category="supports"] .product-image-section {
  justify-content: flex-end;
  padding-right: 2rem;
}

/* Price Badge - Only "à partir de" */
.product-price-badge {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  display: inline-block;
  width: fit-content;
}

.price-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  margin: 0;
}

/* Price Display - Large Black Text */
.product-price-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.price-currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Description at Bottom */
.product-description-bottom {
  padding: 1rem 1.5rem;
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.6;
  border-top: 1px solid var(--gray-200);
  text-align: left;
}

/* Fiche Technique Button */
.product-fiche-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.product-fiche-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.product-fiche-btn svg {
  stroke: white;
}

.product-actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  padding: 0 1.5rem 1rem;
}

.product-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--gray-800);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--gray-300);
  transition: all 0.3s ease;
}

.product-secondary-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary-green);
  color: var(--primary-green-dark);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.product-image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.product-image-modal.active {
  display: flex;
}

.product-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.product-image-modal-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 1100px);
  max-height: 90vh;
  padding: 1rem;
}

.product-image-modal-image {
  width: 100%;
  max-height: calc(90vh - 2rem);
  object-fit: contain;
  border-radius: 1rem;
  background: white;
}

.product-image-modal-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 2;
}

/* Image Container - Extra Large */
.product-image-section .product-carousel {
  width: 100%;
  max-width: 280px;
  height: 280px;
  position: relative;
  margin-top: 1rem;
}

.product-image-section .carousel-images {
  width: 100%;
  height: 100%;
  position: relative;
}

.product-image-section .product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-carousel .product-image {
  display: none;
}

.product-carousel .product-image.active {
  display: block;
}

/* Fix carousel button visibility - STRONG CONTRAST */
.product-image-section .carousel-btn {
  position: absolute;
  top: calc(50% - 20px);
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.product-image-section .carousel-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--primary-green);
  transform: scale(1.2);
}

.product-image-section .carousel-prev {
  left: -0.75rem;
}

.product-image-section .carousel-next {
  right: -0.75rem;
}

.product-image-section .carousel-btn svg {
  stroke: white;
  stroke-width: 3;
}

.product-image-section .carousel-indicators {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -25px;
  display: flex;
  gap: 0.5rem;
}

.product-image-section .indicator {
  background: var(--gray-300);
  border: 2px solid var(--primary-green);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

.product-image-section .indicator.active {
  background: var(--primary-green);
}

/* Responsive adjustments for mockup layout */
@media (max-width: 768px) {
  .product-name-header {
    font-size: 1.2rem;
  }
  
  .product-body-mockup {
    padding: 1rem;
    padding-top: 1rem;
    min-height: 280px;
  }
  
  .product-price-section {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
  }
  
  .product-card[data-category="supports"] .product-image-section {
    justify-content: center;
    padding-right: 0;
  }
  
  .product-image-button {
    max-width: 250px;
    height: 250px;
  }

  .product-image-section .carousel-prev {
    left: 0;
  }

  .product-image-section .carousel-next {
    right: 0;
  }
  
  .price-amount {
    font-size: 1.5rem;
  }
  
  .product-description-bottom {
    text-align: center;
  }

  .product-actions-row {
    grid-template-columns: 1fr;
  }

  .product-secondary-btn,
  .product-fiche-btn {
    min-height: 48px;
  }
}

@media (max-width: 360px) {
  .page-title,
  .products-title {
    font-size: 1.4rem;
  }

  .category-content,
  .product-content,
  .product-description-bottom,
  .product-actions-row {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .product-image-button {
    height: 220px;
  }

  .product-image-zoom-label {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
  }
}
