/* Bamboo Household Products - Responsive Stylesheet */
/* Mobile-First Responsive Design */

/* Base Mobile Styles (up to 576px) */
@media (max-width: 575.98px) {
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Spacing */
  .section {
    padding: 60px 0;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  /* Header */
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
  }
  
  /* Hero Section */
  .hero {
    text-align: center;
    padding-top: 100px;
  }
  
  .hero-content {
    margin-bottom: 3rem;
  }
  
  .hero .row {
    flex-direction: column;
  }
  
  .hero-image {
    order: -1;
    margin-bottom: 2rem;
  }
  
  /* Decorative Elements */
  .decorative-blob {
    display: none;
  }
  
  /* Cards and Items */
  .about-feature,
  .service-item,
  .price-item,
  .team-member,
  .review-item,
  .casestudy-item,
  .career-item,
  .coreinfo-item {
    padding: 1.5rem;
  }
  
  /* Features Section */
  .feature-item {
    flex-direction: column !important;
    text-align: center;
    gap: 1.5rem;
  }
  
  .feature-item:nth-child(even) {
    flex-direction: column !important;
  }
  
  /* Process Section */
  .process-item::after {
    display: none;
  }
  
  /* Timeline Section */
  .timeline-item {
    flex-direction: column !important;
    text-align: center;
    gap: 1rem;
  }
  
  .timeline-item:nth-child(even) {
    flex-direction: column !important;
  }
  
  .timeline-date {
    flex: none;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  
  /* Contact Form */
  .contact-form {
    padding: 2rem 1.5rem;
  }
  
  .contact-info {
    grid-template-columns: 1fr;
  }
  
  .contact-info-item {
    padding: 1.5rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery-item img {
    height: 200px;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  /* Service Features */
  .service-features,
  .price-features {
    font-size: 0.9rem;
  }
  
  /* Blog Grid */
  .blog-item {
    margin-bottom: 2rem;
  }
  
  .blog-item img {
    height: 180px;
  }
  
  .blog-content {
    padding: 1.5rem;
  }
  
    /* FAQ */
  .faq-question {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
  }

  .faq-answer {
    padding: 0 1.5rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Additional Contact Page Elements */
  .contact-additional,
  .contact-faq {
    padding: 2rem 1rem;
  }
  
  .faq-quick-item {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .faq-quick-item h5 {
    font-size: 0.9rem;
  }
  
  .faq-quick-item p {
    font-size: 0.8rem;
  }
  
  /* Newsletter form mobile */
  .newsletter-form {
    gap: 0.75rem;
  }
  
  .newsletter-form input,
  .newsletter-form button {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  /* Slider buttons mobile */
  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .prev-btn {
    left: -20px;
  }
  
  .next-btn {
    right: -20px;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
  
  /* Hero adjustments */
  .hero h1 {
    font-size: 2.8rem;
  }
  
  /* Grid improvements */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-info {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Features */
  .feature-item {
    flex-direction: row;
    text-align: left;
  }
  
  .feature-item:nth-child(even) {
    flex-direction: row-reverse;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
  
  /* Typography */
  .hero h1 {
    font-size: 3rem;
  }
  
  .section-title h2 {
    font-size: 2.5rem;
  }
  
  /* Spacing */
  .section {
    padding: 80px 0;
  }
  
  /* Header */
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  /* Hero */
  .hero {
    text-align: left;
  }
  
  .hero .row {
    flex-direction: row;
  }
  
  .hero-image {
    order: 0;
    margin-bottom: 0;
  }
  
  /* Show decorative elements */
  .decorative-blob {
    display: block;
  }
  
  /* Grid layouts */
  .about-feature {
    margin-bottom: 0;
  }
  
  .service-item,
  .price-item,
  .team-member,
  .review-item,
  .casestudy-item,
  .career-item,
  .coreinfo-item {
    margin-bottom: 0;
  }
  
  /* Process items */
  .process-item::after {
    display: block;
  }
  
  /* Timeline */
  .timeline-item {
    flex-direction: row;
    text-align: left;
  }
  
  .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
  }
  
  .timeline-date {
    flex: 0 0 150px;
    width: auto;
  }
  
  /* Contact */
  .contact-form {
    padding: 3rem;
  }
  
  .contact-info {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery-item img {
    height: 250px;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Blog */
  .blog-item img {
    height: 200px;
  }
  
  /* FAQ */
  .faq-question {
    padding: 1.5rem 2rem;
  }
  
  .faq-answer {
    padding: 0 2rem 1.5rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  /* Full spacing */
  .section {
    padding: 100px 0;
  }
  
  /* Hero */
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .hero p {
    font-size: 1.2rem;
  }
  
  /* Contact info */
  .contact-info {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  /* Hero */
  .hero h1 {
    font-size: 4rem;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra extra large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Sharper text rendering */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Adjust thin borders */
  .form-group input,
  .form-group textarea {
    border-width: 1px;
  }
  
  /* Sharper icons */
  .fa, .fas, .far, .fal, .fab {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
  /* Reduce hero height on landscape mobile */
  .hero {
    min-height: 100vh;
    padding-top: 60px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  /* Compact sections */
  .section {
    padding: 40px 0;
  }
}

/* Print Media Queries */
@media print {
  /* Hide interactive elements */
  .navbar-toggler,
  .scroll-top,
  .btn,
  .contact-form,
  .decorative-blob,
  .skip-link,
  .lightbox-modal,
  .slider-btn,
  .newsletter-form {
    display: none !important;
  }
  
  /* Adjust typography for print */
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1 { font-size: 18pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 14pt; }
  h4 { font-size: 12pt; }
  h5 { font-size: 11pt; }
  h6 { font-size: 10pt; }
  
  /* Ensure content fits */
  .container {
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Optimize spacing */
  .section {
    padding: 20px 0;
  }
  
  /* Single column layouts */
  .gallery-grid,
  .contact-info,
  .footer-content {
    grid-template-columns: 1fr !important;
  }
  
  /* Remove shadows and effects */
  .about-feature,
  .service-item,
  .price-item,
  .team-member,
  .review-item,
  .casestudy-item,
  .career-item,
  .coreinfo-item,
  .contact-form,
  .blog-item,
  .faq-item,
  .gallery-item,
  .contact-info-item,
  .timeline-item {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* Accessibility Improvements */

/* Focus indicators */
@media (prefers-reduced-motion: no-preference) {
  *:focus {
    outline: 2px solid var(--bamboo-green);
    outline-offset: 2px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --bamboo-green: #2d5016;
    --bamboo-green-dark: #1a3009;
  }
  
  /* Stronger borders */
  .form-group input,
  .form-group textarea,
  .btn,
  .about-feature,
  .service-item,
  .price-item,
  .team-member,
  .review-item,
  .casestudy-item,
  .career-item,
  .coreinfo-item,
  .contact-form,
  .blog-item,
  .faq-item,
  .gallery-item,
  .contact-info-item,
  .timeline-item {
    border: 2px solid var(--text-primary);
  }
  
  /* Remove subtle effects */
  .hero::before {
    opacity: 0;
  }
  
  .decorative-blob {
    opacity: 0.3;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  /* Disable animations */
  .decorative-blob,
  .fade-in,
  .slide-in-left,
  .slide-in-right,
  .scale-in {
    animation: none !important;
  }
  
  /* Instant transitions */
  * {
    transition-duration: 0.01ms !important;
  }
  
  /* Remove hover effects */
  .about-feature:hover,
  .service-item:hover,
  .price-item:hover,
  .team-member:hover,
  .review-item:hover,
  .casestudy-item:hover,
  .career-item:hover,
  .coreinfo-item:hover,
  .blog-item:hover,
  .gallery-item:hover,
  .btn:hover,
  .scroll-top:hover {
    transform: none !important;
  }
}

/* Dark mode support (if needed later) */

/* Container queries for advanced responsive design */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }
  
  @container (max-width: 400px) {
    .service-item,
    .price-item,
    .team-member {
      padding: 1rem;
    }
    
    .service-item h4,
    .price-item h4,
    .team-member h4 {
      font-size: 1rem;
    }
  }
}

/* Specific fixes for common issues */

/* iOS Safari fixes */
@supports (-webkit-appearance: none) {
  .form-group input,
  .form-group textarea {
    -webkit-appearance: none;
    border-radius: 8px;
  }
  
  .btn {
    -webkit-appearance: none;
  }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
  .form-group input,
  .form-group textarea {
    -moz-appearance: none;
  }
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
  .gallery-grid {
    display: -ms-grid;
  }
}

/* Fallbacks for older browsers */
@supports not (display: grid) {
  .gallery-grid,
  .contact-info,
  .footer-content {
    display: flex;
    flex-wrap: wrap;
  }
  
  .gallery-item,
  .contact-info-item,
  .footer-section {
    flex: 1;
    min-width: 250px;
    margin: 0 1rem 2rem;
  }
}

/* Flexible image sizing */
@supports (object-fit: cover) {
  .gallery-item img,
  .blog-item img,
  .service-item img,
  .team-member img,
  .hero-image img {
    object-fit: cover;
    object-position: center;
  }
}

/* Scroll behavior */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Modern CSS Grid fallbacks */
@supports not (display: grid) {
  .about .row,
  .services .row,
  .features .row,
  .priceplan .row,
  .team .row,
  .reviews .row,
  .casestudy .row,
  .process .row,
  .timeline .row,
  .career .row,
  .coreinfo .row,
  .blog .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
  }
  
  .about .col,
  .services .col,
  .features .col,
  .priceplan .col,
  .team .col,
  .reviews .col,
  .casestudy .col,
  .process .col,
  .timeline .col,
  .career .col,
  .coreinfo .col,
  .blog .col {
    flex: 1;
    padding: 0 15px;
    margin-bottom: 2rem;
  }
}

/* Ensure proper image display ratios */
.hero-image,
.feature-image,
.gallery-item,
.blog-item,
.team-member img {
  position: relative;
}

.hero-image::before,
.feature-image::before,
.gallery-item::before,
.blog-item::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}

.hero-image img,
.feature-image img,
.gallery-item img,
.blog-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Team member images maintain square aspect ratio */
.team-member img {
  aspect-ratio: 1 / 1;
}

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn,
  .navbar-nav .nav-link,
  .faq-question,
  .scroll-top {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .about-feature:hover,
  .service-item:hover,
  .price-item:hover,
  .team-member:hover,
  .review-item:hover,
  .casestudy-item:hover,
  .career-item:hover,
  .coreinfo-item:hover,
  .blog-item:hover,
  .gallery-item:hover {
    transform: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  }
  
  /* Simplify animations */
  .decorative-blob {
    animation: none;
  }
}

/* Ensure proper stacking contexts */
.hero {
  position: relative;
  z-index: 1;
}

.navbar {
  position: relative;
  z-index: 1050;
}

.scroll-top {
  z-index: 1040;
}

.loading {
  z-index: 9999;
}

/* Responsive font scaling */
@media (min-width: 320px) and (max-width: 1200px) {
  html {
    font-size: calc(16px + 6 * ((100vw - 320px) / 880));
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 18px;
  }
} 