/* =====================================================================
   Nooru's Happy Palette - mobile & tablet refinements
   ---------------------------------------------------------------------
   Every rule in this file lives inside a max-width media query, so the
   desktop design (>1024px) is untouched by construction.
   Breakpoints: 1024 tablet - 767 large phone - 600 phone - 430 small
   ===================================================================== */

/* ------------------------------ TABLET & BELOW ---------------------- */
@media (max-width: 1024px) {

  /* --- overflow guard: nothing may exceed the viewport --- */
  html, body { max-width: 100%; overflow-x: hidden; }
  body .e-con, body .e-con-inner { max-width: 100%; }
  body img, body video, body svg { max-width: 100%; height: auto; }

  /* --- fluid type --- */
  .elementor-widget-heading h1.elementor-heading-title { font-size: clamp(30px, 7.4vw, 52px); line-height: 1.06; }
  .elementor-widget-heading h2.elementor-heading-title { font-size: clamp(24px, 5.2vw, 38px); line-height: 1.12; }
  .elementor-widget-heading h3.elementor-heading-title { font-size: clamp(18px, 3.2vw, 22px); line-height: 1.22; }
  .elementor-widget-text-editor { font-size: clamp(14.5px, 2.2vw, 16.5px); line-height: 1.65; }
  h1, h2, h3, p { overflow-wrap: anywhere; }

  /* --- comfortable, tappable controls --- */
  .elementor-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  a, button, input, select, textarea { touch-action: manipulation; }

  /* --- sticky header + hamburger --- */
  #nhp-header, .np-header {
    position: sticky; top: 0; z-index: 200;
    background: #FFF8F1;
    box-shadow: 0 2px 14px rgba(63, 51, 82, .08);
  }
  #nhp-header > .e-con-inner, .np-headin { position: relative; }

  .nhp-burger {
    order: 3; margin-left: auto;
    width: 48px; height: 48px; flex: 0 0 48px;
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 5px;
    background: #3F3352; border: 0; border-radius: 14px;
    cursor: pointer; padding: 0;
  }
  .nhp-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #FFF8F1; transition: transform .25s ease, opacity .2s ease; }
  .nhp-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nhp-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nhp-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nhp-burger:focus-visible { outline: 3px solid #E86FA6; outline-offset: 3px; }

  /* the nav becomes a panel that slides open under the bar */
  body.nhp-has-burger #nhp-nav,
  body.nhp-has-burger .np-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    width: 100% !important; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 2px;
    background: #FFF8F1;
    border-top: 2px solid #FFE3EF;
    box-shadow: 0 16px 26px rgba(63, 51, 82, .12);
    padding: 8px 16px 16px;
    display: grid; grid-template-rows: 0fr;
    opacity: 0; visibility: hidden;
    transition: grid-template-rows .28s ease, opacity .2s ease, visibility .28s;
  }
  body.nhp-has-burger #nhp-nav > *,
  body.nhp-has-burger .np-nav > * { min-height: 0; }
  body.nhp-nav-open #nhp-nav,
  body.nhp-nav-open .np-nav { grid-template-rows: 1fr; opacity: 1; visibility: visible; }

  body.nhp-has-burger #nhp-nav .elementor-widget-button,
  body.nhp-has-burger .np-nav .elementor-widget-button { width: 100%; }
  body.nhp-has-burger #nhp-nav .elementor-button,
  body.nhp-has-burger .np-nav .np-navbtn .elementor-button,
  body.nhp-has-burger .np-nav .elementor-button {
    width: 100%; justify-content: flex-start;
    min-height: 48px; padding: 12px 14px; border-radius: 14px; font-size: 16px;
  }

  /* logo + cart stay on the bar */
  #nhp-header .elementor-widget-image { order: 1; }
  #nhp-header > .e-con-inner > .elementor-widget-button { order: 2; margin-left: auto; }

  /* --- hero --- */
  #nhp-hero { padding-top: 44px !important; }
  #nhp-hero .elementor-widget-image img { width: min(100%, 460px); margin-inline: auto; }

  /* --- sections: tighter, even rhythm --- */
  .e-con.e-con-boxed > .e-con-inner { padding-inline: clamp(16px, 4vw, 26px); }

  /* --- forms --- */
  .nhp-sub { flex-direction: row; flex-wrap: wrap; }
  .nhp-sub__input { flex: 1 1 100%; min-height: 48px; font-size: 16px; }
  .nhp-sub__btn { flex: 1 1 100%; min-height: 48px; }
  .np-cform input, .np-cform textarea { font-size: 16px; min-height: 48px; }

  /* --- decorative layers must never create scroll --- */
  .nhp-deco, .np-deco { overflow: hidden; }
  .nhp-strip, .np-strip { overflow: hidden; }
}

/* ------------------------------ LARGE PHONE ------------------------- */
@media (max-width: 767px) {

  /* hero: balanced stack */
  #nhp-hero { padding-top: 34px !important; }
  #nhp-hero .e-con.e-grid { gap: 26px; }
  #nhp-hero .elementor-widget-image img { width: min(88vw, 380px); }

  /* hero chips sit neatly instead of hanging off the image */
  #nhp-hero .elementor-widget-button.elementor-widget-button { }

  /* buttons stack full width where they are the primary action */
  #nhp-hero .e-con.e-flex > .elementor-widget-button { flex: 1 1 100%; }
  #nhp-hero .e-con.e-flex > .elementor-widget-button .elementor-button { width: 100%; }

  /* cards: single column, even spacing */
  .e-con.e-grid { row-gap: 18px; }

  /* marquee text scales down */
  .nhp-ticker__track, .np-bar .np-track { font-size: 11px; gap: 28px; }
  .nhp-strip__track, .np-strip .np-track { font-size: 16px; gap: 20px; }
  .nhp-strip__tilt, .np-strip .np-tilt { padding: 10px 0; }

  /* scalloped edges scale with the page */
  .nhp-scallop { height: 24px; background-size: 24px 24px; }
  .nhp-clouds { height: 38px; background-size: 106px 38px, 54px 38px, 32px 38px; }

  /* footer stacks cleanly */
  .np-fgrid, .np-fbot { text-align: left; }
  .np-fbot { flex-direction: column; gap: 6px; }

  /* trim decorative stickers that crowd small screens */
  .nhp-deco__i--cloud { display: none; }
}

/* ------------------------------ PHONE ------------------------------- */
@media (max-width: 600px) {

  /* one column for every card grid */
  .e-con.e-grid { grid-template-columns: 1fr !important; }

  /* except the gallery-style tiles, which read better two-up */
  #nhp-gram.e-con.e-grid, #nhp-fgrid.e-con.e-grid { grid-template-columns: repeat(2, 1fr) !important; }

  .elementor-widget-heading h1.elementor-heading-title { font-size: clamp(28px, 8.4vw, 40px); }
  .elementor-widget-heading h2.elementor-heading-title { font-size: clamp(22px, 6.8vw, 30px); }

  /* even vertical rhythm between sections */
  .e-con.e-con-boxed > .e-con-inner { padding-block: clamp(34px, 9vw, 52px); }

  /* product + category cards: consistent padding and radius */
  .e-con.e-grid > .e-con { border-radius: 24px; }
}

/* ------------------------------ SMALL PHONE ------------------------- */
@media (max-width: 430px) {
  .elementor-button { font-size: 15px; padding-inline: 20px; }
  .nhp-ticker__track, .np-bar .np-track { font-size: 10px; letter-spacing: .12em; gap: 22px; }
  .nhp-strip__track, .np-strip .np-track { font-size: 14px; }
  #nhp-hero .elementor-widget-image img { width: min(84vw, 320px); }
  .nhp-deco__i { transform: scale(.82); }
}

/* ------------------------------ 320px ------------------------------- */
@media (max-width: 360px) {
  .elementor-widget-heading h1.elementor-heading-title { font-size: 28px; }
  .elementor-button { padding-inline: 16px; font-size: 14.5px; }
  .e-con.e-con-boxed > .e-con-inner { padding-inline: 14px; }
  .nhp-sub__input, .nhp-sub__btn { min-height: 46px; }
}

/* --------------------------- MOTION SAFETY -------------------------- */
@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .nhp-deco__i, .nhp-ticker__track, .nhp-strip__track,
  .np-bar .np-track, .np-strip .np-track { animation: none !important; }
  body.nhp-has-burger #nhp-nav, body.nhp-has-burger .np-nav { transition: none; }
}
