/* ════════════════════════════════════════════════════════
   PluginTheme — Mobile Enhancements + Premium Features
   ════════════════════════════════════════════════════════ */

/* ── Universal touch-friendly sizing on mobile ── */
@media (max-width: 768px) {
  /* All buttons minimum 44x44px touch target (Apple HIG) */
  button, .button, [role="button"],
  input[type="submit"], input[type="button"] {
    min-height: 44px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  /* All inputs 16px font (prevents iOS zoom) */
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="number"], input[type="password"], input[type="search"],
  textarea, select {
    font-size: 16px !important;
  }
  /* Links wrapping prevention */
  a { word-wrap: break-word; overflow-wrap: break-word; }
  /* Tables scrollable on mobile */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Images responsive by default */
  img { max-width: 100%; height: auto; }
  /* Container padding */
  .container { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ════════════════════════════════════════════════════════
   FEATURE 1: Back to Top Button
   ════════════════════════════════════════════════════════ */
.pt-back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9990;
}
.pt-back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.pt-back-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}
@media (max-width: 768px) {
  .pt-back-top {
    bottom: 80px; /* Above mobile cart sticky bar */
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ════════════════════════════════════════════════════════
   FEATURE 2: Reading Progress Bar (top of page)
   ════════════════════════════════════════════════════════ */
.pt-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  z-index: 9999;
  transition: width 0.1s ease-out;
  width: 0;
}

/* ════════════════════════════════════════════════════════
   FEATURE 3: Dark Mode Toggle (smooth)
   ════════════════════════════════════════════════════════ */
.pt-dark-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e293b;
  color: #fbbf24;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
  z-index: 9990;
  transition: all 0.3s;
}
.pt-dark-toggle:hover { transform: scale(1.1); }
@media (max-width: 768px) {
  .pt-dark-toggle {
    width: 40px;
    height: 40px;
    bottom: 80px;
    left: 16px;
    font-size: 1.1rem;
  }
}

/* Dark mode (when body has .pt-dark-mode class) */
body.pt-dark-mode {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
body.pt-dark-mode .pt-why-section,
body.pt-dark-mode .pt-blog-section,
body.pt-dark-mode .pt-faq-section {
  background: #1e293b !important;
}
body.pt-dark-mode .pt-why-card,
body.pt-dark-mode .pt-blog-card,
body.pt-dark-mode .pt-faq-item {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.pt-dark-mode .pt-why-card h4,
body.pt-dark-mode .pt-blog-title,
body.pt-dark-mode .pt-faq-q {
  color: #f1f5f9 !important;
}
body.pt-dark-mode .pt-why-card p,
body.pt-dark-mode .pt-faq-a {
  color: #94a3b8 !important;
}

/* ════════════════════════════════════════════════════════
   FEATURE 4: Smooth Scroll Behavior
   ════════════════════════════════════════════════════════ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ════════════════════════════════════════════════════════
   FEATURE 5: Lazy Image Skeleton Loader
   ════════════════════════════════════════════════════════ */
img[loading="lazy"] {
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: pt-skeleton 1.5s ease-in-out infinite;
}
img[loading="lazy"].loaded { animation: none; background: none; }
@keyframes pt-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════════
   FEATURE 6: Cookie Consent Bar (Premium)
   ════════════════════════════════════════════════════════ */
.pt-cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 18px 24px;
  z-index: 9995;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}
.pt-cookie-consent.show { transform: translateY(0); }
.pt-cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.pt-cookie-text { font-size: 0.92rem; line-height: 1.5; flex: 1; min-width: 280px; }
.pt-cookie-text a { color: #fbbf24; text-decoration: underline; }
.pt-cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.pt-cookie-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: all 0.2s;
}
.pt-cookie-accept { background: #6366f1; color: #fff; }
.pt-cookie-accept:hover { background: #4f46e5; transform: translateY(-1px); }
.pt-cookie-reject { background: rgba(255, 255, 255, 0.1); color: #fff; }
@media (max-width: 560px) {
  .pt-cookie-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .pt-cookie-actions { width: 100%; }
  .pt-cookie-btn { flex: 1; }
}

/* ════════════════════════════════════════════════════════
   FEATURE 7: Loading Skeleton for AJAX
   ════════════════════════════════════════════════════════ */
.pt-skeleton-card {
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: pt-skeleton 1.5s ease-in-out infinite;
  border-radius: 12px;
  height: 200px;
  margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════
   FEATURE 8: Better Mobile Menu (hamburger)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pt-mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    gap: 4px;
  }
  .pt-mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.25s;
  }
  .pt-mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .pt-mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .pt-mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* ════════════════════════════════════════════════════════
   FEATURE 9: Print Styles (clean print version)
   ════════════════════════════════════════════════════════ */
@media print {
  .pt-back-top,
  .pt-dark-toggle,
  .pt-cookie-consent,
  .pt-reading-progress,
  .pt-mobile-menu-toggle,
  .ptcc-steps-bar,
  .pt-cta-section,
  .pt-newsletter-section,
  header, footer, .header, .footer { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: underline !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
}

/* ════════════════════════════════════════════════════════
   FIX: Existing tiny font input
   ════════════════════════════════════════════════════════ */
.pt-faq-row input[type="text"] { font-size: 16px !important; }

/* ════════════════════════════════════════════════════════
   v2.3.0 — Mobile Slider Fixes (Banner Plugin Compatibility)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── 1. Slider counter "4 / 4" — relocate / hide ── */
  .ptbs-counter,
  .pt-slide-counter,
  .ptbs-slide-counter,
  [class*="slide-counter"],
  [class*="banner-counter"] {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 5 !important;
    font-size: .65rem !important;
    padding: 4px 10px !important;
    background: rgba(0,0,0,.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 12px !important;
    color: rgba(255,255,255,.9) !important;
    font-weight: 700 !important;
    pointer-events: none !important;
  }

  /* ── 2. Banner plugin slide layout (any class name) ── */
  .ptbs-slider,
  .ptbs-banner,
  [class*="ptbs"][class*="slider"],
  [class*="banner-slider"] {
    position: relative !important;
    border-radius: 0 0 24px 24px !important;
    overflow: hidden !important;
  }

  /* ── 3. Pagination dots inside slider — bottom centered, NOT overlapping CTA ── */
  .ptbs-dots,
  .ptbs-pagination,
  [class*="ptbs-dot"],
  [class*="banner-dots"],
  [class*="slider-pagination"] {
    position: absolute !important;
    bottom: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 6px !important;
    z-index: 4 !important;
    justify-content: center !important;
    background: rgba(0,0,0,.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 6px 12px !important;
    border-radius: 30px !important;
  }
  .ptbs-dot,
  [class*="ptbs-dot"]:not([class*="dots"]),
  [class*="banner-dot"]:not([class*="dots"]) {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.4) !important;
    border: 0 !important;
    cursor: pointer !important;
    transition: all .25s !important;
    padding: 0 !important;
  }
  .ptbs-dot.active,
  .ptbs-dot.is-active,
  [class*="ptbs-dot"].active {
    background: #fff !important;
    width: 24px !important;
    border-radius: 4px !important;
  }

  /* ── 4. Prev/Next arrows — vertical center, NOT below CTA ── */
  .ptbs-arrow,
  .ptbs-prev,
  .ptbs-next,
  [class*="ptbs-arrow"],
  [class*="banner-prev"],
  [class*="banner-next"],
  [class*="slider-arrow"]:not(.pt-slider-arrow) {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 4 !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    padding: 0 !important;
    transition: background .2s !important;
  }
  .ptbs-prev,
  [class*="banner-prev"],
  [class*="-prev"]:not([class*="prevent"]) {
    left: 12px !important;
    right: auto !important;
  }
  .ptbs-next,
  [class*="banner-next"],
  [class*="-next"]:not([class*="next-step"]) {
    right: 12px !important;
    left: auto !important;
  }
  .ptbs-arrow:active,
  [class*="ptbs-arrow"]:active {
    background: rgba(0,0,0,.7) !important;
    transform: translateY(-50%) scale(.92) !important;
  }

  /* ── 5. Slide content padding — bottom space for dots ── */
  .ptbs-slide,
  [class*="ptbs-slide"]:not([class*="slider"]):not([class*="counter"]) {
    padding-bottom: 60px !important;
    min-height: 360px !important;
    box-sizing: border-box !important;
  }

  /* ── 6. CTA button inside slide — full width, prominent ── */
  .ptbs-cta,
  .ptbs-button,
  [class*="ptbs-cta"],
  [class*="banner-cta"],
  [class*="banner-btn"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    font-size: .92rem !important;
    text-decoration: none !important;
    margin-top: 12px !important;
    margin-bottom: 36px !important;  /* leave space for dots */
    box-shadow: 0 8px 20px rgba(168,85,247,.35) !important;
  }

  /* ── 7. Slide title responsive ── */
  .ptbs-title,
  [class*="ptbs-title"]:not([class*="banner-titles"]) {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }
  .ptbs-subtitle,
  .ptbs-desc,
  [class*="ptbs-desc"] {
    font-size: .92rem !important;
    line-height: 1.5 !important;
    color: rgba(255,255,255,.75) !important;
  }
}

/* ── Tiny phones (≤ 380px) ── */
@media (max-width: 380px) {
  .ptbs-arrow,
  [class*="ptbs-arrow"] {
    width: 36px !important;
    height: 36px !important;
  }
  .ptbs-prev, [class*="banner-prev"] { left: 8px !important; }
  .ptbs-next, [class*="banner-next"] { right: 8px !important; }
  .ptbs-dots, [class*="banner-dots"] { padding: 5px 10px !important; }
  .ptbs-title, [class*="ptbs-title"] { font-size: 1.3rem !important; }
}
