/* ============================================
   MATY MATIX - OPTIMIZED HOME PAGE STYLES
   Mobile-First with Scroll Animations
   ============================================ */

/* Account for fixed navbar */
body {
  padding-top: 70px;
}

/* ============================================
   HERO SECTION - Mobile Responsive
   ============================================ */

.hero-section {
  width: 100%;
  height: 60vh;
  min-height: 300px;
  max-height: 600px;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
  text-align: center;
  z-index: 2;
  padding: 15px;
}

.hero-overlay h1 {
  color: white;
  font-size: 1.8rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 15px;
  animation: slideInDown 0.8s ease;
  line-height: 1.2;
}

.hero-overlay .btn {
  margin-top: 10px;
}

/* Carousel Controls */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 1.5rem;
  padding: 10px 12px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  border-radius: 4px;
  display: none;
  min-width: 44px;
  min-height: 44px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

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

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

.dot.active {
  background-color: white;
  width: 26px;
  border-radius: 5px;
}

/* ============================================
   SECTION TITLE - Mobile Optimized
   ============================================ */

.section-title {
  text-align: center;
  padding: 30px 15px;
  background-color: #f9f9f9;
  width: 100%;
}

.section-title h2 {
  color: #1a1a1a;
  font-size: 1.4rem;
  letter-spacing: 1px;
  margin: 0;
  animation: slideInDown 0.6s ease;
}

/* ============================================
   COLLECTIONS SECTION - Mobile First
   ============================================ */

.collections-section {
  padding: 20px 15px;
  background-color: #ffffff;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 1920px;
  margin: 0 auto;
}

.collection-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
  background-color: #f5f5f5;
}

.collection-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.collection-card:active {
  transform: scale(0.98);
}

.collection-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 12px 10px 8px;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
}

.collection-card.zoom-animate {
  opacity: 0;
  transform: scale(0.9);
}

.collection-card.zoom-animate.in-view {
  opacity: 1;
  transform: scale(1);
  transition: all 0.6s ease;
}

/* ============================================
   COLLECTION IMAGE MODAL (Mobile)
   ============================================ */

.collection-modal {
  display: none;
  position: fixed;
  z-index: 2500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s ease;
  padding: 15px;
  overflow-y: auto;
}

.collection-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-modal-content {
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s ease;
}

.collection-modal-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  max-height: 80vh;
}

.collection-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.collection-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   CAMPAIGN BANNER SECTION - Scroll Animations
   ============================================ */

.campaign-banner {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
}

.campaign-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  z-index: 1;
}

.campaign-banner.zoom-animate .campaign-image {
  opacity: 0;
  transform: scale(0.95);
}

.campaign-banner.zoom-animate.in-view .campaign-image {
  opacity: 1;
  transform: scale(1);
  transition: all 0.8s ease;
}

.campaign-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
  color: white;
  padding: 20px;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.campaign-content h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  line-height: 1.3;
  animation: slideInDown 0.6s ease 0.2s backwards;
}

.campaign-content p {
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: none;
  color: rgba(255, 255, 255, 0.9);
}

.campaign-content .btn {
  animation: slideUp 0.6s ease 0.4s backwards;
}

/* ============================================
   HOT SELLING SECTION - Mobile Optimized
   ============================================ */

.hot-selling-section {
  padding: 25px 15px;
  background-color: #ffffff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 1920px;
  margin: 0 auto 25px;
}

.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card:active {
  transform: scale(0.98);
}

.product-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background-color: #f5f5f5;
  overflow: hidden;
}

.product-info {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: #333;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.original-price {
  font-size: 0.75rem;
  color: #999;
  text-decoration: line-through;
}

.sale-price {
  font-size: 0.95rem;
  color: #E74C3C;
  font-weight: 700;
}

.product-discount {
  font-size: 0.7rem;
  background-color: #E74C3C;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: auto;
}

.product-card.zoom-animate {
  opacity: 0;
  transform: scale(0.9);
}

.product-card.zoom-animate.in-view {
  opacity: 1;
  transform: scale(1);
  transition: all 0.6s ease;
}

.section-center {
  text-align: center;
  margin-top: 15px;
}

/* ============================================
   WHITENING SERIES SECTION
   ============================================ */

.whitening-section {
  padding: 25px 15px;
  background-color: #f9f9f9;
}

/* ============================================
   NEWSLETTER SECTION - Mobile Optimized
   ============================================ */

.newsletter-section {
  background: linear-gradient(135deg, #6B9FB0 0%, #4a7a8a 100%);
  color: white;
  padding: 30px 15px;
}

.newsletter-container {
  max-width: 1920px;
  margin: 0 auto;
  text-align: center;
}

.newsletter-container h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.newsletter-container p {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-form input {
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  min-height: 44px;
}

.newsletter-form button {
  min-height: 44px;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.scroll-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

.zoom-animate {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s ease;
}

.zoom-animate.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   TABLET - 768px and up
   ============================================ */

@media (min-width: 768px) {
  body {
    padding-top: 90px;
  }

  .hero-section {
    height: 100vh;
    max-height: 1080px;
    margin-top: -90px;
    padding-top: 90px;
  }

  .hero-overlay h1 {
    font-size: 4rem;
  }

  .carousel-prev,
  .carousel-next {
    display: block;
    font-size: 2rem;
    padding: 15px 20px;
  }

  .carousel-prev {
    left: 30px;
  }

  .carousel-next {
    right: 30px;
  }

  .carousel-dots {
    bottom: 30px;
    gap: 12px;
  }

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

  .dot.active {
    width: 30px;
  }

  .section-title {
    padding: 60px 30px 40px;
  }

  .section-title h2 {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }

  .collections-section {
    padding: 40px 30px;
  }

  .collections-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .campaign-banner {
    height: 400px;
    margin: 50px 0;
  }

  .campaign-content {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2));
  }

  .campaign-content h2 {
    font-size: 2.2rem;
  }

  .campaign-content p {
    display: block;
    font-size: 1rem;
  }

  .hot-selling-section {
    padding: 50px 30px;
  }

  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
  }

  .product-card {
    min-height: 280px;
  }

  .product-image {
    height: 180px;
  }

  .product-info {
    padding: 15px;
  }

  .product-name {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .newsletter-section {
    padding: 60px 30px;
  }

  .newsletter-container h2 {
    font-size: 2rem;
  }

  .newsletter-form {
    flex-direction: row;
    max-width: 500px;
    margin: 0 auto;
  }

  .newsletter-form input {
    flex: 1;
  }
}

@media (min-width: 1024px) {
  .collections-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .products-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
  }
}

/* ============================================
   TOUCH-FRIENDLY OPTIMIZATION
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  .collection-card,
  .product-card {
    min-height: auto;
  }

  .collection-card:hover img {
    transform: none;
  }

  .product-card:hover {
    box-shadow: none;
    transform: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .hero-section,
  .newsletter-section,
  .carousel-prev,
  .carousel-next {
    display: none;
  }
}
