/* ============================================================
   RESINFY — Mobile Patch
   mobile-patch.css — Applied to all pages for full mobile support
   ============================================================ */

/* ── Global base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Restore native mouse cursor (overrides cursor:none in style.css) ── */
*, *::before, *::after { cursor: auto; }
a, button, [role="button"], select,
input[type="submit"], input[type="button"],
label[for], .btn-primary, .btn-ghost,
.pp-cat-btn, .pp-price-apply, .pp-sidebar-reset,
.filter-btn, .hamburger, .cart-close,
.auth-close, .product-wishlist, .pp-filter-toggle {
  cursor: pointer !important;
}
input, textarea { cursor: text !important; }

/* Hide the custom cursor divs — we use the real one now */
#cursor, #cursorFollower { display: none !important; }

/* Hide custom cursor on touch devices too */
@media (hover: none) and (pointer: coarse) {
  #cursor, #cursorFollower { display: none !important; }
}

/* ── Navbar ──────────────────────────────────────────────── */
.nav {
  padding: 0 18px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .nav { padding: 0 16px; height: 56px; }
  .nav-links { display: none; }
  .nav-right { display: none; }
  .hamburger { display: flex; }
  .logo { font-size: 1.1rem !important; }
  .logo-img { height: 32px !important; }
}

/* Mobile menu — only on small screens */
@media (max-width: 768px) {
  .mobile-menu {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--brown, #2c1f0f);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 80px 32px 40px;
    overflow-y: auto;
  }

  .mobile-menu.open {
    transform: translateX(0);
  }

  .mobile-menu ul {
    list-style: none;
    padding: 0; margin: 0;
    text-align: center;
    width: 100%;
  }

  .mobile-menu ul li { margin-bottom: 8px; }

  .mobile-link {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 8vw, 2.5rem);
    font-weight: 500;
    color: var(--bg, #f4ede0);
    text-decoration: none;
    padding: 12px 0;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    border-bottom: 1px solid rgba(201,169,110,0.1);
  }
  .mobile-link:last-child { border-bottom: none; }
  .mobile-link:active { color: var(--accent-2, #c9a96e); }

  .mobile-auth-link {
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2, #c9a96e) !important;
    padding-top: 20px !important;
    margin-top: 8px;
    font-weight: 300;
  }
}

/* ── Hero Section ────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    min-height: 100svh;
    padding: 80px 24px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-title {
    font-size: clamp(3rem, 14vw, 5rem) !important;
    line-height: 1.05 !important;
  }

  .hero-eyebrow {
    font-size: 0.72rem !important;
    letter-spacing: 0.2em;
  }

  .hero-subtitle {
    font-size: 0.92rem !important;
    max-width: 100%;
    line-height: 1.8;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
    max-width: 280px;
    text-align: center;
    padding: 14px 20px !important;
  }

  .hero-float-badge { display: none; }
  .hero-scroll-hint { display: none; }
}

/* ── About section ───────────────────────────────────────── */
@media (max-width: 768px) {
  .about { padding: 60px 24px !important; }

  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  .about-visual {
    min-height: 260px;
    order: -1;
  }

  .about-stat-card {
    font-size: 0.8rem !important;
  }

  .about-features {
    flex-wrap: wrap;
    gap: 8px;
  }

  .feature-pill {
    font-size: 0.72rem !important;
    padding: 6px 14px !important;
  }

  .about-text .btn-primary,
  .about-text .btn-ghost {
    display: block;
    width: 100%;
    max-width: 280px;
    text-align: center;
    margin: 8px 0 !important;
  }
}

/* ── Products grid ───────────────────────────────────────── */
@media (max-width: 768px) {
  .products { padding: 60px 16px !important; }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .product-card { border-radius: 6px; }

  .product-img-wrap { height: 160px !important; }

  .product-name { font-size: 0.82rem !important; }
  .product-desc { display: none; }
  .product-cat { font-size: 0.6rem !important; }
  .product-price { font-size: 0.88rem !important; }
  .product-mrp { font-size: 0.68rem !important; }
  .product-off { font-size: 0.6rem !important; }

  .product-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .btn-add-cart {
    width: 100%;
    padding: 10px 8px !important;
    font-size: 0.7rem !important;
  }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr !important; }
}

/* ── Filter bar ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .filter-bar {
    gap: 8px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn {
    flex-shrink: 0;
    font-size: 0.72rem !important;
    padding: 7px 14px !important;
    white-space: nowrap;
  }
}

/* ── Process / Steps section ─────────────────────────────── */
@media (max-width: 768px) {
  .process { padding: 60px 24px !important; }

  .process-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
}

/* ── Testimonials ────────────────────────────────────────── */
@media (max-width: 768px) {
  .testimonials { padding: 60px 20px !important; }
  .testimonials-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Section headings ────────────────────────────────────── */
@media (max-width: 768px) {
  .section-title {
    font-size: clamp(1.8rem, 7vw, 2.8rem) !important;
    line-height: 1.2 !important;
  }
  .section-label { font-size: 0.62rem !important; letter-spacing: 0.2em; }
}

/* ── Marquee ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .marquee-strip { font-size: 0.7rem; padding: 10px 0; }
}

/* ── Footer ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer { padding: 50px 24px 30px !important; }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* ── Cart Sidebar ────────────────────────────────────────── */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    bottom: 0; top: auto !important;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%) !important;
  }

  .cart-sidebar.open {
    transform: translateY(0) !important;
  }
}

/* ── Cart FAB ────────────────────────────────────────────── */
@media (max-width: 768px) {
  #cartFab {
    bottom: 20px;
    right: 20px;
    width: 52px !important;
    height: 52px !important;
    font-size: 1.1rem !important;
  }
}

/* ── Payment Modal ───────────────────────────────────────── */
@media (max-width: 768px) {
  .payment-modal {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto;
  }
}

/* ── Auth modal ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-modal {
    width: 100% !important;
    max-width: 100% !important;
    bottom: 0; top: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 28px 20px 36px !important;
    max-height: 92vh;
  }
}

/* ── Products Page (products.html) ───────────────────────── */
@media (max-width: 768px) {
  .pp-main { padding-top: 56px; }

  .pp-hero { padding: 50px 20px 36px; }

  .pp-controls-inner {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .pp-search-wrap { min-width: 0; flex: 1; }
  .pp-count { display: none; }

  .pp-layout { grid-template-columns: 1fr !important; }

  .pp-sidebar {
    position: fixed;
    top: 0; left: -100%;
    width: min(300px, 85vw);
    height: 100vh;
    z-index: 500;
    overflow-y: auto;
    transition: left 0.4s cubic-bezier(0.77,0,0.175,1);
    padding-top: 64px;
    box-shadow: 4px 0 30px rgba(44,31,15,0.15);
  }
  .pp-sidebar.open { left: 0; }

  .pp-filter-toggle { display: inline-flex; align-items: center; gap: 8px; }

  .pp-grid-wrap { padding: 16px 14px; }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* ── About Page ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .ab-hero { padding: 100px 24px 60px !important; min-height: 70vh; }
  .ab-hero-title { font-size: clamp(2.5rem, 11vw, 4rem) !important; }

  .ab-story-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  .ab-tl-track {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .ab-tl-item { flex-direction: column !important; text-align: left !important; }

  .ab-phil-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .ab-values-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  .ab-stats-row {
    flex-direction: column;
    gap: 20px !important;
  }
}

/* ── Contact Page ────────────────────────────────────────── */
@media (max-width: 768px) {
  .cp-hero { padding: 100px 24px 60px !important; }
  .cp-hero-title { font-size: clamp(2rem, 9vw, 3.5rem) !important; }

  .cp-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  .cp-budget-pills { flex-wrap: wrap; gap: 8px; }
  .cp-budget-pill { font-size: 0.75rem !important; padding: 7px 14px !important; }

  .cp-info-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Product Detail Page ─────────────────────────────────── */
@media (max-width: 768px) {
  .pd-layout {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .pd-gallery { min-height: 280px !important; }

  .pd-title { font-size: clamp(1.6rem, 7vw, 2.5rem) !important; }

  .pd-actions { flex-direction: column; gap: 10px; }
  .pd-actions .btn-primary,
  .pd-actions .btn-ghost { width: 100% !important; text-align: center; }

  .pd-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .pd-tab { flex-shrink: 0; }
}

/* ── Admin panel ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
  }
}

/* ── Buttons — touch-friendly ────────────────────────────── */
@media (max-width: 768px) {
  .btn-primary, .btn-ghost, button {
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* ── Typography scale ────────────────────────────────────── */
@media (max-width: 480px) {
  body { font-size: 15px; }
}

/* ── Prevent horizontal overflow everywhere ──────────────── */
section, .hero, .about, .products, .process, .footer, header, main {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── View all bar ────────────────────────────────────────── */
@media (max-width: 768px) {
  .products-view-all-bar {
    flex-direction: column !important;
    gap: 16px !important;
    text-align: center;
    padding: 24px 20px !important;
  }
  .products-view-all-bar .btn-primary {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }
}

/* ── Safe area (notch support) ───────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-menu,
  .cart-sidebar,
  .auth-modal,
  .payment-modal {
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
  }
}
