/* Root & Leaf — адаптація кожного UI-компонента (≤899px) */

/* —— Загальні —— */
@media (max-width: 899px) {
  img,
  video,
  svg {
    max-width: 100%;
    height: auto;
  }

  .page-title {
    padding: 1.15rem 0 0.65rem;
  }

  .page-title h1,
  .page-title p {
    word-break: break-word;
  }

  .page-title p {
    font-size: 0.9rem;
  }

  .section-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .glass-card {
    padding: clamp(1rem, 3vw, 1.45rem);
  }

  .btn {
    padding: 0.88rem 1.3rem;
    font-size: 0.88rem;
    max-width: 100%;
  }

  .btn-sm {
    min-height: 44px;
    padding: 0.62rem 1rem;
    font-size: 0.78rem;
  }

  .chip {
    max-width: 100%;
  }

  .badge {
    max-width: 100%;
    line-height: 1.25;
  }
}

@media (max-width: 767px) {
  /* Hero */
  .hero-badge {
    font-size: 0.68rem;
    padding: 0.38rem 0.8rem;
    max-width: 100%;
  }

  .hero-stats.glass-card {
    padding: 0.55rem;
    border-radius: var(--radius-md);
  }

  .hero-stat__label {
    hyphens: auto;
  }

  /* Marquee */
  .marquee {
    margin-bottom: 1.15rem;
    padding: 0.75rem 0;
  }

  /* USP */
  .usp-card {
    padding: 1.2rem 1rem;
  }

  .usp-card__icon {
    font-size: 1.65rem;
    margin-bottom: 0.5rem;
  }

  .usp-card h3 {
    font-size: 1.02rem;
    line-height: 1.25;
  }

  .usp-card p {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  /* Pot cards (каталог) */
  .pot-card__head {
    width: 100%;
    padding: 0 0.15rem;
    margin-bottom: 0.35rem;
  }

  .pot-card__fav {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .pot-card__rating {
    font-size: 0.7rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pot-card__saucer {
    width: 100%;
    box-sizing: border-box;
  }

  .pot-card__title {
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
  }

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

  .pot-card__cart {
    min-height: 44px;
    font-size: 0.8rem;
  }

  .pot-card__chips {
    gap: 0.25rem;
  }

  /* Plant cards (legacy) */
  .plant-card__body {
    padding: 1rem;
  }

  .plant-card h3 {
    font-size: 1rem;
    word-break: break-word;
  }

  .plant-card__fav {
    width: 40px;
    height: 40px;
  }

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

  .plant-card__meta {
    gap: 0.3rem;
  }

  /* Articles */
  .article-card__body {
    padding: 1rem;
  }

  .article-card h3 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .article-card__date {
    font-size: 0.78rem;
  }

  /* Reviews */
  .review-card {
    padding: 1.1rem 1rem;
  }

  .review-card p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .review-card__author {
    font-size: 0.92rem;
  }

  /* About */
  .about-hero {
    padding: 1.75rem 0 1.25rem;
  }

  .about-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.35rem);
    padding: 0 0.25rem;
  }

  .about-hero p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .hero-visual[style*="max-width"] {
    margin-bottom: 1.75rem !important;
    border-radius: var(--radius-md) !important;
  }

  .hero-visual img[style*="aspect-ratio"] {
    aspect-ratio: 16 / 10 !important;
    min-height: 160px;
  }

  .stats-grid {
    gap: 0.6rem;
  }

  .stat-card {
    padding: 1rem 0.6rem;
  }

  .stat-card > div:not(.stat-card__value) {
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .team-card {
    padding: 1.25rem 1rem;
  }

  .team-card h3 {
    font-size: 1rem;
  }

  .team-card p {
    font-size: 0.85rem;
  }

  /* Contact */
  .contact-grid {
    gap: 1.15rem;
    padding: 0.75rem 0 2.5rem;
  }

  .contact-info,
  .contact-form {
    padding: 0;
  }

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

  .form-group {
    margin-bottom: 1rem;
  }

  .form-group label {
    font-size: 0.75rem;
  }

  .form-group--icon .form-icon {
    top: 2.15rem;
  }

  .contact-card-item {
    padding: 0.95rem;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .contact-card-item strong {
    font-size: 0.88rem;
  }

  .contact-card-item a,
  .contact-card-item p {
    font-size: 0.85rem;
    word-break: break-word;
  }

  .contact-form-card .btn {
    width: 100%;
  }

  /* FAQ */
  .faq-item button {
    gap: 0.65rem;
    line-height: 1.35;
  }

  .faq-item__answer {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  /* Catalog */
  .promo-banner {
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.4rem;
    margin-right: -0.25rem;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0%, #000 88%, transparent 100%);
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-chips .chip {
    flex-shrink: 0;
  }

  .filters-panel {
    padding: 1.1rem;
  }

  .filter-group label {
    font-size: 0.8rem;
  }

  /* Cart */
  .cart-drawer__head {
    padding: max(1rem, env(safe-area-inset-top)) 1.1rem 1rem;
  }

  .cart-drawer__head h2 {
    font-size: 1.1rem;
  }

  .cart-drawer__body {
    padding: 0.75rem 1.1rem;
  }

  .cart-drawer__foot {
    padding: 1rem 1.1rem max(1.1rem, env(safe-area-inset-bottom));
  }

  .cart-drawer__foot .btn {
    width: 100%;
    min-height: 48px;
  }

  .cart-drawer__total {
    font-size: 1rem;
  }

  .cart-line {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.85rem 0;
  }

  .cart-line__info {
    min-width: 0;
    flex: 1 1 calc(100% - 88px);
  }

  .cart-line__info strong {
    font-size: 0.88rem;
    word-break: break-word;
  }

  .cart-line__qty button {
    width: 36px;
    height: 36px;
  }

  .cart-line__remove {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cart-empty {
    padding: 1.5rem 0.5rem;
    font-size: 0.9rem;
  }

  /* Plant page */
  .plant-detail {
    padding-bottom: 2.5rem;
  }

  .plant-hero__panel {
    padding: 1rem !important;
  }

  .plant-hero__title {
    font-size: clamp(1.28rem, 5.5vw, 1.65rem);
    word-break: break-word;
  }

  .plant-hero__latin {
    font-size: 0.75rem;
    word-break: break-word;
  }

  .plant-hero__lede {
    -webkit-line-clamp: 3;
    font-size: 0.85rem;
  }

  .plant-hero__price {
    font-size: 1.45rem;
  }

  .plant-hero__spec {
    padding: 0.55rem 0.5rem;
  }

  .plant-hero__spec dt {
    font-size: 0.58rem;
  }

  .plant-hero__spec dd {
    font-size: 0.76rem;
    word-break: break-word;
  }

  .plant-hero__care-item {
    padding: 0.75rem 0.65rem;
    gap: 0.5rem;
  }

  .plant-hero__care-value {
    font-size: 0.82rem;
    word-break: break-word;
  }

  .plant-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .plant-hero__actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .plant-section--related .section-header {
    margin-bottom: 1rem;
  }

  .care-item {
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .care-item svg {
    width: 22px;
    height: 22px;
  }

  /* Journal */
  .journal-layout {
    padding: 1.25rem 0 2.5rem;
  }

  .journal-hero__title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .journal-hero__lead {
    font-size: 0.95rem;
  }

  .journal-stat {
    font-size: 0.72rem;
    padding: 0.42rem 0.7rem;
  }

  .journal-filter {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
  }

  .journal-featured__media {
    min-height: 180px;
  }

  .journal-featured__body {
    padding: 1.1rem 1.15rem 1.25rem;
  }

  .journal-featured__body h2 {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .journal-featured__excerpt {
    font-size: 0.88rem;
  }

  .journal-featured__cta {
    width: 100%;
    text-align: center;
    margin-top: 0.35rem;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
  }

  .journal-card__body {
    padding: 1.1rem;
  }

  .journal-card__body h3 {
    font-size: 1rem;
  }

  .journal-card__foot {
    font-size: 0.8rem;
  }

  .journal-card__cta {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  .journal-newsletter {
    margin-top: 2rem;
  }

  .article-full {
    padding: 0 0 2rem;
  }

  .article-full__cover {
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  .article-full__body {
    font-size: 0.98rem;
  }

  .article-related {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .article-related__link {
    padding: 0.9rem 1rem;
  }

  /* Checkout */
  .checkout-panel h2 {
    font-size: 1.1rem;
  }

  .checkout-panel label {
    font-size: 0.75rem;
  }

  .checkout-panel input,
  .checkout-panel select,
  .checkout-panel textarea {
    width: 100%;
    box-sizing: border-box;
  }

  .checkout-aside {
    padding: 1.15rem;
  }

  .checkout-success {
    padding: 2rem 1rem;
  }

  .checkout-success__icon {
    font-size: 2.25rem;
  }

  .checkout-note {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* States & loaders */
  .error-state,
  .empty-state,
  .not-found-page {
    padding: 2.25rem 1rem;
    font-size: 0.92rem;
  }

  .catalog-loading {
    padding: 2rem 1rem !important;
  }

  .content-loader {
    min-height: 38vh;
    padding: 1.5rem 1rem;
  }

  .content-loader__text {
    font-size: 0.88rem;
    max-width: 28ch;
  }

  /* Toast */
  .ui-toast-host {
    padding: 0 max(0.85rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom))
      max(0.85rem, env(safe-area-inset-left));
  }

  .cart-toast {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  /* Footer */
  .footer-brand .logo {
    justify-content: center;
  }

  .footer-brand p {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .footer-nav a {
    padding: 0.35rem 0;
    font-size: 0.9rem;
  }

  .footer-social {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .footer-bottom {
    font-size: 0.78rem;
  }

  /* Section headers */
  .section-header > div {
    width: 100%;
  }

  .section-header .section-title {
    word-break: break-word;
  }

  /* Plant preview */
  .plant-preview__meta h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }

  .plant-preview__price {
    font-size: 1.2rem;
  }

  /* Theme toggle in header — компактніше */
  .theme-toggle {
    flex-shrink: 0;
  }
}

@media (max-width: 520px) {
  .plant-hero__specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .plant-hero__thumbs button {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .plants-grid {
    gap: 0.75rem 0.55rem;
  }

  .pot-card__planter-box {
    min-height: 145px;
  }

  .article-hero__content {
    padding: 1rem;
  }

  .article-hero__title {
    max-width: none;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
}

@media (max-width: 380px) {
  .pot-card__head {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .hero-badge {
    width: 100%;
    justify-content: center;
  }
}

