/* ==========================================================================
   home-mobile.css — Modern phone frontpage for Ven868
   Scope: .v868-mhome (markup rendered by app/Data/home-mobile.php).

   Rules:
   - The phone layout only exists below 768px. Desktop (>= 768px) keeps the
     existing .v868-dhome block and its current redesign.css styles.
   - Loaded once in app/Includes/header.php, after mobile-first.css.
   - No global element selectors: everything is scoped under .v868-mhome so
     no other page can be affected.
   Procedural PHP 8.5.x | UTF-8
   ========================================================================== */

/* Visibility contract (mirrored inline in public_html/index.php as a
   CSS-failure safety net so both layouts can never render at the same time). */
.v868-mhome {
  display: none;
}

@media (max-width: 767px) {
  .v868-dhome {
    display: none !important;
  }

  .v868-mhome {
    display: block;
    position: relative;
    padding: 6px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    color: var(--v868-ink, #0f172a);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background:
      radial-gradient(circle at 12% 0%, rgba(6, 182, 212, 0.10), transparent 42%),
      radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.09), transparent 40%),
      linear-gradient(180deg, #f0f9ff 0%, #ffffff 42%, #f8fafc 100%);
  }

  /* ---------- Shared primitives ---------- */
  .v868-mhome .v868-msec {
    margin: 0 0 20px;
  }

  .v868-mhome .v868-msec__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
  }

  .v868-mhome .v868-msec__head h2 {
    margin: 0;
    color: var(--v868-ink, #0f172a);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }

  .v868-mhome .v868-msec__head a {
    flex: 0 0 auto;
    color: var(--v868-cyan-dark, #0e7490);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .v868-mhome .v868-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  }

  .v868-mhome .v868-btn:active {
    transform: scale(0.98);
  }

  .v868-mhome .v868-btn--primary {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #fff;
    box-shadow: 0 12px 22px -12px rgba(37, 99, 235, 0.85);
  }

  .v868-mhome .v868-btn--ghost {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .v868-mhome .v868-btn--light {
    background: #fff;
    color: var(--v868-cyan-dark, #0e7490);
    box-shadow: 0 10px 20px -12px rgba(2, 15, 32, 0.5);
  }

  .v868-mhome .v868-btn--block {
    width: 100%;
  }

  /* ---------- 1. Hero ---------- */
  .v868-mhome .v868-mhero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 6px 0 18px;
    border-radius: 20px;
    box-shadow: 0 18px 36px -26px rgba(2, 15, 32, 0.65);
  }

  .v868-mhome .v868-mhero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .v868-mhome .v868-mhero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
  }

  .v868-mhome .v868-mhero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
      185deg,
      rgba(2, 20, 38, 0.10) 0%,
      rgba(2, 20, 38, 0.48) 46%,
      rgba(2, 20, 38, 0.92) 100%
    );
  }

  .v868-mhome .v868-mhero__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 238px;
    padding: 18px 16px 16px;
    color: #fff;
  }

  .v868-mhome .v868-mhero__eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #e0f2fe;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .v868-mhome .v868-mhero__eyebrow::before {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 8px #22d3ee;
  }

  .v868-mhome .v868-mhero h1 {
    margin: 0 0 6px;
    color: #fff;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: clamp(1.25rem, 6.2vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.08;
    text-wrap: balance;
  }

  .v868-mhome .v868-mhero h1 span {
    background: linear-gradient(90deg, #67e8f9, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .v868-mhome .v868-mhero p {
    max-width: 34ch;
    margin: 0 0 12px;
    color: #dbeafe;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .v868-mhome .v868-mhero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .v868-mhome .v868-mhero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
  }

  .v868-mhome .v868-mhero__chips li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.2;
  }

  .v868-mhome .v868-mhero__chips i {
    color: #67e8f9;
    font-size: 0.62rem;
  }

  /* ---------- 2. Quick actions ---------- */
  .v868-mhome .v868-mqa {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
  }

  .v868-mhome .v868-qa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    min-height: 78px;
    padding: 8px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 18px -18px rgba(15, 23, 42, 0.55);
    -webkit-tap-highlight-color: transparent;
  }

  .v868-mhome .v868-qa__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--qa-a, #06b6d4), var(--qa-b, #2563eb));
    color: #fff;
    font-size: 15px;
    box-shadow: 0 8px 16px -10px rgba(15, 23, 42, 0.6);
  }

  .v868-mhome .v868-qa__label {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .v868-mhome .v868-qa:active {
    transform: translateY(1px);
  }

  /* ---------- 3. Category grid ---------- */
  .v868-mhome .v868-mcat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .v868-mhome .v868-mcat {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 62px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    color: var(--v868-ink, #0f172a);
    text-decoration: none;
    box-shadow: 0 8px 20px -20px rgba(15, 23, 42, 0.55);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .v868-mhome .v868-mcat:active {
    transform: scale(0.985);
    border-color: #bae6fd;
  }

  .v868-mhome .v868-mcat__icon {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--cat-a, #06b6d4), var(--cat-b, #2563eb));
    color: #fff;
    font-size: 15px;
    box-shadow: 0 8px 16px -10px rgba(15, 23, 42, 0.55);
  }

  .v868-mhome .v868-mcat__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .v868-mhome .v868-mcat__arrow {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.6rem;
  }

  /* ---------- 4 + 5. Horizontal rails ---------- */
  .v868-mhome .v868-mrail {
    display: flex;
    gap: 12px;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .v868-mhome .v868-mrail::-webkit-scrollbar {
    display: none;
  }

  .v868-mhome .v868-mrail > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  /* Promo cards (the existing 4 desktop banner links, preserved 1:1) */
  .v868-mhome .v868-mpromo {
    position: relative;
    display: block;
    width: 146px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 16px;
    background: #0f172a;
    box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.7);
    text-decoration: none;
  }

  .v868-mhome .v868-mpromo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .v868-mhome .v868-mpromo::after {
    content: '';
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(180deg, transparent, rgba(2, 15, 32, 0.85));
    pointer-events: none;
  }

  .v868-mhome .v868-mpromo__label {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
  }

  /* Product cards */
  .v868-mhome .v868-mprod {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 158px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 26px -24px rgba(15, 23, 42, 0.6);
  }

  .v868-mhome .v868-mprod__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
  }

  .v868-mhome .v868-mprod__media a {
    display: block;
    width: 100%;
    height: 100%;
  }

  .v868-mhome .v868-mprod__media img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
    object-fit: contain;
  }

  .v868-mhome .v868-mprod__wish {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #64748b;
    font-size: 0.78rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .v868-mhome .v868-mprod__wish.active {
    border-color: #ef4444;
    background: #ef4444;
    color: #fff;
  }

  .v868-mhome .v868-mprod__cat {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    margin-bottom: 4px;
    padding: 2px 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.10);
    color: #0e7490;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .v868-mhome .v868-mprod__name {
    display: -webkit-box;
    min-height: 2.5em;
    margin: 0 0 6px;
    overflow: hidden;
    color: #0f172a;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .v868-mhome .v868-mprod__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    margin-top: auto;
    margin-bottom: 8px;
  }

  .v868-mhome .v868-mprod__price strong {
    color: #0f172a;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
  }

  .v868-mhome .v868-mprod__wholesale {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.55rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .v868-mhome .v868-mprod__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #fff;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* Override the orange glow inherited from the global .add-to-cart-btn. */
    box-shadow: 0 8px 16px -12px rgba(37, 99, 235, 0.9);
  }

  .v868-mhome .v868-mprod__add:hover {
    background: linear-gradient(135deg, #0891b2, #1d4ed8);
  }

  .v868-mhome .v868-mprod__add:active {
    transform: scale(0.98);
  }

  /* ---------- 6. Trust list ---------- */
  .v868-mhome .v868-mtrust {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .v868-mhome .v868-mtrust__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
  }

  .v868-mhome .v868-mtrust__icon {
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #ecfeff;
    color: #0e7490;
    font-size: 15px;
  }

  .v868-mhome .v868-mtrust__copy {
    min-width: 0;
  }

  .v868-mhome .v868-mtrust__copy strong {
    display: block;
    margin-bottom: 1px;
    color: #0f172a;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .v868-mhome .v868-mtrust__copy span {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  /* ---------- 7. Advisor CTA ---------- */
  .v868-mhome .v868-madvisor {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 20px;
    padding: 18px 16px;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f766e, #0e7490 55%, #1d4ed8);
    color: #fff;
    box-shadow: 0 20px 34px -26px rgba(13, 148, 136, 0.8);
  }

  .v868-mhome .v868-madvisor::after {
    content: '';
    position: absolute;
    top: -46px;
    right: -34px;
    z-index: -1;
    width: 132px;
    height: 132px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
  }

  .v868-mhome .v868-madvisor h2 {
    margin: 0 0 4px;
    color: #fff;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .v868-mhome .v868-madvisor p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .v868-mhome .v868-madvisor .v868-btn {
    align-self: flex-start;
  }

  /* ---------- Small phones ---------- */
  @media (max-width: 359px) {
    .v868-mhome .v868-mcat__arrow {
      display: none;
    }

    .v868-mhome .v868-mcat__name {
      font-size: 0.72rem;
    }

    .v868-mhome .v868-qa__label {
      font-size: 0.56rem;
    }

    .v868-mhome .v868-mprod {
      width: 150px;
    }
  }

  /* ---------- Reduced motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    .v868-mhome .v868-btn,
    .v868-mhome .v868-mcat,
    .v868-mhome .v868-mprod__add {
      transition: none !important;
    }

    .v868-mhome .v868-btn:active,
    .v868-mhome .v868-qa:active,
    .v868-mhome .v868-mcat:active,
    .v868-mhome .v868-mprod__add:active {
      transform: none !important;
    }

    .v868-mhome .v868-mrail {
      scroll-behavior: auto;
    }
  }
}
