@import url('variables.css');

body{
    margin: 0;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Use viewport height to ensure full page height */
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: #f8f9fa;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    max-width: 100%;
}

*::-webkit-scrollbar{
    display: none;
}

html{
    scroll-behavior: smooth;
}

html, body {
  height: 100%;
  margin: 0;
}

/* Apply box-sizing globally */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Main content wrapper - add this to your main container */
main {
  flex: 1 0 auto; /* Allow this to grow and push footer down */
}

/* Container styles */
.container-fluid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
  overflow-x: hidden; /* Prevent container overflow */
  box-sizing: border-box;
}

/* Centered content width (legal pages, custom CMS pages, etc.) */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* === Base Styles (Mobile First) === */

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: var(--dark-bg);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background-color: #b38945;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: var(--dark-bg);
  color: var(--light-text);
  box-shadow: var(--shadow);
  border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #292929;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-light {
  background-color: var(--light-text);
  color: var(--dark-bg);
  box-shadow: var(--shadow);
}

.btn-light:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Section styles */
section {
  padding: 40px 0;
  position: relative;
}

.section-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--primary-color);
  font-weight: 600;
}

.section-subtitle {
  text-align: center;
  font-size: 14px;
  color: #777;
  margin-bottom: 30px;
}

/* Hero Section */
.hero {
  background-color: var(--dark-bg);
  background-image: linear-gradient(rgba(26, 26, 26, 0.8), rgba(26, 26, 26, 0.9)), url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  color: var(--light-text);
  padding: 70px 0;
  text-align: center;
}

.hero-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.hero h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 16px;
  margin-bottom: 25px;
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Statistics Section */
.statistics {
  background-color: var(--light-bg);
  padding: 50px 0;
}

.stats-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
  background-color: #fff;
  border-radius: 10px;
  padding: 25px 15px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 250px;
  transition: var(--transition);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 32px;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  position: relative;
}

.stat-number.animate {
  animation: countUp 2s ease-out forwards;
}

.stat-text {
  font-size: 14px;
  color: #777;
  font-weight: 500;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Featured Products Section */
.featured-products {
  padding: 50px 15px; /* Add horizontal padding */
  background-color: #fff;
  width: 100%;
  overflow-x: hidden;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 auto 30px;
  width: 100%;
  max-width: calc(100% - 30px); /* Ensure there's margin on both sides */
}

.product-card {
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  width: 100%;
}

.product-card:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 1px var(--secondary-color), 0 8px 24px rgba(45, 46, 46, 0.1);
}

/* Fix for featured products section */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 auto 30px;
  width: 100%;
  max-width: calc(100% - 30px); /* Ensure there's margin on both sides */
}

.product-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--accent-blue);
  color: #fff;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.product-badge-sale {
  background-color: #e74c3c;
}

.product-badge-new {
  background-color: #2ecc71;
}

.product-image {
  height: 180px;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.product-rating {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--secondary-color);
  font-size: 13px;
}

.product-rating span {
  margin-left: 6px;
  color: #777;
}

.product-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  flex-grow: 1;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.old-price {
  text-decoration: line-through;
  font-size: 13px;
  color: #999;
  font-weight: normal;
}

.view-all-container {
  text-align: center;
  margin-top: 20px;
}

/* Call to Action Section */
.cta {
  background-color: var(--primary-color);
  background-image: linear-gradient(rgba(45, 46, 46, 0.9), rgba(45, 46, 46, 0.9)), url('../images/cta-bg.jpg');
  background-size: cover;
  background-position: center;
  color: var(--light-text);
  padding: 60px 0;
  text-align: center;
}

.cta-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.cta h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
}

.cta p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 25px;
}

/* === Small Tablets === */
@media (min-width: 576px) {
  .btn {
    padding: 10px 22px;
    font-size: 14px;
  }
  
  .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  section {
    padding: 50px 0;
  }
  
  .section-title {
    font-size: 26px;
    margin-bottom: 10px;
  }
  
  .section-subtitle {
    font-size: 15px;
    margin-bottom: 35px;
  }
  
  /* Hero adjustments */
  .hero {
    padding: 80px 0;
  }
  
  .hero h1 {
    font-size: 34px;
    margin-bottom: 18px;
  }
  
  .hero p {
    font-size: 17px;
    margin-bottom: 28px;
  }
  
  .hero-buttons {
    gap: 12px;
  }
  
  /* Statistics adjustments */
  .statistics {
    padding: 60px 0;
  }
  
  .stats-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .stat-item {
    flex: 1 1 200px;
    max-width: 220px;
  }
  
  .stat-icon {
    font-size: 34px;
  }
  
  .stat-number {
    font-size: 30px;
  }
  
  /* Product adjustments */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .product-image {
    height: 160px;
  }
  
  /* CTA adjustments */
  .cta {
    padding: 70px 0;
  }
  
  .cta h2 {
    font-size: 28px;
  }
  
  .cta p {
    font-size: 17px;
  }
}

/* === Medium Tablets === */
@media (min-width: 768px) {
  .btn {
    padding: 11px 24px;
    font-size: 15px;
  }
  
  .btn-sm {
    padding: 8px 18px;
    font-size: 14px;
  }
  
  section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .section-subtitle {
    font-size: 16px;
  }
  
  /* Hero adjustments */
  .hero {
    padding: 90px 0;
  }
  
  .hero-content {
    max-width: 700px;
  }
  
  .hero h1 {
    font-size: 36px;
  }
  
  .hero p {
    font-size: 18px;
  }
  
  /* Statistics adjustments */
  .stats-container {
    gap: 20px;
  }
  
  .stat-item {
    padding: 25px 20px;
  }
  
  .stat-icon {
    font-size: 36px;
  }
  
  .stat-number {
    font-size: 32px;
  }
  
  .stat-text {
    font-size: 15px;
  }
  
  /* Product adjustments */
  .product-grid {
    gap: 25px;
  }
  
  .product-image {
    height: 180px;
  }
  
  .product-info {
    padding: 18px;
  }
  
  .product-title {
    font-size: 17px;
  }
  
  .product-rating {
    font-size: 14px;
  }
  
  .product-desc {
    font-size: 14px;
  }
  
  .product-price {
    font-size: 17px;
  }
  
  /* CTA adjustments */
  .cta-content {
    max-width: 600px;
  }
  
  .cta h2 {
    font-size: 30px;
  }
  
  .cta p {
    font-size: 18px;
  }
}

/* === Large Tablets/Small Desktops === */
@media (min-width: 992px) {
  /* Product adjustments - Smaller rectangular cards, 3 per row */
  .featured-products {
    padding: 70px 15px;
  }
  
  .product-grid {
    display: flex !important; /* Force flexbox */
    flex-wrap: wrap !important; /* Allow wrapping */
    grid-template-columns: none !important; /* Remove grid layout */
    gap: 0; /* Remove grid gap */
    justify-content: center; /* Center the cards */
    margin: 0 auto 40px;
    max-width: 1000px;
    width: 100%;
  }
  
  .product-card {
    width: 280px !important; /* Fixed width */
    max-width: 280px !important; /* Max width */
    margin: 0 15px 30px !important; /* Add spacing between cards */
    flex: 0 0 auto !important; /* Don't allow growing or shrinking */
    border-radius: 8px;
  }
  
  .product-image {
    height: 180px; /* Reduced height for smaller cards */
    width: 100%;
  }
  
  .product-info {
    padding: 16px;
    height: auto; /* Let content determine height */
    display: flex;
    flex-direction: column;
  }
  
  .product-title {
    font-size: 16px;
    margin-bottom: 6px;
  }
  
  .product-desc {
    font-size: 13px;
    margin-bottom: 12px;
  }
}

/* === Desktops and Larger === */
@media (min-width: 1200px) {
  /* Keep product grid at 3 per row with smaller cards */
  .product-grid {
    max-width: 1050px; /* Still constrained but slightly larger */
  }
  
  .product-card {
    width: 300px !important; /* Slightly larger width */
    max-width: 300px !important; /* Slightly larger max width */
    margin: 0 20px 30px !important; /* Slightly larger margins */
  }
  
  .product-image {
    height: 190px; /* Just slightly taller than tablet size */
  }
  
  .product-info {
    padding: 18px;
  }
}

/* Ensure all content respects boundaries */
img, video, object, embed {
  max-width: 100%;
  height: auto;
}

/* Add to the responsive sections to ensure no overflow at any breakpoint */
@media (min-width: 576px), 
       (min-width: 768px), 
       (min-width: 992px), 
       (min-width: 1200px) {
  .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }
}

/* Ensure product grid has proper margins */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 auto 30px;
  width: 100%;
  max-width: calc(100% - 30px); /* Ensure there's margin on both sides */
}

/* Additional container fixes */
.container-fluid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Ensure product cards have proper padding */
.product-card {
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  width: 100%;
}

/* Make sure section container has proper padding */
section .container-fluid {
  padding-left: 15px;
  padding-right: 15px;
}