/* =============================================
   PRODUCTS PAGE – Premium Marble Showcase
   ============================================= */

/* Hero Banner */
.products-hero {
  position: relative;
  padding: clamp(3.5rem, 7vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
  background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0d2240 100%);
  color: #fff;
}

.products-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(9, 212, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(28, 78, 128, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.products-hero__bg::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 80px,
    rgba(255, 255, 255, 0.012) 80px,
    rgba(255, 255, 255, 0.012) 81px
  );
  animation: hero-pattern-drift 30s linear infinite;
}

@keyframes hero-pattern-drift {
  from { transform: translateX(0); }
  to { transform: translateX(113px); }
}

.products-hero__content {
  position: relative;
  z-index: 2;
  max-width: 100%;
}

.products-hero__content .eyebrow {
  color: #09d4ff;
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  margin-bottom: 0.6rem;
}

.products-hero__content h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

/* Products Showcase Section */
.products-showcase {
  background: linear-gradient(180deg, #f0f4f8 0%, #ffffff 40%);
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

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

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* Marble Card */
.marble-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 32px -12px rgba(10, 22, 40, 0.1);
  border: 1px solid rgba(28, 78, 128, 0.06);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0;
  transform: translateY(40px);
  animation: marble-card-enter 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes marble-card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.marble-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 24px 64px -16px rgba(10, 22, 40, 0.2);
}

/* Visual Container */
.marble-card__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0f2f5;
}

.marble-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
              filter 0.6s ease;
}

.marble-card:hover .marble-card__img {
  transform: scale(1.12);
  filter: brightness(1.05) saturate(1.1);
}

/* Shine effect on hover */
.marble-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 70%
  );
  transform: translateX(-120%) translateY(-120%);
  transition: none;
  pointer-events: none;
}

.marble-card:hover .marble-card__shine {
  transform: translateX(120%) translateY(120%);
  transition: transform 0.85s ease;
}

/* Info Section */
.marble-card__info {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.marble-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-highlight, #0d1b2a);
  margin: 0;
  line-height: 1.25;
  flex: 1;
}

.marble-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(28, 78, 128, 0.2);
  background: rgba(28, 78, 128, 0.05);
  color: var(--color-primary, #1c4e80);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.marble-card__btn:hover {
  background: var(--color-primary, #1c4e80);
  color: #fff;
  border-color: var(--color-primary, #1c4e80);
  transform: scale(1.05);
}

.marble-card__btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Empty State */
.products-empty {
  text-align: center;
  color: var(--color-muted);
  font-size: 1.1rem;
  padding: 4rem 2rem;
  background: rgba(28, 78, 128, 0.04);
  border-radius: 20px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .marble-card {
    border-radius: 14px;
  }

  .marble-card__info {
    padding: 0.75rem 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .marble-card__name {
    font-size: 0.85rem;
  }

  .marble-card__btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.8rem;
  }

  .products-hero__content h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
}

/* COMPARE FEATURE */
.compare-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid rgba(13, 27, 42, 0.05);
  flex-wrap: wrap;
  gap: 1rem;
}

.compare-info__text {
  font-size: 0.9rem;
  color: var(--color-muted, #6b7a8d);
  font-weight: 500;
}

.btn-compare {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: #e2e8f0;
  color: #94a3b8;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: not-allowed;
  transition: all 0.3s ease;
}

.btn-compare.is-active {
  background: #0d1b2a;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 27, 42, 0.15);
}

.btn-compare.is-active:hover {
  transform: translateY(-2px);
  background: #1c4e80;
}

.compare-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(13, 27, 42, 0.1);
  color: #0d1b2a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.compare-toggle:hover {
  background: #ffffff;
  transform: scale(1.05);
}

.compare-toggle.is-selected {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.compare-modal[hidden] {
  display: none;
}

.compare-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.85);
  backdrop-filter: blur(8px);
}

.compare-modal__content {
  position: relative;
  background: #ffffff;
  width: 95%;
  max-width: 1400px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modal-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from {opacity: 0; transform: translateY(20px) scale(0.98);}
  to {opacity: 1; transform: translateY(0) scale(1);}
}

.compare-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.compare-modal__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d1b2a;
  margin: 0;
}

.compare-modal__close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(13, 27, 42, 0.14);
  background: #f1f5fb;
  color: #0d1b2a;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.compare-modal__close:hover {
  color: #ffffff;
  background: #0d1b2a;
  border-color: #0d1b2a;
}

.compare-modal__close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.compare-modal__body {
  padding: 2rem;
  display: block;
  overflow-y: auto;
  overflow-x: auto;
}

.compare-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid rgba(13, 27, 42, 0.05);
  border-radius: 12px;
  padding: 0 0 1.5rem 0;
  text-align: center;
  overflow: hidden;
}

.compare-col__img-wrap {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.compare-col__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-col__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1b2a;
  margin: 0 0 1rem;
}

.compare-col__link {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #1c4e80;
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.compare-col__link:hover {
  background: #0d1b2a;
}

@media (max-width: 768px) {
  .compare-modal {
    padding: 0.5rem;
  }

  .compare-modal__content {
    width: 100%;
    max-width: none;
    max-height: calc(100svh - 1rem);
    border-radius: 14px;
  }

  .compare-modal__header {
    padding: 1rem 1.1rem;
  }

  .compare-modal__header h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    max-width: calc(100% - 48px);
    line-height: 1.2;
  }

  .compare-modal__body {
    padding: 0.75rem;
  }

  .compare-table-wrap {
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .compare-table {
    min-width: 620px;
  }

  .compare-table th,
  .compare-table td {
    padding: 0.75rem 0.7rem;
    font-size: 0.86rem;
  }

  .compare-table th:first-child,
  .compare-table td:first-child {
    width: 130px;
    min-width: 130px;
    padding: 0.75rem 0.7rem;
  }

  .compare-card {
    gap: 0.55rem;
  }

  .compare-card__img {
    width: 92px;
    height: 64px;
  }

  .compare-card__name {
    font-size: 0.9rem;
  }

  .compare-card__link {
    font-size: 0.72rem;
    padding: 0.35rem 0.55rem;
  }

  .compare-modal__close {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .compare-modal {
    padding: 0;
  }

  .compare-modal__content {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
  }

  .compare-modal__body {
    padding: 0.5rem;
  }

  .compare-table {
    min-width: 560px;
  }

  .compare-table th:first-child,
  .compare-table td:first-child {
    width: 115px;
    min-width: 115px;
  }

  .compare-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-compare {
    width: 100%;
    justify-content: center;
  }
}

