/* ==========================================================================
   Tàu Hũ Tươi Phúc An — responsive.css
   Mobile-first: nâng cấp layout dần theo breakpoint (tablet, desktop).
   Breakpoints: 768px (tablet), 1024px (desktop).
   ========================================================================== */

/* ---------- Màn hình rất nhỏ (<= 359px, vd iPhone SE 320px) ---------- */
@media (max-width: 359px) {
  :root {
    --container-padding: 14px;
  }

  .header__actions {
    gap: 8px;
  }

  .theme-toggle,
  .hamburger,
  .account-toggle {
    width: 40px;
    height: 40px;
  }

  .order-item {
    gap: 8px;
    padding: 8px;
  }

  .order-item__media {
    width: 52px;
    height: 52px;
  }

  .order-item__name {
    font-size: 0.92rem;
  }

  .order-item__price {
    font-size: 0.78rem;
  }

  .qty-control button {
    width: 36px;
    height: 36px;
  }

  .qty-control input {
    width: 28px;
    height: 36px;
  }
}

/* ---------- Footer: dòng liên hệ (địa chỉ/hotline/fanpage) chỉ ở mobile (< 768px) ----------
   Icon nhỏ + nhãn trên 1 dòng, giá trị xuống dòng dưới, nút icon tròn viền mảnh
   canh giữa theo chiều dọc của cả 2 dòng — Tablet/Desktop giữ nguyên bố cục cũ. */
@media (max-width: 767.98px) {
  /* iOS có thể tự phóng to khi focus input nhỏ hơn 16px. Chỉ áp dụng cho ô số lượng. */
  .qty-control input {
    font-size: 16px;
  }

  /* Nút chế độ tối chuyển ra nút nổi .theme-fab ở mobile/tablet — header trước
     đây có 4 nút icon tràn ngang ở nhiều khổ máy phổ biến (vd 390px), làm nút
     menu bị cắt cụt. */
  .theme-toggle {
    display: none;
  }

  .footer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'heading icon'
      'value icon';
    align-items: center;
    row-gap: 4px;
    column-gap: var(--space-md);
  }

  .footer-row__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-area: heading;
  }

  .footer-row__label-icon {
    display: inline-flex;
  }

  .footer-row__value {
    grid-area: value;
    margin-right: 0;
  }

  .footer-rows .footer-row__icon {
    grid-area: icon;
    align-self: center;
    width: 56px;
    height: 56px;
    background-color: transparent;
    border: 1.5px solid var(--color-gold);
    color: var(--color-gold);
    box-shadow: none;
  }

  .footer-row__icon svg {
    width: 22px;
    height: 22px;
  }

  .footer-rows .footer-row__icon:hover,
  .footer-rows .footer-row__icon:focus-visible {
    background-color: rgba(var(--color-gold-rgb), 0.12);
    border-color: var(--color-gold-strong);
    color: var(--color-gold-strong);
    transform: translateY(-2px) scale(1.04);
    box-shadow: none;
  }
}

/* ---------- Tablet (>= 768px) ---------- */
@media (min-width: 768px) {
  /* product-grid vẫn giữ 1 cột dọc theo yêu cầu — nới rộng và tăng trọng lượng thị giác
     để cân đối với các section khác của trang (trước đây bị coi là "hơi nhỏ"). */
  .product-grid {
    max-width: 820px;
  }

  .product-card {
    padding: 18px 26px;
    gap: var(--space-lg);
  }

  .product-card__media,
  .product-card__media-frame {
    width: 96px;
    height: 96px;
  }

  .product-card__name {
    font-size: 1.2rem;
  }

  .product-card__desc {
    font-size: 0.94rem;
  }

  .product-card__price {
    font-size: 1.05rem;
  }

  .product-card__cta {
    width: 46px;
    height: 46px;
  }

  .cta-bag-icon {
    width: 27px;
    height: 27px;
  }

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

  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }

  .footer-row {
    flex-wrap: nowrap;
  }
}

/* ---------- Desktop (>= 1024px) ---------- */
@media (min-width: 1024px) {
  .site-header {
    height: var(--header-height);
  }

  .site-nav {
    display: block;
  }

  .hamburger,
  .mobile-nav {
    display: none;
  }

  .hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
    text-align: left;
  }

  .hero__content {
    text-align: left;
  }

  .hero__lead {
    margin-inline: 0;
  }

  .hero__slogan {
    margin-inline: 0;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .hero__media {
    max-width: 100%;
  }

  /* product-grid vẫn giữ 1 cột dọc ở desktop theo yêu cầu (không chia 4 cột) —
     nới rộng thêm + tăng cỡ ảnh/chữ để cân đối với các section khác của trang. */
  .product-grid {
    max-width: 940px;
  }

  .product-card {
    padding: 22px 32px;
    gap: var(--space-xl);
  }

  .product-card__media,
  .product-card__media-frame {
    width: 108px;
    height: 108px;
  }

  .product-card__name {
    font-size: 1.32rem;
  }

  .product-card__desc {
    font-size: 1rem;
  }

  .product-card__price {
    font-size: 1.15rem;
  }

  .product-card__cta {
    width: 50px;
    height: 50px;
  }

  .cta-bag-icon {
    width: 28px;
    height: 28px;
  }

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

  .story {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }

  .story__media {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
  }

  .story--reverse .story__media {
    order: 2;
  }

  .footer-card {
    max-width: 640px;
  }
}

/* ---------- Desktop lớn (>= 1280px) ---------- */
@media (min-width: 1280px) {
  :root {
    --section-padding-y: 96px;
  }
}
