/* ==========================================================================
   KBS — responsive.css
   نقاط شکست موبایل، تبلت و دسکتاپ
   ========================================================================== */

/* ------------------------------------------------------ 1200px (desktop) */
@media (max-width: 1200px) {
  :root {
    --container: 1040px;
  }

  .footer-top {
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 26px;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: start;
  }

  .footer-col:last-child h4 {
    grid-column: 1 / -1;
  }

  .footer-col:last-child .footer-contact {
    grid-template-columns: repeat(3, 1fr);
  }

  .shop-layout {
    grid-template-columns: 220px 1fr;
  }
}

/* -------------------------------------------------------- 992px (tablet) */
@media (max-width: 992px) {
  :root {
    --header-h: 64px;
  }

  .section {
    padding-block: 42px;
  }

  .header-search {
    display: none;
  }

  .mobile-toggle {
    display: inline-grid;
  }

  .header-nav {
    display: none;
  }

  .hero-grid,
  .hero-slide {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-visual {
    min-height: 240px;
    order: -1;
  }

  .hero-glass {
    aspect-ratio: 16 / 10;
  }

  .hero-float.f1 {
    inset-inline-start: 4px;
  }

  .hero-float.f2 {
    inset-inline-end: 4px;
  }

  .hero-stats {
    gap: 18px;
  }

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

  .product-detail,
  .cart-layout,
  .checkout-layout,
  .contact-grid,
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .pd-gallery,
  .cart-summary,
  .shop-side {
    position: static;
  }

  .auth-aside {
    order: -1;
    min-height: 220px;
  }

  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 18px;
  }

  .panel-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel-side {
    position: static;
    padding: 10px;
  }

  /* سابدبار در موبایل به منوی کشویی تبدیل می‌شود */
  .panel-menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 13px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2, #f6f8fc);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
  }

  .panel-menu-btn svg {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--brand);
  }

  .panel-nav {
    display: none;
  }

  .panel-nav.is-open {
    display: grid;
  }

  .panel-nav .p-group {
    padding: 6px 10px 2px;
  }

  .panel-side > .btn {
    display: none;
  }

  .panel-user {
    border-bottom: 0;
    padding: 4px 4px 10px;
    margin-bottom: 6px;
  }

  .cart-item {
    grid-template-columns: 62px 1fr auto;
    grid-template-areas:
      "thumb info total"
      "thumb qty remove";
    row-gap: 8px;
  }

  .ci-thumb {
    grid-area: thumb;
    width: 62px;
    height: 62px;
  }

  .ci-info {
    grid-area: info;
  }

  .ci-total {
    grid-area: total;
    justify-self: end;
  }

  .cart-item .qty-control {
    grid-area: qty;
    justify-self: start;
  }

  .cart-item [data-remove] {
    grid-area: remove;
    justify-self: end;
  }

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

  .footer-col:last-child {
    display: block;
  }

  .footer-col:last-child .footer-contact {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------- 720px (mobile) */
@media (max-width: 720px) {
  body {
    font-size: 14px;
    line-height: 1.8;
  }

  .container {
    padding-inline: 16px;
  }

  .section {
    padding-block: 34px;
  }

  .section-head {
    margin-bottom: 18px;
  }

  .section-head .section-title {
    font-size: 19px;
  }

  .topbar .container {
    min-height: 34px;
    font-size: 10.5px;
  }

  .topbar-links {
    gap: 10px;
  }

  .topbar .topbar-note {
    display: none;
  }

  .topbar-links {
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .topbar-links::-webkit-scrollbar {
    display: none;
  }

  .topbar-links a {
    white-space: nowrap;
    font-size: 10.5px;
  }

  .header-main {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-tag {
    display: none;
  }

  .header-actions {
    gap: 2px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .account-btn {
    padding: 4px;
    border-radius: 12px;
  }

  .account-btn .account-label,
  .account-btn > svg {
    display: none;
  }

  .account-menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
    width: 250px;
  }

  .hero {
    padding-block: 34px 40px;
  }

  .hero h1 {
    font-size: 25px;
    letter-spacing: -0.6px;
  }

  .hero p.lead {
    font-size: 13px;
  }

  .hero-stats {
    gap: 14px;
    padding-top: 18px;
    margin-top: 22px;
  }

  .hero-stat strong {
    font-size: 17px;
  }

  .hero-cta .btn {
    flex: 1;
    justify-content: center;
  }

  .hero-float {
    padding: 8px 10px;
    font-size: 10.5px;
  }

  .hero-float .ico {
    width: 28px;
    height: 28px;
  }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
  }

  .cat-card {
    padding: 13px 10px;
  }

  .cat-thumb {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
  }

  .product-body {
    padding: 11px 11px 13px;
    gap: 6px;
  }

  .product-name {
    font-size: 12.5px;
    min-height: 2.5em;
  }

  .price-now {
    font-size: 13px;
  }

  .product-badges .p-badge {
    font-size: 9.5px;
    padding: 3px 7px;
  }

  .product-fav {
    width: 28px;
    height: 28px;
  }

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

  .brand-card {
    min-height: 78px;
  }

  .shop-side {
    display: block;
  }

  .filter-block {
    padding: 12px 0;
  }

  .shop-bar .select {
    flex: 1;
    min-width: 0;
  }

  .product-detail {
    gap: 22px;
  }

  .pd-price strong {
    font-size: 20px;
  }

  .pd-trust {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pd-buy {
    gap: 8px;
  }

  .pd-buy .btn-lg {
    flex: 1;
    font-size: 13px;
    padding: 11px 16px;
  }

  .cart-item {
    padding: 12px;
  }

  .cart-summary {
    margin-top: 4px;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 22px 16px;
    padding-block: 34px 26px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-payments {
    flex-wrap: wrap;
  }

  .panel-shell {
    padding-block: 14px 34px;
  }

  .panel-top h1 {
    font-size: 18px;
  }

  .panel-top .sub {
    font-size: 11.5px;
  }

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

  .stat-card .s-value {
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .card-pad,
  .card-body {
    padding: 15px;
  }

  .card-head {
    padding: 13px 15px;
  }

  .modal-root {
    padding: 10px;
  }

  .modal-body {
    padding: 15px;
  }

  .modal-foot {
    padding: 12px 15px;
  }

  .toast-stack {
    inset-inline: 16px;
    inset-block-end: 14px;
    max-width: none;
  }

  .auth-wrap {
    margin-block: 18px 34px;
    border-radius: var(--radius);
  }

  .auth-aside {
    display: none;
  }

  .page-hero {
    padding-block: 28px 30px;
  }

  .page-title {
    font-size: 20px;
  }

  .tabs .tab {
    padding: 10px 12px;
    font-size: 12px;
  }

  .toolbar {
    padding: 11px;
  }

  .toolbar .select {
    flex: 1;
    min-width: 0;
  }

  .toolbar .search-box {
    flex: 1 1 100%;
    min-width: 0;
  }

  .pagination {
    margin-top: 18px;
  }

  .pagination button,
  .pagination a {
    min-width: 32px;
    height: 32px;
    font-size: 11.5px;
  }
}

/* --------------------------------------------------------- 460px (small) */
@media (max-width: 460px) {
  .grid-auto {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

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

  .hero-stats {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .hero-stat {
    flex: 1 1 40%;
    min-width: 0;
  }

  .hero-stat span {
    font-size: 10px;
  }

  .split-2 {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .trust-item {
    padding: 6px 2px;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .header-actions .icon-btn:nth-child(1),
  .header-actions .icon-btn:nth-child(2) {
    display: none;
  }

  .brand-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------ 380px (very small phone) */
@media (max-width: 380px) {
  .container {
    padding-inline: 13px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-stat strong {
    font-size: 15px;
  }

  .grid-auto {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .product-body {
    padding: 10px 9px 11px;
  }

  .section-head .section-title {
    font-size: 17px;
  }

  .stat-card {
    padding: 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card .s-label {
    font-size: 10px;
  }

  .stat-card .s-value {
    font-size: 14px;
  }

  .btn {
    padding-inline: 13px;
    font-size: 12px;
  }

  .panel-top {
    gap: 8px;
  }

  .toolbar .search-box,
  .toolbar .select {
    min-width: 0;
    width: 100%;
  }
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-float,
  .sk {
    animation: none !important;
  }
}
