@media (max-width: 767px) {
  :root {
    --mobile-safe-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    --mobile-card-radius: 22px;
    --mobile-shadow: 0 18px 38px rgba(27, 107, 68, 0.18);
    --mobile-fab-shadow: 0 16px 32px rgba(12, 49, 31, 0.28);
  }

  html,
  body {
    background: #f4faf7;
    overscroll-behavior-y: none;
  }

  body {
    padding-bottom: var(--mobile-safe-bottom);
    font-size: 0.97rem;
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
  }

  .mobile-snap-container {
    scroll-snap-type: y mandatory;
  }

  .mobile-snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

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

  .site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    padding: 0.75rem 0.35rem 0.45rem;
    margin: 0;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 16px 28px rgba(8, 45, 25, 0.28);
  }

  .header-top {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  .brand {
    gap: 0;
  }

  .brand-logo {
    height: 44px;
  }

  .header-actions {
    gap: 0.45rem;
    justify-content: flex-end;
  }

  .header-link,
  .auth-links,
  .header-button,
  .welcome,
  .mobile-menu-toggle {
    display: none !important;
  }

  .cart-button {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    right: 16px;
    z-index: 120;
    min-width: 0;
    min-height: 56px;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    padding: 0;
    justify-content: center;
    background: linear-gradient(135deg, #2f9d66, #1f6b47);
    color: #fff;
    box-shadow: var(--mobile-fab-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .cart-button .cart-label {
    display: none;
  }

  .cart-button i {
    font-size: 1.35rem;
  }

  .cart-count {
    position: absolute;
    top: 8px;
    right: 6px;
    background: #fff;
    color: #1f6b47;
    font-size: 0.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .cart-button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 8px 20px rgba(12, 49, 31, 0.24);
  }

  .main-nav {
    display: none;
  }

  .page-content {
    padding-block: 1.25rem 2.5rem;
  }

  .container {
    width: calc(100% - 1.5rem);
  }

  .hero-section {
    padding: 1.4rem 0 1rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
    align-items: center;
  }

  .hero-text h1 {
    font-size: 1.55rem;
    line-height: 1.22;
    margin-bottom: 0.75rem;
  }

  .hero-text p {
    font-size: 0.9rem;
    color: #335244;
    max-width: 320px;
    margin: 0 auto 1rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.55rem;
  }

  .hero-features {
    flex-direction: column;
    gap: 0.45rem;
  }

  .hero-card {
    padding: 1.1rem;
    border-radius: 20px;
    box-shadow: var(--mobile-shadow);
    background: rgba(255, 255, 255, 0.92);
  }

  .hero-card-list {
    gap: 0.55rem;
  }

  .category-section,
  .featured-section,
  .benefits-section,
  .form-section,
  .cart-section,
  .checkout-section,
  .orders-section {
    padding-block: 1.5rem;
  }

  #categories {
    scroll-margin-top: calc(92px + env(safe-area-inset-top, 0px));
  }

  .category-section .section-header h2 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .category-section .section-header p {
    display: none;
  }

  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 92px;
    border-radius: 20px;
    text-align: center;
    background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.92),
      rgba(236, 245, 240, 0.88)
    );
    box-shadow: 0 16px 32px rgba(27, 107, 68, 0.12);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .category-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .category-card-header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    color: #1f4433;
  }

  .category-card .badge,
  .category-card-desc,
  .category-card-link {
    display: none !important;
  }

  .category-card:active {
    transform: scale(0.98);
    box-shadow: 0 10px 20px rgba(27, 107, 68, 0.18);
  }

  .mobile-snap-item {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
  }

  .product-grid-mobile {
    scroll-snap-type: y proximity;
  }

  .category-hero {
    margin-bottom: 1.25rem;
  }

  .category-hero-card {
    border-radius: 22px;
    padding: 1.15rem 1rem;
    gap: 0.75rem;
    text-align: center;
    background: linear-gradient(
      135deg,
      rgba(248, 252, 249, 0.94),
      rgba(236, 245, 240, 0.92)
    );
    box-shadow: 0 16px 30px rgba(21, 68, 45, 0.16);
  }

  .category-hero-card h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .category-hero-card p {
    font-size: 0.92rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .category-meta {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
  }

  .product-list {
    display: grid;
    gap: 1rem;
  }

  .product-list .product-card,
  .product-grid .product-card {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .product-list .product-card-image,
  .product-grid .product-card-image {
    min-height: 0;
    max-height: 120px;
    padding: 0.5rem;
  }

  .product-list .product-card-title,
  .product-grid .product-card-title {
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
  }

  .product-card-body {
    gap: 0.4rem;
  }

  .product-card-body p {
    font-size: 0.85rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card,
  .cart-items,
  .cart-summary,
  .checkout-form,
  .checkout-summary,
  .order-card,
  .form-card {
    border-radius: var(--mobile-card-radius);
    box-shadow: var(--mobile-shadow);
    padding: 1.25rem 1.1rem;
    backdrop-filter: blur(8px);
  }

  .product-card-image {
    min-height: 0;
    max-height: 120px;
    padding: 0.5rem;
  }

  .product-card-footer {
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }

  .product-card-footer .price {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .product-card-footer form {
    flex: 1;
    width: 100%;
  }

  .product-card-footer .add-button {
    justify-content: center;
    gap: 0.25rem;
    padding: 0.55rem 0.75rem;
    font-size: 13px;
  }

  .add-button,
  .primary,
  .secondary,
  .header-button,
  .welcome,
  .auth-links a,
  .mobile-bottom-nav__link {
    min-height: 48px;
    border-radius: 16px;
  }

  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"] {
    min-height: 48px;
    border-radius: 16px;
  }

  .primary,
  .secondary,
  .add-button,
  button,
  .link-button {
    touch-action: manipulation;
  }

  .primary:active,
  .secondary:active,
  .add-button:active,
  button:active {
    transform: scale(0.99);
    filter: brightness(0.97);
  }

  input,
  textarea,
  select {
    min-height: 48px;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 110;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem clamp(0.75rem, 4vw, 1.25rem);
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
    background: rgba(16, 57, 36, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: 0 -8px 18px rgba(9, 36, 22, 0.28);
  }

  .mobile-bottom-nav__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .mobile-bottom-nav__link i {
    font-size: 1.1rem;
  }

  .mobile-bottom-nav__link.is-active {
    color: #ffffff;
  }

  .mobile-bottom-nav__link:active {
    transform: translateY(1px);
  }

  .site-footer {
    text-align: center;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .footer-bottom .container {
    justify-content: center;
  }

  .flash-messages {
    margin-top: 0;
  }

  .cart-layout,
  .checkout-grid,
  .product-page .product-layout,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .product-media {
    position: static;
    display: grid;
    gap: 1rem;
  }

  .cart-item,
  .checkout-items li,
  .order-items li {
    border-radius: 18px;
  }

  .product-page {
    padding-bottom: 1.5rem;
  }

  .product-page .product-layout {
    gap: 1.25rem;
  }

  .product-page .product-media {
    order: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .product-page .product-media .product-main-image {
    height: clamp(220px, 52vh, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
    border-radius: 20px;
    box-shadow: var(--mobile-shadow);
    background: #ffffff;
  }

  .product-page .product-media img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
  }

  .product-page .product-info-panel {
    padding: 1.35rem 1.1rem 4.2rem;
    border-radius: 22px;
    box-shadow: var(--mobile-shadow);
    gap: 1rem;
    background: rgba(255, 255, 255, 0.94);
  }

  .product-page .product-label {
    justify-content: center;
    font-size: 0.72rem;
  }

  .product-page .product-title {
    font-size: 1.35rem;
    text-align: center;
  }

  .product-page .product-short {
    font-size: 0.95rem;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-page .product-purchase {
    gap: 0.75rem;
    padding: 1.15rem;
    border-radius: 20px;
  }

  .product-page .product-price {
    font-size: 1.55rem;
    text-align: center;
  }

  .product-page .quantity-input {
    justify-content: center;
  }

  .product-page .quantity-input input {
    width: 3rem;
  }

  .product-page .primary,
  .product-page .secondary {
    width: 100%;
  }

  .product-details {
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: var(--mobile-shadow);
  }

  .product-details section + section {
    padding-top: 0.9rem;
    margin-top: 0.9rem;
  }

  .product-details h2 {
    font-size: 1.1rem;
  }

  .product-details p,
  .product-details li {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .product-add-main {
    display: inline-flex;
  }

  .product-add-fab {
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.35rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2f9d66, #1f6b47);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--mobile-fab-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .product-add-fab i {
    font-size: 1.2rem;
  }

  .product-add-fab span {
    font-size: 0.95rem;
    font-weight: 700;
  }

  .product-add-fab:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 10px 24px rgba(12, 49, 31, 0.28);
  }

  .product-accordion {
    display: grid;
    gap: 0.75rem;
    scroll-snap-type: y mandatory;
  }

  .accordion-item {
    border-radius: 18px;
    background: rgba(244, 250, 247, 0.92);
    box-shadow: var(--mobile-shadow);
    overflow: hidden;
    scroll-snap-align: start;
  }

  .accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #214c37;
  }

  .accordion-trigger i {
    transition: transform 0.25s ease;
  }

  .accordion-item.is-open .accordion-trigger i {
    transform: rotate(180deg);
  }

  .accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 1.1rem;
  }

  .accordion-item.is-open .accordion-panel {
    padding-bottom: 1rem;
  }

  .accordion-panel p,
  .accordion-panel ul {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    color: #334f40;
  }

  .accordion-panel ul {
    padding-left: 1.1rem;
  }

  .product-page .back-link {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    z-index: 6;
    align-self: flex-start;
    margin: 0;
    background: rgba(244, 250, 247, 0.8);
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    box-shadow: var(--mobile-shadow);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
}
