/* Small form-specific styles for user_login.html. */

.resend-form { margin-top: 10px; }
.secondary-button { background: var(--bg-surface, #070709); color: var(--text-secondary, #a1a1a6); border: 1px solid var(--border-subtle, rgba(255,255,255,0.08)); }

/* Shared phone safeguards. This file is appended to every page stylesheet. */
@media (max-width: 700px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html, body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  img, picture, video, canvas, svg {
    max-width: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important; /* prevents Safari's focus-zoom */
  }

  button, a, input, select, textarea {
    touch-action: manipulation;
  }

  pre, code {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overflow-x-auto, .overflow-x-scroll, [class*="overflow-x-auto"], [class*="overflow-x-scroll"] {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  #modal-overlay > *, [role="dialog"] {
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
  }
}

/* ==========================================================================
   Package B: Apple HIG & Mobile UX Refinement (PRD 1.2 / MOBILE_UX_SKILL)
   ========================================================================== */

/* 1. Touch-First Target Size & Thumb Zone Layout */
button, a, .chip, input, select, [role="button"] {
  min-height: 44px;
}

/* 2. Horizontal Snap Chips for Categories & Filters */
.mobile-chip-bar,
.category-chips,
.am-categories-grid,
.am-category-chips,
.industry-category-list,
.nexus-category-list {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 8px 12px !important;
  scrollbar-width: none !important;
}
.mobile-chip-bar::-webkit-scrollbar,
.category-chips::-webkit-scrollbar,
.am-categories-grid::-webkit-scrollbar,
.am-category-chips::-webkit-scrollbar,
.industry-category-list::-webkit-scrollbar,
.nexus-category-list::-webkit-scrollbar {
  display: none !important;
}
.mobile-chip-bar .chip,
.mobile-chip-bar > *,
.category-chips > *,
.industry-category,
.nexus-category,
.am-category-chip,
.am-category-item {
  scroll-snap-align: start !important;
  flex-shrink: 0 !important;
  padding: 8px 16px !important;
  border-radius: 9999px !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}

/* 3. Mobile Product Grid & Uniform Aspect Ratios (< 640px) */
@media (max-width: 639.98px) {
  .product-grid,
  .catalog-grid,
  .am-products-grid,
  .industry-product-grid,
  .industry-catalog-grid,
  .nexus-product-grid,
  .nexus-catalog-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .product-card,
  .catalog-card,
  .am-product-card,
  .industry-product-card,
  .industry-catalog-card,
  .nexus-product-card,
  .nexus-catalog-card {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  .product-card img,
  .catalog-image img,
  .am-product-img-container img,
  .am-product-card img,
  .industry-product-image img,
  .industry-catalog-image img,
  .nexus-product-image img,
  .nexus-catalog-image img {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
  }

  .product-card .title,
  .catalog-copy h3,
  .catalog-card h3,
  .am-product-title,
  .industry-product-copy h3,
  .industry-catalog-copy h2,
  .nexus-product-copy h3,
  .nexus-catalog-copy h2 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    min-height: 36px !important;
  }
}

/* 4. Floating Action Buttons (FAB) Collision Fix */
@media (max-width: 639.98px) {
  .whatsapp-floating-btn,
  .whatsapp-fab,
  .support-fab,
  .direct-support-fab,
  #whatsapp-floating-btn,
  [data-fab="whatsapp"],
  .floating-contact,
  .am-fab-whatsapp {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 998 !important;
  }

  .ai-assistant-widget,
  .ai-floating-btn,
  .ai-fab,
  #ai-assistant-bubble,
  #ai-chat-fab,
  [data-fab="ai"],
  .floating-ai-btn,
  .am-fab-ai {
    position: fixed !important;
    bottom: 85px !important;
    right: 20px !important;
    z-index: 997 !important;
  }
}

/* 5. Sticky Bottom Purchase Bar (Product Details View) */
.sticky-buy-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 990;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

@media (min-width: 641px) {
  .sticky-buy-bar.mobile-only {
    display: none !important;
  }
}

/* 6. Bottom Sheet Drawer (Cart & Checkout Modal on Screens < 640px) */
@media (max-width: 640px) {
  .modal-dialog,
  .checkout-modal,
  .cart-drawer,
  .bottom-sheet,
  .modal-sheet,
  .industry-modal-card,
  .nexus-modal-card {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    transform: translateY(0) !important;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
