/* 
 * Responsive CSS for Niramaya Candles Website
 * Breakpoints: 360px, 768px, 1024px, 1440px
 */

/* Extra Small Devices (360px and up) */
@media (min-width: 360px) {
  /* Base responsive styles */
  .container {
    padding-right: 15px;
    padding-left: 15px;
  }

  /* Navigation */
  .navbar {
    padding: 10px 0;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  /* Hero Section */
  .hero {
    padding: 60px 0;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.3;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-img {
    max-width: 100%;
    margin-top: 2rem;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* About Section */
  .about-text p {
    font-size: 0.95rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* Products Section */
  .product-card {
    margin-bottom: 1.5rem;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .product-info {
    padding: 1rem;
  }

  .product-info p {
    font-size: 0.9rem;
  }

  .product-price {
    font-size: 1rem;
  }

  /* Materials Section */
  .material-card {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .material-title {
    font-size: 1.1rem;
  }

  .material-card p {
    font-size: 0.9rem;
  }

  /* Contact Section */
  .contact-form {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .contact-info {
    padding: 1.5rem;
  }

  /* Footer */
  .footer {
    padding: 2rem 0 1rem;
  }

  .footer h5 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
  }

  .footer p,
  .footer a {
    font-size: 0.9rem;
  }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) {
  /* Navigation */
  .navbar {
    padding: 15px 0;
  }

  .navbar-brand {
    font-size: 1.8rem;
  }

  .navbar-nav .nav-link {
    margin: 0 10px;
  }

  /* Hero Section */
  .hero {
    min-height: 100vh;
    padding: 0;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  .hero-img {
    margin-top: 0;
  }

  /* Section Titles */
  .section-title {
    font-size: 2.2rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
    margin-bottom: 3rem;
  }

  /* About Section */
  .about-text p {
    font-size: 1rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  /* Products Section */
  .product-card {
    margin-bottom: 2rem;
  }

  .product-title {
    font-size: 1.3rem;
  }

  .product-info {
    padding: 1.5rem;
  }

  .product-info p {
    font-size: 1rem;
  }

  .product-price {
    font-size: 1.2rem;
  }

  /* Materials Section */
  .material-card {
    padding: 2rem;
    margin-bottom: 0;
  }

  .material-title {
    font-size: 1.3rem;
  }

  .material-card p {
    font-size: 1rem;
  }

  /* Contact Section */
  .contact-form {
    padding: 2rem;
    margin-bottom: 0;
  }

  .contact-info {
    padding: 2rem;
  }

  /* Footer */
  .footer h5 {
    margin-top: 0;
  }

  .footer p,
  .footer a {
    font-size: 1rem;
  }
}

/* Medium Devices (1024px and up) */
@media (min-width: 1024px) {
  /* Navigation */
  .navbar-nav .nav-link {
    margin: 0 15px;
  }

  /* Hero Section */
  .hero h1 {
    font-size: 3.2rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  /* Section Titles */
  .section-title {
    font-size: 2.5rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }

  /* About Section */
  .about-text p {
    font-size: 1.1rem;
  }

  /* Products Section - 2 columns */
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Materials Section */
  .material-card {
    height: auto;
  }
}

/* Large Devices (1440px and up) */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  /* Hero Section */
  .hero h1 {
    font-size: 3.5rem;
  }

  /* Section Titles */
  .section-title {
    font-size: 2.8rem;
  }

  /* Products Section - 3 columns */
  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  /* Materials Section */
  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* Touch Target Optimization */
.navbar-toggler {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-nav .nav-link {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.btn-primary {
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-control {
  min-height: 48px;
}

.contact-item {
  min-height: 48px;
}

.footer a {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.social-links a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image Optimization */
.hero-img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: 1rem;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* Animation Enhancements */
@media (prefers-reduced-motion: no-preference) {
  .navbar {
    transition: background 0.3s ease, padding 0.3s ease;
  }

  .navbar-brand,
  .navbar-nav .nav-link {
    transition: color 0.3s ease;
  }

  .btn-primary {
    transition: all 0.3s ease;
  }

  .product-card,
  .material-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .hero-img {
    transition: transform 0.3s ease;
  }

  .form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
}

/* Ensure proper spacing on all devices */
.section-padding {
  padding: 60px 0;
}

@media (min-width: 768px) {
  .section-padding {
    padding: 80px 0;
  }
}

/* Fix for product grid */
#products .row {
  display: flex;
  flex-wrap: wrap;
}

#products .col-lg-4,
#products .col-md-6 {
  display: flex;
  flex-direction: column;
}

.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-info p {
  flex: 1;
}

/* Responsive footer grid */
.footer .row:first-child > div {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .footer .row:first-child > div {
    margin-bottom: 0;
  }
}

/* Instagram Section Responsive */
@media (max-width: 767px) {
  .instagram-embed-wrapper {
    margin-bottom: 1.5rem;
  }

  .embed-placeholder {
    min-height: 250px;
    padding: 2rem 1.5rem;
  }

  .embed-placeholder i {
    font-size: 3rem;
  }
}

@media (min-width: 768px) {
  .instagram-embed-wrapper {
    margin-bottom: 2rem;
  }
}

/* Instagram grid fix */
#instagram .row {
  display: flex;
  flex-wrap: wrap;
}

#instagram .col-lg-4,
#instagram .col-md-6 {
  display: flex;
  flex-direction: column;
}
