/* ==========================================================
   Happy Bells — Dedicated Mobile & Handheld Stylesheet
   Tailored responsive UI, touch-friendly navigation dock,
   and optimized card layouts for Samsung S25 Ultra, iPhone, and Tablets.
   ========================================================== */

/* Hide Mobile Bottom Nav on Desktop by default */
.mobile-bottom-nav {
  display: none;
}

/* ==========================================================
   HANDHELD & TABLET RESPONSIVE ENGINE (max-width: 768px)
   ========================================================== */
@media (max-width: 768px) {

  /* 1. Mobile Container & Typography Scaling */
  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 10px 0;
  }

  .header-welcome {
    display: none; /* Hide middle welcome pill on smaller mobile headers */
  }

  .brand-text {
    font-size: 1.2rem;
  }

  .logo-img {
    width: 38px;
    height: 38px;
  }

  .owner-info {
    display: none; /* Hide text, show avatar on mobile header */
  }








  .hb-wave-vertical {
    width: 650px;
    height: 550px;
    filter: blur(28px);
  }






  .hb-blob {
    filter: blur(20px);
  }

  .hb-blob.-one {
    width: 550px;
    height: 480px;
    top: -10%;
    left: -20%;
  }

  .hb-blob.-two {
    width: 600px;
    height: 520px;
    bottom: -10%;
    right: -15%;
  }

  .hb-blob.-three {
    width: 450px;
    height: 400px;
  }

  .hb-horizontal-waves {
    height: 65px;
    min-height: 50px;
    max-height: 80px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }



  .hb-search-wrapper {
    max-width: 100%;
    margin-bottom: 16px;
  }
  .hb-search-input-wrap {
    height: 42px;
  }


  .hero-section {
    padding-top: 100px;
    padding-bottom: 30px;
    min-height: auto;
  }


  .hero-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 24px;
  }

  .hero-cover-static {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
  }


  .hero-title {
    font-size: 2.1rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  /* 2. Photo Frame Cover (Client Photo reveal) */






  /* 3. Horizontal Touch Scrollable Category Tabs */
  .category-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 8px;
    margin-bottom: 24px;
  }

  .category-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .category-tabs {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 10px;
    justify-content: flex-start;
    padding: 4px;
  }

  .category-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  /* 4. 2-per-Row Compact Product Grid (Mobile Only) */
  .product-feed-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .product-feed-grid .product-card {
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
  }

  .product-feed-grid .product-img-viewport {
    height: 235px !important; /* Expanded height to fill card gap & maximize image visibility */
    position: relative !important;
    overflow: hidden !important;
    border-radius: 20px 20px 0 0 !important;
  }

  .product-feed-grid .product-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    image-rendering: -webkit-optimize-contrast !important;
  }

  .product-feed-grid .product-card-body {
    padding: 8px 10px 10px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex-grow: 1 !important;
    justify-content: space-between !important;
  }

  .product-feed-grid .product-title {
    font-size: 0.90rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 2.5em !important; /* Fixed 2-line title height for perfect row alignment */
    margin: 0 !important;
  }

  .product-feed-grid .product-price-badge {
    top: 8px !important;
    left: 8px !important;
    padding: 3px 10px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    color: #3E2C41 !important;
    background: rgba(255, 245, 248, 0.48) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 4px 12px rgba(62, 44, 65, 0.08) !important;
    border-radius: 16px !important;
    max-width: 85% !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
  }

  .product-feed-grid .product-card-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    margin-top: 4px !important;
  }

  .product-feed-grid .btn-open-preview {
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    color: #3E2C41 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
  }

  .product-feed-grid .product-inquire-btn {
    height: 30px !important;
    padding: 0 12px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  /* 5. Mobile Video Viewport Scaling (T7.mp4 & TNPL_Magazine.mp4) */
  .video-viewport {
    max-height: 270px !important; /* Subtle, compact video player height on mobile */
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.95);
  }

  .center-play-btn {
    width: 48px;
    height: 48px;
  }

  .center-play-btn svg {
    width: 20px;
    height: 20px;
  }

  .video-control-bar {
    bottom: 6px;
    left: 6px;
    right: 6px;
    padding: 3px 6px;
  }

  .vid-btn {
    width: 22px;
    height: 22px;
  }

  /* 6. Stories & Testimonials Layout */
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .testimonials-feed-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .testimonial-img-wrap {
    height: 210px !important; /* Keep review screenshot cards subtle and compact on mobile */
  }

  .testimonial-img {
    image-rendering: -webkit-optimize-contrast;
  }

  .story-video-caption {
    font-size: 1.1rem;
  }

  /* 7. Floating Gift Box Search Position Adjustments */
  .floating-gift-search {
    right: 16px;
    bottom: 84px; /* Float cleanly above mobile bottom nav dock */
  }

  .gift-search-btn {
    padding: 4px 4px 4px 12px;
    height: auto;
    width: auto;
  }

  .gift-search-label {
    font-size: 0.78rem;
  }

  .gift-icon-wrap {
    width: 36px;
    height: 36px;
  }

  .gift-box-icon {
    width: 20px;
    height: 20px;
  }

  .gift-search-panel {
    width: calc(100vw - 32px);
    right: 0;
  }

  /* 8. Thin Floating Translucent Mirror Glass Mobile Bottom Navigation Dock */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 54px;
    padding: 0 10px;
    align-items: center;
    justify-content: space-around;
    box-sizing: border-box;
    border-radius: 28px;
    background: rgba(255, 250, 252, 0.18);
    backdrop-filter: blur(10px) saturate(145%);
    -webkit-backdrop-filter: blur(10px) saturate(145%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: 0 5px 16px rgba(80, 55, 75, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.38);
    z-index: 100;
    pointer-events: auto;
  }

  .mobile-nav-item {
    flex: 1;
    height: 48px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 1px 2px;
    border: 0;
    background: transparent;
    color: #66596D;
    text-decoration: none;
    border-radius: 24px;
    box-sizing: border-box;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
  }

  .mobile-nav-item.active {
    color: #D8A895;
    font-weight: 600;
  }

  .mobile-nav-item.active::after {
    content: "";
    position: absolute;
    bottom: 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #D8A895;
    opacity: 0.85;
  }

  .mobile-nav-icon {
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-icon svg {
    width: 15px !important;
    height: 15px !important;
    stroke-width: 2;
  }

  .mobile-nav-label {
    font-size: 9.5px;
    line-height: 1;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0;
  }
}

/* ==========================================================
   COMPACT SMARTPHONES (Samsung S25 Ultra, iPhone 14/15/16 - max-width: 480px)
   ========================================================== */
@media (max-width: 480px) {

  .hero-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.65rem;
  }



  .footer-glass {
    padding: 24px 16px;
  }

  .footer-bottom {
    margin-top: 20px;
    font-size: 0.78rem;
  }

  .lightbox-content {
    max-width: 95vw;
  }

  .lightbox-img {
    max-height: 75vh;
  }

  /* Header Mobile Responsiveness Fixes (Logo Far Left, Happy Bells Centered, User Avatar Far Right) */
  .site-header {
    position: fixed !important;
    top: 6px !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 8px !important;
    z-index: var(--z-header) !important;
  }

  .header-inner {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 6px 12px !important;
    box-sizing: border-box !important;
  }

  .header-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-right: auto !important;
  }

  .logo-img {
    width: 38px !important;
    height: 38px !important;
  }

  .brand-text {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--color-text-contrast) !important;
    margin: 0 !important;
    text-align: center !important;
    display: block !important;
    pointer-events: none !important;
    white-space: nowrap !important;
  }

  .desktop-nav-menu,
  .header-welcome {
    display: none !important;
  }

  .user-login-avatar-btn {
    margin-left: auto !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1.5px solid rgba(62, 44, 65, 0.15) !important;
    color: #3E2C41 !important;
    stroke: #3E2C41 !important;
    box-shadow: 0 4px 15px rgba(62, 44, 65, 0.15) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    padding: 0 !important;
  }

  .admin-prod-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .admin-prod-card div[style*="display: flex"] {
    flex-direction: column !important;
    width: 100% !important;
  }

  .edit-price-input,
  .edit-size-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }




}


/* Mobile Filter Hidden State Override */
.product-card.is-hidden {
  display: none !important;
}

/* Compact Smartphones & Narrow Screens (<= 360px) */
@media (max-width: 360px) {
  .mobile-bottom-nav {
    left: 8px;
    right: 8px;
    height: 50px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 25px;
  }

  .mobile-nav-item {
    height: 44px;
    gap: 1px;
  }

  .mobile-nav-icon,
  .mobile-nav-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  .mobile-nav-label {
    font-size: 9px;
  }

  /* Mobile Catalogue Grid Scroll Anchor Offset */
  .catalogue-grid-anchor,
  #product-grid {
    scroll-margin-top: 118px !important;
  }


  /* Mobile Measured Sticky Header & Filter Bar Spacing */
  :root {
    --hb-header-h: 54px;
    --hb-filter-h: 48px;
  }

  .catalogue-grid-anchor,
  #catalogue-grid-anchor,
  #product-grid {
    scroll-margin-top: calc(var(--hb-header-h, 54px) + var(--hb-filter-h, 48px) + 10px) !important;
  }


  /* Mobile Modal Spacing (Ensures Action Buttons Sit Clear of Bottom Dock) */
  .modal-content,
  .customization-modal-content {
    max-height: calc(100vh - 120px) !important;
    margin-bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 20px 16px !important;
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
  }

  .customization-modal {
    padding: 12px !important;
    align-items: center !important;
  }

  .size-pill-btn {
    padding: 5px 12px !important;
    font-size: 0.76rem !important;
  }


  /* Mobile High Contrast for We make Memories */
  .hero-title span.emphasis.text-gradient {
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #FFFFFF !important; color: #FFFFFF !important;
    font-weight: 700 !important;
  }


  /* Mobile Modal Size List Scroll Fix */
  .product-sizes-scroll-container {
    max-height: 180px !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }







  /* Mobile Size List & Modal Content Scroll Fix */
  .product-sizes-scroll-container {
    max-height: 150px !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }


  .size-option-row { padding: 9px 12px !important; }
  .size-option-row.active-size-row .size-label, .size-option-row.active-size-row .price-label { color: #FFFFFF !important; }
}
