/* Mawanella Buddy Mart - Responsive Stylesheet */

/* Mobile First Approach - Base styles are for mobile */

/* Extra Small devices (phones, 575px and down) */
@media (max-width: 575.98px) {
  .container {
    padding: 0 0.75rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .section-sm {
    padding: 1.5rem 0;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .btn {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .grid {
    gap: 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.5rem;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }

  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn {
    width: auto;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 1200px;
    padding: 0 2rem;
  }

  .section {
    padding: 5rem 0;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.875rem; }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 2rem; }
}

/* Navigation Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }

  .navbar .container {
    flex-wrap: wrap;
  }

  .navbar-brand {
    font-size: 1.25rem;
    flex: 1;
  }

  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: 0 4px 6px var(--shadow-light);
    margin-left: 0;
  }

  .navbar-nav.show {
    display: block;
  }

  .navbar-toggler {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
  }

  .nav-item {
    margin: 0.5rem 0;
  }

  .nav-link {
    padding: 0.5rem 0;
    display: block;
  }
}

@media (min-width: 769px) {
  .navbar-toggler {
    display: none;
  }

  .navbar-nav {
    display: flex !important;
  }
}

/* Hero Section Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 0;
    text-align: center;
  }

  .hero-content {
    margin-bottom: 2rem;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .hero-image {
    order: -1;
    margin-bottom: 2rem;
  }
}

@media (min-width: 769px) {
  .hero {
    padding: 5rem 0;
  }

  .hero-content,
  .hero-image {
    flex: 1;
  }
}

/* Card Responsive */
@media (max-width: 576px) {
  .card {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .card p {
    font-size: 0.9rem;
  }
}

/* Footer Responsive */
@media (max-width: 768px) {
  .footer {
    text-align: center;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-section {
    margin-bottom: 1.5rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Form Responsive */
@media (max-width: 576px) {
  .form-group {
    margin-bottom: 1rem;
  }

  .form-control {
    padding: 0.75rem;
    font-size: 1rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .form-group {
    margin-right: 0;
  }
}

/* Product Grid Responsive */
@media (max-width: 576px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-card {
    padding: 1rem;
  }

  .product-image {
    height: 150px;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 769px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* Animation Adjustments for Mobile */
@media (max-width: 768px) {
  .animate-on-scroll {
    transform: translateY(20px);
  }

  .stagger-1 { animation-delay: 0.05s; }
  .stagger-2 { animation-delay: 0.1s; }
  .stagger-3 { animation-delay: 0.15s; }
  .stagger-4 { animation-delay: 0.2s; }
  .stagger-5 { animation-delay: 0.25s; }
  .stagger-6 { animation-delay: 0.3s; }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    padding: 0.875rem 1rem;
  }

  .card:hover {
    transform: none;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --brand-red: #ff0000;
    --brand-blue: #0000ff;
    --text-primary: #000000;
    --bg-primary: #ffffff;
  }

  [data-theme="dark"] {
    --brand-red: #ff4444;
    --brand-blue: #4444ff;
    --text-primary: #ffffff;
    --bg-primary: #000000;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .theme-toggle {
    display: none !important;
  }

  .section {
    padding: 1rem 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #000;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}
