/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS ENHANCEMENTS
   Comprehensive fixes for mobile display and functionality issues
   ═══════════════════════════════════════════════════════════════ */

/* ── Critical viewport and touch optimizations ── */
@media (max-width: 980px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Better touch targets */
  a, button, .btn, input, select, textarea {
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(94, 163, 255, 0.2);
  }

  /* CRITICAL FIX: Ensure form buttons are always clickable on mobile */
  form button[type="submit"],
  form .btn,
  form a.btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Home hero mobile optimization */
  .home-hero {
    padding: 24px 0 32px;
  }

  .home-hero-shell {
    gap: 28px;
  }

  .home-hero-copy h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    line-height: 1.3;
    margin-bottom: 16px;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 50px;
    font-size: 1rem;
  }

  /* Home proof cards - stack on mobile */
  .home-proof-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
  }

  .home-proof-card {
    padding: 16px;
    text-align: center;
  }

  /* Home link row - better wrapping */
  .home-link-row {
    justify-content: center;
    gap: 10px;
  }

  .home-link-row a {
    flex: 0 1 auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
  }

  /* Hero visual - simplified on mobile */
  .hero-logo-stage {
    min-height: auto;
    padding: 24px 18px;
    border-radius: 28px;
  }

  .hero-logo-core {
    width: 140px;
    height: 140px;
  }

  .hero-floating-card {
    position: static;
    width: 100%;
    margin-top: 14px;
  }

  .hero-curved-panel {
    position: static;
    width: 100%;
    margin-top: 14px;
    border-radius: 24px;
  }

  /* Plans grid - single column on mobile */
  .plans-grid,
  .featured-home-plans {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .plan-card {
    padding: 20px;
  }

  /* Cards grid - single column */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Feature cards */
  .feature-card {
    padding: 18px;
    text-align: center;
  }

  /* Stats grid - 2 columns on tablet, 1 on phone */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* CTA section */
  .cta-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-actions .btn {
    width: 100%;
  }

  /* Section spacing */
  .section {
    padding: 24px 0 32px;
  }

  .section-head {
    text-align: center;
    margin-bottom: 24px;
  }

  .section-head h2 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
  }
}

/* ── Phone-specific optimizations (720px and below) ── */
@media (max-width: 720px) {
  .container {
    width: min(var(--container), calc(100% - 24px));
    padding-inline: 12px;
  }

  /* Navigation improvements */
  .nav-shell {
    min-height: 64px;
    padding: 8px 0;
  }

  .brand {
    gap: 10px;
  }

  .site-logo {
    max-height: 36px;
  }

  .brand-copy strong {
    font-size: 1rem;
  }

  .nav-toggle {
    width: 44px;
    height: 44px;
  }

  /* Mobile nav panel */
  .nav-panel {
    width: min(340px, calc(100vw - 16px));
    padding: 16px;
  }

  .site-nav a {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  /* Home hero adjustments */
  .home-hero-copy h1 {
    font-size: clamp(1.3rem, 5.5vw, 1.8rem);
  }

  .hero-actions .btn {
    min-height: 48px;
    font-size: 0.95rem;
  }

  .home-proof-card strong {
    font-size: 0.95rem;
  }

  .home-proof-card span {
    font-size: 0.85rem;
  }

  /* Hero visual compact */
  .hero-logo-stage {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .hero-logo-core {
    width: 120px;
    height: 120px;
  }

  .hero-curved-panel {
    padding: 18px;
  }

  .hero-curved-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Stats grid - single column on phone */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 16px;
    text-align: center;
  }

  /* Plan cards */
  .plan-card,
  .pricing-card {
    padding: 18px;
    border-radius: 20px;
  }

  .price-line {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .price-main {
    font-size: 1.8rem;
  }

  /* Check list */
  .check-list li {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  /* Buttons */
  .btn {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 0.95rem;
  }

  .btn-sm {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  /* Forms */
  input,
  select,
  textarea {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px; /* Prevent iOS zoom */
    border-radius: 12px;
  }

  .field-group {
    margin-bottom: 16px;
  }

  /* FAQ */
  .faq-question {
    min-height: 48px;
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 16px 16px;
    font-size: 0.9rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-card {
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
  }

  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
  }

  .sidebar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar-links a {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
    text-align: center;
  }

  /* Tables */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .responsive-table {
    min-width: 100%;
  }

  /* Product detail */
  .product-hero-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .purchase-panel {
    position: static;
    margin-top: 24px;
  }

  /* Back to top button */
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: calc(16px + var(--safe-bottom, 0px));
    inset-inline-end: 16px;
    font-size: 1.2rem;
  }

  /* Chat widget */
  .hostiny-chat-widget {
    bottom: calc(16px + var(--safe-bottom, 0px));
    inset-inline-end: 16px;
  }

  .hostiny-chat-launcher {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .hostiny-chat-panel {
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 100px);
    border-radius: 18px;
  }
}

/* ── Small phone optimizations (480px and below) ── */
@media (max-width: 480px) {
  .container {
    width: min(var(--container), calc(100% - 20px));
    padding-inline: 10px;
  }

  /* Typography scaling */
  body {
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  h2 {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  h3 {
    font-size: 1.1rem;
  }

  /* Home hero compact */
  .home-hero {
    padding: 20px 0 28px;
  }

  .home-hero-copy h1 {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
    margin-bottom: 14px;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .btn {
    min-height: 46px;
    font-size: 0.9rem;
    padding: 12px 16px;
  }

  .home-proof-grid {
    gap: 12px;
    margin-top: 16px;
  }

  .home-proof-card {
    padding: 14px;
  }

  .home-link-row {
    gap: 8px;
    margin-top: 14px;
  }

  .home-link-row a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Hero visual minimal */
  .hero-logo-stage {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .hero-logo-core {
    width: 100px;
    height: 100px;
  }

  .hero-floating-card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .hero-floating-card span {
    font-size: 0.75rem;
  }

  .hero-floating-card strong {
    font-size: 0.9rem;
  }

  .hero-curved-panel {
    padding: 16px;
    border-radius: 20px;
  }

  /* Section spacing */
  .section {
    padding: 20px 0 28px;
  }

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

  .section-head h2 {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .section-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
  }

  /* Plans and cards */
  .plans-grid,
  .cards-grid {
    gap: 14px;
  }

  .plan-card,
  .feature-card,
  .pricing-card {
    padding: 16px;
    border-radius: 18px;
  }

  .price-main {
    font-size: 1.6rem;
  }

  .price-sub {
    font-size: 0.85rem;
  }

  /* Buttons compact */
  .btn {
    min-height: 46px;
    padding: 11px 16px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  /* Forms compact */
  input,
  select,
  textarea {
    min-height: 46px;
    padding: 11px 13px;
    font-size: 16px;
  }

  /* CTA section */
  .cta-box {
    padding: 20px;
    border-radius: 20px;
  }

  .cta-grid {
    gap: 16px;
  }

  /* Footer compact */
  .footer-grid {
    gap: 20px;
  }

  .footer-bottom-row {
    font-size: 0.8rem;
    padding: 12px 0;
  }

  /* Dashboard compact */
  .dashboard-shell {
    padding: 20px 0 40px;
  }

  .dashboard-card,
  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  /* Chat widget compact */
  .back-to-top {
    bottom: calc(70px + var(--safe-bottom, 0px));
  }

  .hostiny-chat-launcher {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .hostiny-chat-panel {
    width: min(320px, calc(100vw - 20px));
  }
}

/* ── Extra small phones (360px and below) ── */
@media (max-width: 360px) {
  .container {
    width: min(var(--container), calc(100% - 16px));
    padding-inline: 8px;
  }

  body {
    font-size: 0.88rem;
  }

  .home-hero-copy h1 {
    font-size: 1.2rem;
    line-height: 1.35;
  }

  .hero-actions .btn {
    min-height: 44px;
    font-size: 0.88rem;
    padding: 10px 14px;
  }

  .home-proof-card {
    padding: 12px;
  }

  .home-proof-card strong {
    font-size: 0.9rem;
  }

  .home-proof-card span {
    font-size: 0.8rem;
  }

  .hero-logo-core {
    width: 90px;
    height: 90px;
  }

  .section-head h2 {
    font-size: 1.1rem;
  }

  .plan-card,
  .feature-card {
    padding: 14px;
  }

  .price-main {
    font-size: 1.4rem;
  }

  .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .footer-bottom-row {
    font-size: 0.75rem;
  }
}

/* ── Landscape phone optimization ── */
@media (orientation: landscape) and (max-height: 500px) {
  .nav-panel {
    height: 100vh;
    overflow-y: auto;
  }

  .home-hero {
    padding: 16px 0 24px;
  }

  .section {
    padding: 16px 0 24px;
  }

  .hero-logo-stage {
    min-height: auto;
    padding: 16px;
  }

  .hero-logo-core {
    width: 100px;
    height: 100px;
  }
}

/* ── Touch device optimizations ── */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover,
  .plan-card:hover,
  .feature-card:hover,
  .pricing-card:hover {
    transform: none;
  }

  /* Better active states for touch */
  .btn:active {
    transform: scale(0.97);
  }

  .plan-card:active,
  .feature-card:active {
    transform: scale(0.99);
  }

  /* Smooth scrolling for horizontal scrollers */
  .home-link-row,
  .pill-list,
  .table-wrap {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Safe area insets for notched devices ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .nav-panel {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .back-to-top {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .hostiny-chat-widget {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  @media (max-width: 480px) {
    .back-to-top {
      bottom: calc(70px + env(safe-area-inset-bottom));
    }
  }
}

/* ── Prevent text overflow in all cards ── */
.plan-card,
.feature-card,
.pricing-card,
.hero-card,
.panel,
.dashboard-card,
.home-proof-card,
.hero-floating-card,
.hero-curved-panel {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  min-width: 0;
}

/* ── Ensure images are responsive ── */
img {
  max-width: 100%;
  height: auto;
}

.hero-logo-core img,
.site-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Fix button text wrapping ── */
.btn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .btn {
    white-space: normal;
    word-break: break-word;
  }
}

/* ── Improve link tap targets in navigation ── */
@media (max-width: 980px) {
  .site-nav a,
  .footer-links a,
  .sidebar-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
  }
}

/* ── Fix modal and overlay on mobile ── */
@media (max-width: 720px) {
  .modal,
  .payment-expiry-modal__dialog {
    width: min(90vw, 400px);
    padding: 20px;
    margin: 16px;
  }
}

/* ── Improve form layout on mobile ── */
@media (max-width: 720px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-card,
  .auth-shell {
    padding: 20px;
  }
}

/* ── Better breadcrumb wrapping ── */
@media (max-width: 720px) {
  .breadcrumbs {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
  }

  .breadcrumbs a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/* ── Testimonial cards mobile ── */
@media (max-width: 720px) {
  .testimonial {
    padding: 16px;
    text-align: center;
  }

  .testimonial-author {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

/* ── Product cards mobile optimization ── */
@media (max-width: 720px) {
  .product-spec-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .spec-item {
    padding: 12px;
    text-align: center;
  }
}

/* ── Ensure proper z-index stacking on mobile ── */
@media (max-width: 980px) {
  .nav-overlay {
    z-index: 60;
  }

  .nav-panel {
    z-index: 65;
  }

  .site-header {
    z-index: 50;
  }

  .back-to-top {
    z-index: 40;
  }

  .hostiny-chat-widget {
    z-index: 45;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ADDITIONAL MOBILE ENHANCEMENTS - COMPREHENSIVE IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Better image handling ── */
@media (max-width: 980px) {
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Prevent layout shift from images */
  img[width][height] {
    height: auto;
  }

  /* Better hero images */
  .hero-logo-core img,
  .site-logo,
  .feature-icon img {
    object-fit: contain;
  }
}

/* ── Improved button groups ── */
@media (max-width: 720px) {
  .inline-actions,
  .hero-actions,
  .cta-actions,
  .card-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .inline-actions .btn,
  .hero-actions .btn,
  .cta-actions .btn,
  .card-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Better spacing system ── */
@media (max-width: 720px) {
  .section {
    padding: 28px 0;
  }

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

  .stack {
    gap: 20px;
  }

  .panel,
  .card,
  .hero-card {
    padding: 20px;
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 24px 0;
  }

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

  .stack {
    gap: 16px;
  }

  .panel,
  .card,
  .hero-card {
    padding: 16px;
    border-radius: 16px;
  }
}

/* ── Enhanced grid responsiveness ── */
@media (max-width: 980px) {
  .two-col,
  .split-grid,
  .hero-grid,
  .product-hero-grid,
  .detail-grid,
  .overview-grid,
  .faq-layout,
  .contact-main-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 720px) {
  .pricing-grid,
  .use-cases-grid,
  .feature-grid,
  .resource-grid,
  .product-spec-grid,
  .location-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── Better text readability ── */
@media (max-width: 720px) {
  body {
    line-height: 1.7;
  }

  p {
    margin-bottom: 1em;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.6;
  }

  .muted {
    font-size: 0.9rem;
  }
}

/* ── Improved list styling ── */
@media (max-width: 720px) {
  .check-list,
  .detail-list,
  .feature-list {
    gap: 10px;
  }

  .check-list li,
  .detail-list li {
    padding: 12px;
    font-size: 0.95rem;
  }
}

/* ── Better pill/badge layout ── */
@media (max-width: 720px) {
  .pill-list,
  .plan-card-topline,
  .feature-pills {
    gap: 8px;
    flex-wrap: wrap;
  }

  .pill,
  .status-badge,
  .eyebrow {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

/* ── Enhanced modal responsiveness ── */
@media (max-width: 720px) {
  .modal,
  .dialog,
  .payment-expiry-modal__dialog {
    width: calc(100vw - 32px);
    max-width: 400px;
    margin: 16px;
    padding: 20px;
  }

  .modal-header,
  .dialog-header {
    padding: 16px;
  }

  .modal-body,
  .dialog-body {
    padding: 16px;
  }

  .modal-footer,
  .dialog-footer {
    padding: 16px;
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer .btn,
  .dialog-footer .btn {
    width: 100%;
  }
}

/* ── Better alert styling ── */
@media (max-width: 720px) {
  .alert {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-radius: 14px;
  }

  .alert-icon {
    font-size: 1.2rem;
  }
}

/* ── Improved empty states ── */
@media (max-width: 720px) {
  .empty-state {
    padding: 32px 20px;
    text-align: center;
  }

  .empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .empty-state p {
    font-size: 0.9rem;
  }
}

/* ── Better loading states ── */
@media (max-width: 720px) {
  .loading,
  .spinner {
    padding: 24px;
  }
}

/* ── Enhanced testimonial cards ── */
@media (max-width: 720px) {
  .testimonial {
    padding: 18px;
    text-align: center;
  }

  .testimonial-content {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .testimonial-author {
    margin-top: 16px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .testimonial-avatar {
    width: 48px;
    height: 48px;
  }
}

/* ── Better pricing card layout ── */
@media (max-width: 720px) {
  .pricing-card,
  .plan-card {
    display: flex;
    flex-direction: column;
  }

  .pricing-card-head,
  .plan-card-head {
    text-align: center;
  }

  .price-line {
    justify-content: center;
    margin: 16px 0;
  }

  .pricing-card-features,
  .plan-card-features {
    flex: 1;
  }

  .pricing-card-footer,
  .plan-card-footer {
    margin-top: auto;
    padding-top: 16px;
  }
}

/* ── Improved cart/checkout ── */
@media (max-width: 720px) {
  .cart-item,
  .checkout-item {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .cart-item-image,
  .checkout-item-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }

  .cart-item-details,
  .checkout-item-details {
    width: 100%;
    text-align: center;
  }

  .cart-item-actions,
  .checkout-item-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ── Better order/ticket display ── */
@media (max-width: 720px) {
  .order-item,
  .ticket-row {
    padding: 16px;
  }

  .order-header,
  .ticket-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .order-meta,
  .ticket-meta {
    width: 100%;
  }

  .order-actions,
  .ticket-actions {
    width: 100%;
  }

  .order-actions .btn,
  .ticket-actions .btn {
    width: 100%;
  }
}

/* ── Enhanced payment UI ── */
@media (max-width: 720px) {
  .payment-card {
    padding: 20px;
  }

  .payment-timer {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .timer-value {
    font-size: 1rem;
    min-width: 60px;
  }

  .copy-chip {
    padding: 10px 14px;
    flex-direction: column;
    gap: 10px;
  }

  .copy-chip .btn {
    width: 100%;
  }
}

/* ── Better domain search ── */
@media (max-width: 720px) {
  .domain-search-form {
    flex-direction: column;
    gap: 10px;
  }

  .domain-search-input {
    width: 100%;
  }

  .domain-search-btn {
    width: 100%;
  }

  .domain-result-card {
    padding: 16px;
  }
}

/* ── Improved profile/settings ── */
@media (max-width: 720px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .profile-avatar {
    margin: 0 auto;
  }

  .profile-info {
    width: 100%;
  }

  .profile-actions {
    width: 100%;
    justify-content: center;
  }

  .settings-section {
    padding: 20px;
  }
}

/* ── Better wallet/balance display ── */
@media (max-width: 720px) {
  .wallet-card,
  .balance-card {
    padding: 20px;
    text-align: center;
  }

  .wallet-amount,
  .balance-amount {
    font-size: 2rem;
  }

  .wallet-actions,
  .balance-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .wallet-actions .btn,
  .balance-actions .btn {
    width: 100%;
  }
}

/* ── Enhanced transaction list ── */
@media (max-width: 720px) {
  .transaction-row {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .transaction-icon {
    margin: 0 auto;
  }

  .transaction-details {
    width: 100%;
    text-align: center;
  }

  .transaction-amount {
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
  }
}

/* ── Better notification display ── */
@media (max-width: 720px) {
  .notification,
  .toast {
    width: calc(100vw - 32px);
    max-width: 400px;
    margin: 16px;
  }

  .notification-content {
    font-size: 0.9rem;
  }
}

/* ── Improved search results ── */
@media (max-width: 720px) {
  .search-result {
    padding: 16px;
  }

  .search-result-title {
    font-size: 1rem;
  }

  .search-result-description {
    font-size: 0.9rem;
  }
}

/* ── Better pagination ── */
@media (max-width: 720px) {
  .pagination {
    gap: 6px;
  }

  .pagination-item {
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
    font-size: 0.9rem;
  }

  .pagination-prev,
  .pagination-next {
    padding: 8px 12px;
  }
}

/* ── Enhanced filter/sort UI ── */
@media (max-width: 720px) {
  .filter-bar,
  .sort-bar {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group,
  .sort-group {
    width: 100%;
  }

  .filter-btn,
  .sort-btn {
    width: 100%;
  }
}

/* ── Better comparison table ── */
@media (max-width: 720px) {
  .comparison-table {
    display: block;
    overflow-x: auto;
  }

  .comparison-header {
    min-width: 600px;
  }

  .comparison-row {
    min-width: 600px;
  }
}

/* ── Improved timeline ── */
@media (max-width: 720px) {
  .timeline {
    padding-left: 20px;
  }

  .timeline-item {
    padding-left: 30px;
  }

  .timeline-marker {
    left: -10px;
    width: 20px;
    height: 20px;
  }

  .timeline-content {
    padding: 14px;
  }
}

/* ── Better progress indicators ── */
@media (max-width: 720px) {
  .progress-steps {
    flex-direction: column;
    gap: 16px;
  }

  .progress-step {
    width: 100%;
    text-align: center;
  }

  .progress-step::after {
    display: none;
  }
}

/* ── Enhanced accordion ── */
@media (max-width: 720px) {
  .accordion-item {
    border-radius: 14px;
  }

  .accordion-header {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .accordion-content {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
}

/* ── Better tabs ── */
@media (max-width: 720px) {
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-list {
    min-width: min-content;
    gap: 8px;
  }

  .tab-item {
    min-width: 100px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* ── Improved dropdown menus ── */
@media (max-width: 720px) {
  .dropdown-menu {
    width: calc(100vw - 32px);
    max-width: 300px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .dropdown-item {
    padding: 12px 16px;
    font-size: 0.95rem;
  }
}

/* ── Better tooltip positioning ── */
@media (max-width: 720px) {
  .tooltip {
    max-width: calc(100vw - 32px);
    font-size: 0.85rem;
  }
}

/* ── Enhanced skeleton loaders ── */
@media (max-width: 720px) {
  .skeleton {
    border-radius: 12px;
  }

  .skeleton-text {
    height: 16px;
  }

  .skeleton-title {
    height: 24px;
  }
}

/* ── Final touch optimizations ── */
@media (hover: none) {
  /* Remove all hover effects on touch devices */
  *:hover {
    transition: none;
  }

  /* Keep only active states */
  .btn:active,
  .card:active,
  a:active {
    opacity: 0.8;
  }
}

/* ── Accessibility improvements ── */
@media (max-width: 720px) {
  /* Larger focus indicators */
  *:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
  }

  /* Better skip link */
  .skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
  }
}
