/* =======================================
   Rian Audio Sounds - Responsive CSS
   Mobile-First Approach
   ======================================= */

/* ===== Base Responsive Settings ===== */
:root {
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
}

html {
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body {
  min-width: 0;
  overflow-x: hidden;
}

img, svg, video, iframe, embed, picture {
  max-width: 100%;
  height: auto;
  display: block;
}

img, .card-img-top, .gallery img, .img-thumbnail {
  max-width: 100%;
  height: auto;
}

.row, .col, .d-flex, .d-inline-flex {
  min-width: 0;
}

.text-truncate {
  min-width: 0;
}

.table-responsive, .table-responsive-custom {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.d-flex.flex-nowrap {
  overflow-x: auto;
}

.btn, .form-control, .form-select, .form-range, .form-check-input {
  min-width: 0;
}

/* ===== Mobile-First Typography ===== */
@media (max-width: 576px) {
  :root {
    --bs-body-font-size: 0.95rem;
  }
  
  body {
    font-size: 0.95rem;
  }
  
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.3rem; }
  h3, .h3 { font-size: 1.15rem; }
  h4, .h4 { font-size: 1rem; }
  h5, .h5 { font-size: 0.95rem; }
  h6, .h6 { font-size: 0.9rem; }
  
  .lead {
    font-size: 0.95rem;
  }
  
  .small, small {
    font-size: 0.85rem;
  }
  
  .fs-1 { font-size: 2rem !important; }
  .fs-2 { font-size: 1.75rem !important; }
  .fs-3 { font-size: 1.5rem !important; }
  .fs-4 { font-size: 1.25rem !important; }
  .fs-5 { font-size: 1.1rem !important; }
  .fs-6 { font-size: 1rem !important; }
}

/* ===== Responsive Spacing Utilities ===== */
@media (max-width: 576px) {
  .px-md-5 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .py-md-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  .p-md-5 { padding: 1.5rem !important; }
  
  .mx-auto { margin-left: auto; margin-right: auto; }
  .my-auto { margin-top: auto; margin-bottom: auto; }
  
  /* Responsive gaps */
  .gap-4 { gap: 1rem !important; }
  .gap-5 { gap: 1.25rem !important; }
  .gl-5 { column-gap: 1.25rem !important; }
}

/* ===== Responsive Images ===== */
img {
  max-width: 100%;
  height: auto;
}

.img-thumbnail {
  max-width: 100%;
  height: auto;
}

/* Responsive image containers */
.img-container {
  width: 100%;
  overflow: hidden;
  border-radius: 0.5rem;
}

.img-container img {
  width: 100%;
  height: auto;
  display: block;
}

.responsive-card-img,
.featured-img,
.category-img,
.product-grid-img,
.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.testimonial-avatar,
.testimonial-avatar-fallback {
  width: 80px;
  height: 80px;
  font-size: 1.25rem;
}

.cart-item-img,
.checkout-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.cart-qty-input {
  width: 70px;
  min-width: 70px;
}

@media (max-width: 576px) {
  .featured-img,
  .category-img,
  .product-grid-img,
  .product-img {
    height: 160px;
  }
  .testimonial-avatar,
  .testimonial-avatar-fallback {
    width: 60px;
    height: 60px;
    font-size: 1rem;
  }
  .cart-item-img,
  .checkout-item-img {
    width: 50px;
    height: 50px;
  }
  .cart-qty-input {
    width: 50px;
  }
}

/* ===== Table Responsiveness ===== */
@media (max-width: 768px) {
  .table {
    font-size: 0.9rem;
  }
  
  .table thead {
    font-size: 0.85rem;
  }
  
  .table td,
  .table th {
    padding: 0.5rem 0.25rem;
  }
  
  /* Stacked table on mobile */
  .table-responsive-custom {
    overflow-x: auto;
  }
}

/* ===== Card Responsiveness ===== */
.card {
  margin-bottom: 1rem;
}

@media (max-width: 576px) {
  .card {
    margin-bottom: 0.75rem;
  }
  
  .card-body {
    padding: 1rem 0.75rem;
  }
  
  .card-header {
    padding: 0.75rem;
  }
}

/* ===== Form Responsiveness ===== */
@media (max-width: 576px) {
  .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
  }
  
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.5rem 0.75rem;
  }
  
  .input-group {
    flex-wrap: wrap;
  }
  
  .input-group > * {
    flex: 1 1 100%;
  }
  
  .input-group .form-control,
  .input-group .form-select {
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .input-group > :not(:last-child) {
    margin-bottom: 0.5rem;
  }
  
  .input-group:has(> :last-child) > :not(:last-child) {
    border-radius: 0.5rem;
  }
}

/* ===== Button Responsiveness ===== */
@media (max-width: 576px) {
  .btn {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    -webkit-touch-callout: none;
    user-select: none;
  }
  
  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
  }
  
  .btn-sm {
    font-size: 0.85rem;
    padding: 0.375rem 0.5rem;
  }
  
  .btn-block {
    display: block;
    width: 100%;
  }
}

/* ===== Grid & Layout Responsiveness ===== */
@media (max-width: 576px) {
  .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Utility to stack columns */
  .col-stack {
    flex: 0 0 100% !important;
    max-width: 100%;
  }
}

/* ===== Navigation Responsiveness ===== */
@media (max-width: 576px) {
  .navbar-collapse {
    background-color: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
  }
  
  .navbar-nav {
    padding: 0.5rem 0;
  }
  
  .nav-link {
    padding: 0.5rem 1rem !important;
  }
}

/* ===== Modal Responsiveness ===== */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-content {
    border-radius: 0.5rem;
  }
  
  .modal-header {
    padding: 0.75rem;
  }
  
  .modal-body {
    padding: 1rem 0.75rem;
  }
  
  .modal-footer {
    padding: 0.75rem;
  }
}

/* ===== Offcanvas Responsiveness ===== */
@media (max-width: 576px) {
  .offcanvas {
    max-width: 90vw !important;
  }
}

/* ===== Utility Classes ===== */
.w-fit {
  width: fit-content;
}

.d-md-block {
  display: none !important;
}

@media (min-width: 768px) {
  .d-md-block {
    display: block !important;
  }
  
  .d-md-flex {
    display: flex !important;
  }
  
  .d-md-none {
    display: none !important;
  }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
  .btn,
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== Viewport Height Utilities ===== */
.min-vh-50 {
  min-height: 50vh;
}

.min-vh-75 {
  min-height: 75vh;
}

.min-vh-100 {
  min-height: 100vh;
}

/* ===== Print Styles (Bonus) ===== */
@media print {
  .d-print-none {
    display: none !important;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  .navbar,
  .footer-custom,
  .whatsapp-float,
  .btn-shop {
    display: none !important;
  }
}
