/**
 * SoundShoppie — mobile/tablet tweaks only.
 * Desktop keeps the original fixed card + navbar look.
 */

html {
  -webkit-text-size-adjust: 100%;
}

/* —— Phones / small tablets —— */
@media (max-width: 767.98px) {
  body {
    padding-top: 56px;
    overflow-x: hidden;
  }

  .navbar #backward,
  .navbar #forward {
    display: none !important;
  }

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

  .navbar-collapse .form-inline,
  .navbar-collapse #searchForm {
    width: 100%;
    margin: 0.65rem 0;
  }

  .search-container {
    width: 100%;
    max-width: none;
  }

  .search-container .form-control {
    min-width: 0;
    flex: 1 1 auto;
    width: 100%;
  }

  .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem 0.55rem;
    border: 0;
  }

  /* Keep tagline; do not hide it */
  .cursoul .running-text .train-running2 {
    display: inline-block !important;
  }

  .cursoul .downArrow {
    bottom: 3.25rem !important;
    top: auto !important;
  }

  .cursoul .carousel-inner,
  .cursoul .carousel-item {
    min-height: 0 !important;
  }

  .cursoul .carousel-fade-image {
    width: 100% !important;
    height: 58vh !important;
    min-height: 300px !important;
    max-height: 560px;
    object-fit: cover !important;
    object-position: center top !important;
  }

  .cursoul .loader {
    height: 72px !important;
    margin-top: calc(-1 * (72px + 0.65rem)) !important;
    margin-bottom: 0.65rem !important;
  }

  .cursoul .loader .bar {
    width: 10px !important;
    height: 72px !important;
    margin: 0 2px !important;
  }

  .cursoul .shadowed-image {
    max-width: min(300px, 78vw) !important;
  }

  .cursoul .running-text {
    margin-top: -1.75rem !important;
    padding: 1.75rem 0.85rem 1.5rem !important;
  }

  .cursoul .running-text .train-running2 {
    font-size: clamp(0.95rem, 3.8vw, 1.25rem) !important;
    line-height: 1.35;
  }

  #welcometoSoundShoppie > .mt-5.pt-5 {
    margin-top: 1.25rem !important;
    padding-top: 0.5rem !important;
  }

  #welcometoSoundShoppie h1 {
    margin: 1.25rem 0.75rem !important;
    font-size: clamp(1.45rem, 6.5vw, 1.9rem);
    line-height: 1.25;
  }

  #products .d-flex {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.85rem;
    text-align: center;
  }

  #products h2 {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0 !important;
  }

  /* Product grid: full-width 2-up, never left-stuck 250px cards */
  section > .container > .card-deck.d-flex,
  .card-deck.d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  .card-deck .product-card,
  .card-deck .product-card.m-2,
  .card-deck > .product-card {
    flex: none !important;
    flex-grow: 0 !important;
    flex-shrink: 1 !important;
    flex-basis: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .product-card .card-title {
    font-size: 0.95rem;
  }

  .product-card .card-price {
    font-size: 1rem;
  }

  .product-card .card-details-btn {
    padding: 0.55rem 0.5rem;
    font-size: 0.85rem;
    width: 92%;
  }

  .product-card .image-container .badge-notification {
    min-width: 2.4rem;
    min-height: 2.4rem;
    font-size: 0.62rem;
  }

  .pagination .page-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.9rem;
  }

  footer .text-center.p-3 p {
    font-size: 0.85rem;
    padding: 0 0.5rem;
  }

  #btn-back-to-top {
    right: 12px !important;
    bottom: 18px !important;
  }
}

/* Very narrow: one centered column, full usable width */
@media (max-width: 379.98px) {
  .card-deck.d-flex,
  section > .container > .card-deck.d-flex {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
  }

  .card-deck .product-card,
  .card-deck .product-card.m-2,
  .card-deck > .product-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Tablet: hide history arrows only; keep original card size */
@media (max-width: 991.98px) and (min-width: 768px) {
  .navbar #backward,
  .navbar #forward {
    display: none !important;
  }
}
