/* Mobile-first optimizations - KAV */
/* Touch targets min 44x44px, readable font, no horizontal scroll */

@media (max-width: 767.98px) {
  /* Base */
  body {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
  }
  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Touch-friendly buttons & links */
  .btn:not(.btn-icon) {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  .btn-sm:not(.btn-icon) {
    min-height: 38px;
    padding: 0.4rem 0.75rem;
  }
  .dropdown-item {
    min-height: 44px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
  }
  a.nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
  }
  .list-group-item-action {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Form inputs */
  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 16px;
  }
  .form-floating .form-control {
    padding-top: 1.2rem;
  }
  .form-check-input {
    width: 1.25em;
    height: 1.25em;
  }

  /* Cards */
  .card-body {
    padding: 1rem;
  }
  .card {
    margin-bottom: 1rem;
  }

  /* Tables → hide on mobile, use .mobile-card-wrap */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    font-size: 0.9rem;
  }
  .table th,
  .table td {
    padding: 0.5rem 0.35rem;
    white-space: nowrap;
  }

  /* Accordion touch-friendly */
  .accordion-button {
    min-height: 48px;
    padding: 0.75rem 1rem;
  }

  /* Spacing */
  .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  .mb-5 {
    margin-bottom: 1.25rem !important;
  }
  h2,
  .h2 {
    font-size: 1.35rem;
  }

  /* Checkout mobile: thứ tự 1.Đơn hàng 2.Mã giảm giá 3.Phương thức TT 4.Thông tin 5.Nút */
  .checkout-layout {
    display: flex;
    flex-wrap: wrap;
  }
  .checkout-layout .checkout-block {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Checkout desktop: cùng thứ tự, nằm bên trái, max-width thân thiện */
@media (min-width: 992px) {
  .checkout-column {
    max-width: 640px;
  }
  .checkout-layout {
    display: flex;
    flex-wrap: wrap;
  }
  .checkout-layout .checkout-block {
    width: 100%;
  }
}

/* Embedded content responsive */
.post-content img,
.product-description img {
  max-width: 100%;
  height: auto;
}
