/**
 * Alhadil Beauty - Index Page Styles
 * Clean version that doesn't interfere with header
 */

/* ENSURE NO GLOBAL CONSTRAINTS */
html, body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* RESET ANY CONTAINER MARGINS/PADDING ON INDEX PAGE */
body {
  margin: 0 !important;
  padding: 0 !important;
}

/* MAIN CONTENT WRAPPER */
.main-content {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* FORCE FULL WIDTH FOR SLIDER - NUCLEAR OPTION */
.hero-slider-section {
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  margin-top: 0 !important;
  margin-bottom: 60px !important;
  padding: 0 !important;
  background-color: var(--primary-color);
  z-index: 1;
  overflow: hidden;
  box-sizing: border-box !important;
  max-width: none !important;
}

/* Kill any Bootstrap or other framework containers */
.hero-slider-section,
.hero-slider-section * {
  box-sizing: border-box;
}

.hero-slider-section .container,
.hero-slider-section .container-fluid,
.hero-slider-section .row,
.hero-slider-section [class*="col-"] {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hero-slider {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.hero-swiper {
  width: 100%;
  position: relative;
  min-height: 400px;
  margin: 0;
  padding: 0;
}

.hero-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  width: 100%;
}

.slide-inner {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.slide-img {
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* SWIPER NAVIGATION & PAGINATION */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
  color: var(--text-color-light);
  background-color: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  z-index: 10;
  transition: all 0.3s ease;
  margin-top: -25px;
}

.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
  background-color: var(--secondary-color);
  transform: scale(1.1);
}

.hero-swiper .swiper-button-next:after,
.hero-swiper .swiper-button-prev:after {
  font-size: 1.2rem;
  font-weight: bold;
}

.hero-swiper .swiper-pagination {
  bottom: 20px;
  z-index: 10;
}

.hero-swiper .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.6);
  opacity: 1;
  transition: all 0.3s ease;
}

.hero-swiper .swiper-pagination-bullet-active {
  background-color: var(--secondary-color);
  transform: scale(1.2);
}

/* PRODUCT SECTIONS */
.products-section,
.new-arrivals-section {
  padding: 60px 0;
  position: relative;
  z-index: 1;
}

.bestsellers-section {
  background-color: rgba(255, 255, 255, 0.02);
}

/* SECTION HEADERS */
.section-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-color-light);
  position: relative;
  display: inline-block;
}

.section-header h2:after {
  content: "";
  position: absolute;
  width: 80px;
  height: 3px;
  background-color: var(--secondary-color);
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.section-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* PRODUCTS GRID */
.products-grid {
  position: relative;
}

.products-grid .row {
  margin-left: -15px;
  margin-right: -15px;
}

.products-grid .row > [class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 30px;
  display: flex;
}

/* PRODUCT CARDS */
.product-card {
  background-color: var(--text-color-light);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  transform: translateY(0);
  will-change: transform, box-shadow;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

/* PRODUCT IMAGE CONTAINER */
.product-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 aspect ratio */
  overflow: hidden;
  background-color: #f8f9fa;
}

.product-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

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

.product-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

/* PRODUCT BADGES */
.badge-container {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.product-badge {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-badge.sale {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #b86d7a 100%);
}

.product-badge.new {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.product-badge.bestseller {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #333;
}

/* PRODUCT ACTIONS */
.product-actions {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
}

.product-card:hover .product-actions {
  opacity: 1;
  visibility: visible;
  bottom: 20px;
}

.action-btn {
  width: 42px;
  height: 42px;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.wishlist-btn.in-wishlist {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

.wishlist-btn.in-wishlist:hover {
  background-color: #b86d7a;
}

/* PRODUCT INFO */
.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  line-height: 1.4;
  height: 2.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-title a {
  color: var(--text-color-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-title a:hover {
  color: var(--secondary-color);
}

.product-price {
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: auto;
}

.price {
  color: var(--primary-color);
}

.price-new {
  color: var(--secondary-color);
  margin-right: 8px;
}

.price-old {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9rem;
  font-weight: 400;
}

/* SECTION FOOTER */
.section-footer {
  text-align: center;
  margin-top: 40px;
}

.btn-view-all {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #b86d7a 100%);
  color: var(--text-color-light);
  border: none;
  padding: 14px 35px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(210, 133, 153, 0.3);
}

.btn-view-all:hover {
  background: linear-gradient(135deg, #b86d7a 0%, var(--secondary-color) 100%);
  color: var(--text-color-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(210, 133, 153, 0.4);
}

/* LOADING STATES */
.product-card.loading {
  pointer-events: none;
}

.action-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.action-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* RESPONSIVE STYLES */
@media (max-width: 1199px) {
  .section-header h2 {
    font-size: 2.2rem;
  }
  
  .hero-swiper {
    min-height: 350px;
  }
  
  .hero-swiper .swiper-slide {
    min-height: 350px;
  }
}

@media (max-width: 991px) {
  .products-section,
  .new-arrivals-section {
    padding: 50px 0;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .section-header {
    margin-bottom: 40px;
  }
  
  .hero-swiper {
    min-height: 300px;
  }
  
  .hero-swiper .swiper-slide {
    min-height: 300px;
  }
  
  .hero-swiper .swiper-button-next,
  .hero-swiper .swiper-button-prev {
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 767px) {
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .section-header p {
    font-size: 1rem;
  }
  
  .product-info {
    padding: 15px;
  }
  
  .product-title {
    font-size: 0.95rem;
  }
  
  .hero-swiper {
    min-height: 250px;
  }
  
  .hero-swiper .swiper-slide {
    min-height: 250px;
  }
  
  /* Make slider images show full content on mobile */
  .hero-slider-section {
    margin-bottom: 40px !important;
  }
  
  .slide-img {
    object-fit: contain !important;
    background-color: #f8f9fa;
    min-height: 250px !important;
    max-height: 350px !important;
    height: auto !important;
    width: 100% !important;
  }
  
  .slide-inner {
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    height: 100%;
  }
  
  .hero-swiper .swiper-button-next,
  .hero-swiper .swiper-button-prev {
    width: 40px;
    height: 40px;
  }
  
  .hero-swiper .swiper-button-next:after,
  .hero-swiper .swiper-button-prev:after {
    font-size: 1rem;
  }
}

@media (max-width: 575px) {
  .products-section,
  .new-arrivals-section {
    padding: 40px 0;
  }
  
  .section-header {
    margin-bottom: 30px;
  }
  
  .section-header h2 {
    font-size: 1.6rem;
  }
  
  /* Slider adjustments for small mobile */
  .hero-swiper {
    min-height: 200px !important;
  }
  
  .hero-swiper .swiper-slide {
    min-height: 200px !important;
  }
  
  .slide-img {
    min-height: 200px !important;
    max-height: 300px !important;
  }
  
  .slide-inner {
    min-height: 200px;
  }
  
  .products-grid .row > [class*="col-"] {
    margin-bottom: 20px;
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .badge-container {
    top: 8px;
    left: 8px;
  }
  
  .product-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  
  .action-btn {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
  
  .product-actions {
    gap: 6px;
  }
}