/* ═══════════════════════════════════════════════════════════════
   RESONANCE THREADS — rt-responsive.css
   Consolidated responsive stylesheet v1.0
   Replaces: mobile-*.css (8 files) + responsive-framework.css

   Breakpoints:
     Mobile:  max-width 767px
     Tablet:  768px – 1023px
     Desktop: 1024px+
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   SKIP TO CONTENT (Accessibility)
───────────────────────────────────────────────────────────── */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--rt-pink);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* ─────────────────────────────────────────────────────────────
   FOCUS VISIBLE (Accessibility)
───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--rt-pink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────
   DESKTOP (1024px+)
───────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .section-header-row,
  .products-grid,
  .rm-grid,
  .rm-tabs,
  .bulk-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    padding: 48px 60px 36px;
    flex-direction: row;
  }

  .store-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-search-wrap {
    display: flex;
    max-width: 400px;
  }

  .footer-links-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .footer-top {
    grid-template-columns: 260px 1fr;
  }

  /* Consistent section vertical spacing */
  .rt-section,
  .products,
  .designs-section,
  .bulk-section,
  .readymades-section {
    padding-top: 8px;
    padding-bottom: 40px;
  }

  /* Section header consistent spacing */
  .section-header-row {
    padding-top: 28px;
    padding-bottom: 12px;
  }
}

/* ─────────────────────────────────────────────────────────────
   TABLET (768px – 1023px)
───────────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .section-header-row,
  .products-grid,
  .rm-grid,
  .rm-tabs,
  .bulk-section {
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Slider wrappers on tablet */
  .slider-wrapper,
  .rt-slider-outer,
  .readymades-slider-wrap {
    padding-left: 0;
    padding-right: 0;
  }

  /* Slider tracks — arrows are now flex siblings, minimal padding needed */
  .product-slider,
  .showcase-slider,
  .rt-slider-wrap,
  .readymades-slider {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    padding: 32px 32px 24px;
    flex-direction: row;
    gap: 16px;
  }

  .brand-name {
    font-size: clamp(48px, 7vw, 80px);
  }

  .store-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .nav-search-wrap {
    max-width: 200px;
  }

  .footer-top {
    grid-template-columns: 200px 1fr;
    gap: 32px;
    padding: 40px 32px 32px;
  }

  .footer-links-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .footer-newsletter {
    padding: 24px 32px;
  }

  .footer-bottom {
    padding: 16px 32px;
  }

  /* Cart */
  .cart-layout {
    grid-template-columns: 1fr 300px;
    gap: 24px;
  }

  /* Checkout */
  .checkout-layout {
    grid-template-columns: 1fr 300px;
    gap: 24px;
  }

  /* Dashboard KPI */
  .db-kpi-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Profile */
  .profile-layout {
    grid-template-columns: 240px 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────
   MOBILE (max-width 767px)
───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* ── Navbar ── */
  .navbar {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .nav-search-wrap {
    display: none;
  }

  .nav-search-wrap.mobile-open {
    display: flex;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.97);
    border-bottom: 1px solid rgba(255, 78, 205, 0.2);
    z-index: 499;
    max-width: 100%;
  }

  .nav-profile-name {
    display: none;
  }

  .nav-profile-role {
    display: none;
  }

  .nav-icon-pill {
    padding: 0 8px;
    height: 36px;
    min-width: 36px;
    font-size: 11px;
    justify-content: center;
  }

  .nav-theme-toggle {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .nav-theme-toggle .theme-label {
    display: none;
  }

  /* Profile menu — JS handles all positioning via rtToggleProfile() */
  .nav-profile-menu {
    /* controlled by JS + .npm2-open class */
  }

  /* Notification panel — JS handles all positioning via rtToggleNotif() */
  .nav-notif-panel {
    /* controlled by JS + .npm2-open class */
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* ── Hero ── */
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 24px 14px;
    gap: 16px;
  }

  .start-design-wrapper {
    justify-content: center;
    padding: 8px 0;
  }

  .brand-name {
    font-size: clamp(44px, 12vw, 72px);
  }

  /* ── Section padding ── */
  .section-header-row {
    padding: 16px 12px 8px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .rm-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .rm-tabs {
    padding: 0 12px;
  }

  .bulk-section {
    padding: 24px 12px;
  }

  /* ── Store grid ── */
  .store-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  /* ── Store product card consistency (all pages) ── */
  .store-grid .rt-product-flip,
  .store-grid .store-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .store-grid .rt-pf-img-wrap {
    aspect-ratio: 3 / 4;
  }

  .store-grid .rt-pf-info {
    padding: 8px 10px 10px;
  }

  .store-grid .rt-pf-name {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .store-grid .rt-pf-price {
    font-size: 14px;
  }

  .store-grid .rt-pf-mrp {
    font-size: 10px;
  }

  .store-grid .rt-pf-off {
    font-size: 9px;
  }

  .store-grid .rt-pf-cat {
    font-size: 9px;
    margin-bottom: 2px;
  }

  .store-grid .rt-pf-badge {
    font-size: 9px;
    padding: 3px 7px;
    top: 6px;
    left: 6px;
  }

  /* Standardize card height across pages */
  .store-grid .rt-pf-front {
    display: flex;
    flex-direction: column;
  }

  .store-grid .rt-pf-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 72px;
  }

  .store-grid .rt-pf-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 28px;
  }

  .store-grid .store-card-img {
    aspect-ratio: 3 / 4;
  }

  .store-grid .store-card-name {
    font-size: 12px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 28px;
  }

  .store-grid .store-card-price {
    font-size: 14px;
  }

  /* Store layout padding on mobile */
  .store-layout {
    padding: 16px 0 0;
  }

  /* ── Cart ── */
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  /* ── Checkout ── */
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .order-summary-box {
    position: static;
  }

  /* ── Dashboard KPI ── */
  .db-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* ── Footer ── */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 16px 20px;
  }

  .footer-links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .footer-newsletter {
    padding: 16px;
  }

  .footer-newsletter-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-newsletter-form {
    flex-direction: column;
    width: 100%;
  }

  .footer-newsletter-input {
    width: 100%;
  }

  .footer-newsletter-btn {
    width: 100%;
  }

  .footer-bottom {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-bottom-links {
    gap: 10px;
  }

  .footer-bottom-links a {
    font-size: 11px;
  }

  /* ── Slider arrows — managed by rs-slider.css ── */

  /* ── Cards ── */
  /* Showcase slide sizing managed by rs-slider.css responsive rules */

  /* ── Profile layout ── */
  .profile-layout {
    grid-template-columns: 1fr;
  }

  /* ── Modals ── */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-box {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    width: 100%;
    max-width: 100%;
  }

  /* ── Chatbot ── */
  .chatbot-window {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    height: 75vh;
    max-height: 75vh;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  }

  .chatbot-fab {
    width: 52px;
    height: 52px;
    font-size: 20px;
    z-index: 9050;
  }

  .chatbot-modes {
    padding: 6px 10px;
  }

  .chat-mode-btn {
    padding: 5px 8px;
    font-size: 10px;
  }

  .chatbot-messages {
    padding: 12px;
  }

  .chat-msg {
    max-width: 88%;
    font-size: 13px;
  }

  .chat-suggestions {
    padding: 6px 10px;
  }

  .chatbot-input-row {
    padding: 8px 10px;
  }

  /* ── Scroll to top ── */
  .scroll-top-btn {
    bottom: 80px;
    right: 16px;
  }

  /* ── Tables ── */
  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 10px;
  }

  /* ── Offer zone ── */
  .ozn-card {
    grid-template-columns: 1fr;
    border-radius: 14px;
    margin-bottom: 12px;
  }

  .ozn-card:first-child,
  .ozn-card:last-child {
    border-radius: 14px;
  }

  .ozn-grid {
    gap: 12px;
  }
}

/* ─────────────────────────────────────────────────────────────
   TOUCH TARGETS (min 44x44px on mobile)
───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  button,
  a,
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="checkbox"],
  input[type="radio"],
  select,
  .nav-icon-pill,
  .filter-chip,
  .rm-tab-btn,
  .db-tab,
  .vault-btn,
  .sc-btn,
  .mini-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Exceptions for inline/icon-only elements and panel buttons */
  .nav-badge,
  .nav-icon-pill,
  .nav-theme-toggle,
  .nav-profile-trigger,
  .status-badge,
  .footer-badge,
  .footer-theme-btn,
  .footer-install-btn,
  .footer-refer-btn,
  .arrow,
  .rt-arrow,
  .rm-arrow,
  .vp-btn,
  .vp-btn--primary,
  .vp-btn--community,
  .vp-btn--vault,
  .vp-btn--edit,
  .vp-btn--danger,
  .vp-btn--preview,
  .vp-btn--save-meta,
  .vp-close,
  .rtdc-btn,
  .rtdc-toggle,
  .rtdc-back-close,
  .rtdc-flip-hint {
    min-height: unset;
    min-width: unset;
  }
}

/* ─────────────────────────────────────────────────────────────
   iOS FIXES
───────────────────────────────────────────────────────────── */

/* Prevent iOS input zoom */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Momentum scrolling on scroll containers */
.showcase-slider,
.product-slider,
.rm-tabs,
.store-filter-bar,
.db-tabs,
.nav-search-dropdown,
.nav-profile-menu,
.nav-notif-panel {
  -webkit-overflow-scrolling: touch;
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .navbar {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  .site-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .chatbot-fab {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .cookie-banner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  @media (max-width: 767px) {
    .nav-profile-menu,
    .nav-notif-panel,
    .modal-box,
    .chatbot-window {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* ─────────────────────────────────────────────────────────────
   PERFORMANCE
───────────────────────────────────────────────────────────── */

/* Only apply will-change to actively animated elements */
.rt-blob {
  will-change: transform;
}

.showcase-slide,
.product-card,
.store-card,
.vault-card {
  will-change: transform;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .rt-blob {
    animation: none;
    will-change: auto;
  }

  #rtBgCanvas {
    display: none;
  }

  .showcase-slide,
  .product-card,
  .store-card,
  .vault-card {
    will-change: auto;
  }
}

/* ─────────────────────────────────────────────────────────────
   EXTRA SMALL (max-width 400px)
───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .footer-links-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-links {
    gap: 8px;
  }

  .hero {
    padding: 20px 10px;
  }

  .brand-name {
    font-size: 40px;
  }

  .navbar {
    padding: 0 8px;
    gap: 6px;
  }
}

/* ─────────────────────────────────────────────────────────────
   GLOBAL TEXT ALIGNMENT & SPACING FIXES
   Applied at all breakpoints
───────────────────────────────────────────────────────────── */

/* Prevent text overflow on all cards */
.product-card-name,
.rt-product-name,
.rm-card-name,
.store-card-name,
.vault-card-name,
.design-card-name,
.ozn-card-name,
.db-card-title,
.db-design-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Consistent card info padding */
.product-card-info,
.rt-info,
.rm-card-body,
.store-card-info,
.ozn-card-info {
  padding: 10px 12px 12px;
  box-sizing: border-box;
}

/* Card action buttons — always same height */
.product-card-actions,
.rt-actions,
.store-card-actions,
.vault-actions {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.product-card-actions .pc-btn,
.rt-actions .rt-btn,
.store-card-actions .sc-btn {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section titles — consistent gradient text */
.category-title,
.section-title,
.readymades-title,
.vault-title,
.cart-title,
.ozn-title,
.ccs-title {
  line-height: 1.1;
  letter-spacing: 2px;
}

/* Page content max-width containment */
.store-layout,
.cart-page,
.orders-page,
.vault-page,
.profile-layout,
.checkout-layout,
.db-wrap,
.inner-page {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Consistent page horizontal padding */
@media (min-width: 1024px) {
  .store-layout,
  .cart-page,
  .orders-page,
  .vault-page,
  .db-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .store-layout,
  .cart-page,
  .orders-page,
  .vault-page,
  .db-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 767px) {
  .store-layout,
  .cart-page,
  .orders-page,
  .vault-page,
  .db-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ─────────────────────────────────────────────────────────────
   PERFORMANCE — content-visibility for off-screen sections
───────────────────────────────────────────────────────────── */
@supports (content-visibility: auto) {
  .offer-zone-new,
  .community-cta-section,
  .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
  }
}

/* ─────────────────────────────────────────────────────────────
   PRINT STYLES — hide non-essential elements
───────────────────────────────────────────────────────────── */
@media print {
  .navbar,
  .site-footer,
  .chatbot-fab,
  .scroll-top-btn,
  .rt-blobs,
  #rtBgCanvas,
  .cookie-banner {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }
}
