/**
 * VOOTAP — High-Performance Mobile & Accelerated Mobile Styles (AMP-grade UX)
 * Tailored for smartphones (iOS Safari, Android Chrome, mobile webviews).
 */

@media (max-width: 768px) {
  /* ===== 1. Base Touch & Viewport Performance ===== */
  *, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
  }

  html, body {
    overflow-x: hidden;
    touch-action: manipulation;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Optimize scrolling performance */
  .prod-card, .cat-card, .home-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 320px;
  }

  /* ===== 2. High-Performance Mobile Header ===== */
  .header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease;
  }

  .header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    height: 58px;
    box-sizing: border-box;
  }

  .burger {
    width: 42px;
    height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4.5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
  }

  .burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }

  .header__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0 8px;
  }

  .header__logo img {
    max-height: 38px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  .header__side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .iconbtn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    position: relative;
    padding: 0;
    text-decoration: none;
  }

  .iconbtn--cart .cartlink__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #E30613;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9999px;
    padding: 0 4px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(227, 6, 19, 0.3);
  }

  /* Mobile Search Bar Dropdown */
  .searchbar {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    animation: slideDown 0.2s ease-out;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .searchbar .search {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    height: 44px;
    width: 100%;
  }

  .searchbar .search input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 14.5px;
    color: #0f172a;
    outline: none;
  }

  .searchbar .search button {
    height: 100%;
    padding: 0 16px;
    background: #E30613;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  /* Quick Tags below mobile search */
  .mobile-search-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 2px;
    scrollbar-width: none;
  }

  .mobile-search-tags a {
    flex-shrink: 0;
    font-size: 11.5px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
  }

  /* Hide desktop horizontal nav on mobile */
  .nav {
    display: none !important;
  }

  /* Announcement Bar on mobile */
  .announce {
    font-size: 11px;
    padding: 6px 10px;
    text-align: center;
    line-height: 1.35;
  }

  .ticker {
    display: none; /* Hide ticker on mobile to save vertical space */
  }

  /* ===== 3. Modern App-Like Side Drawer ===== */
  .drawer {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .drawer.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 84vw;
    max-width: 330px;
    background: #ffffff;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .drawer.is-open .drawer__panel {
    transform: translateX(0);
  }

  .drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
  }

  .drawer__head img {
    max-height: 36px;
    width: auto;
    object-fit: contain;
  }

  .drawer__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .drawer__menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .drawer__menu a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
    min-height: 44px;
    box-sizing: border-box;
  }

  .drawer__menu a:active,
  .drawer__menu a.is-active {
    background: #fee2e2;
    color: #E30613;
  }

  .drawer__menu details {
    border-radius: 8px;
    overflow: hidden;
  }

  .drawer__menu summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    list-style: none;
    border-radius: 8px;
    min-height: 44px;
    box-sizing: border-box;
  }

  .drawer__menu summary::-webkit-details-marker {
    display: none;
  }

  .drawer__menu summary::after {
    content: "›";
    font-size: 18px;
    font-weight: 700;
    color: #94a3b8;
    transition: transform 0.2s;
  }

  .drawer__menu details[open] summary::after {
    transform: rotate(90deg);
  }

  .drawer__sub {
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px 8px 8px 16px;
    margin: 4px 0 8px;
  }

  .drawer__sub a {
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    padding: 9px 10px;
    min-height: 38px;
  }

  .drawer__footer {
    padding: 14px 18px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .drawer__phone-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
  }

  /* ===== 4. Popular Categories — Horizontal Touch Carousel ===== */
  .popular-cats-section {
    margin: 18px 0 28px !important;
  }

  .popular-cats__header {
    padding: 0 14px 10px !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .popular-cats__badge {
    font-size: 10px !important;
  }

  .popular-cats__title {
    font-size: 19px !important;
    line-height: 1.25;
  }

  .popular-cats__all-link {
    font-size: 12px !important;
    padding: 5px 10px !important;
  }

  .popular-cats__grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    padding: 6px 14px 14px !important;
    scrollbar-width: none !important;
  }

  .popular-cats__grid::-webkit-scrollbar {
    display: none;
  }

  .cat-card {
    flex: 0 0 102px !important;
    scroll-snap-align: start !important;
    padding: 12px 8px 10px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
  }

  .cat-card:active {
    transform: scale(0.96) !important;
  }

  .cat-card__thumb {
    width: 64px !important;
    height: 64px !important;
    padding: 6px !important;
    margin-bottom: 8px !important;
  }

  .cat-card__name {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 90px !important;
  }

  .cat-card__count {
    font-size: 10px !important;
  }

  /* ===== 5. Product Grid (2 Clean Columns on Mobile) ===== */
  .home-section {
    margin: 24px 0 !important;
  }

  .home-section__header {
    padding: 0 14px !important;
    margin-bottom: 12px !important;
  }

  .home-section__badge {
    font-size: 10px !important;
  }

  .home-section__title {
    font-size: 18px !important;
  }

  .home-section__view-all {
    font-size: 12px !important;
  }

  .prod-grid, .grid--4, .col__grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 0 12px !important;
  }

  .prod-card {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  .prod-card:active {
    transform: scale(0.98) !important;
  }

  .prod-card__media {
    aspect-ratio: 1 !important;
    padding: 10px !important;
    background: #f8fafc !important;
  }

  .prod-card__img {
    border-radius: 6px !important;
  }

  .prod-card__body {
    padding: 10px 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
  }

  .prod-card__meta {
    margin-bottom: 4px !important;
    font-size: 10px !important;
  }

  .prod-card__cat {
    font-size: 9.5px !important;
  }

  .prod-card__stock {
    font-size: 9.5px !important;
  }

  .prod-card__title {
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    height: 33px !important;
    margin-bottom: 6px !important;
    -webkit-line-clamp: 2 !important;
  }

  .prod-card__price-row {
    margin-bottom: 8px !important;
  }

  .prod-card__prices .price-current {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #E30613 !important;
  }

  .prod-card__actions {
    margin-top: auto !important;
  }

  .prod-card__btn {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ===== 6. Hero Banner on Mobile ===== */
  .hero-slide {
    padding: 30px 16px !important;
    min-height: 280px !important;
  }

  .hero-slide__title {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }

  .hero-slide__desc {
    font-size: 13px !important;
    margin-bottom: 16px !important;
  }

  /* ===== 7. Brands Section on Mobile ===== */
  .brands-section {
    padding: 24px 14px !important;
    margin: 20px 0 !important;
  }

  .brands-section__subtitle {
    font-size: 10px !important;
  }

  .brands-section__title {
    font-size: 18px !important;
  }

  .brands-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .brand-card {
    height: 68px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
  }

  .brand-card img {
    max-height: 32px !important;
    filter: none !important;
    opacity: 1 !important;
  }

  /* ===== 8. Trust Icons Bar on Mobile ===== */
  .iconbar, .icons {
    padding: 16px 12px !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .icons__item {
    gap: 8px !important;
  }

  .icons__title {
    font-size: 12.5px !important;
  }

  .icons__text {
    font-size: 11px !important;
  }

  /* ===== 9. Product Detail Page (PDP) Mobile Enhancements ===== */
  .pdp {
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
  }

  .pdp__stage {
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .pdp__main-wrap {
    aspect-ratio: 1 !important;
    background: #f8fafc !important;
  }

  .pdp__main-wrap img {
    object-fit: contain !important;
  }

  .pdp__thumbs {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding: 6px 0 !important;
    scrollbar-width: none !important;
  }

  .pdp__thumb {
    flex: 0 0 60px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    padding: 4px !important;
  }

  .pcol h1.pcol__title {
    font-size: 20px !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
  }

  .pcol__price {
    margin-top: 10px !important;
  }

  .pdp__actions .btn {
    min-height: 48px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
  }

  /* Sticky Buy Bar for Mobile — High Conversion Anchor */
  .stickybuy {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.1) !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: auto !important;
  }

  .stickybuy__inner {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .stickybuy img {
    display: block !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    object-fit: contain !important;
    background: #f8fafc !important;
  }

  .stickybuy__info {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .stickybuy__info strong#sticky-prix {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #E30613 !important;
    line-height: 1.2 !important;
  }

  .stickybuy__info span {
    font-size: 11px !important;
    color: #10b981 !important;
    font-weight: 600 !important;
  }

  .stickybuy form {
    flex: 0 0 auto !important;
  }

  .stickybuy .btn {
    min-width: 130px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    border-radius: 8px !important;
    background: #E30613 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.35) !important;
  }

  /* ===== 10. Modern App-Like Bottom Navigation Bar ===== */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 85;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .mobile-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: #64748b;
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease;
  }

  .mobile-bottom-nav__item svg {
    color: currentColor;
    transition: transform 0.15s ease;
  }

  .mobile-bottom-nav__item:active svg {
    transform: scale(0.85);
  }

  .mobile-bottom-nav__item.is-active,
  .mobile-bottom-nav__item:hover {
    color: #E30613;
  }

  .mob-cart-badge-wrap {
    position: relative;
    display: inline-flex;
  }

  .mob-cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #E30613;
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 9999px;
    text-align: center;
    padding: 0 3px;
    border: 1.5px solid #fff;
  }

  /* When on PDP with active stickybuy bar, ensure no awkward overlap */
  body.has-stickybuy-active .mobile-bottom-nav {
    display: none !important;
  }

  /* ===== 11. Collection Filter Bar on Mobile ===== */
  .col__mobile {
    padding: 10px 14px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
  }

  .col__toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  .col__count--mobile {
    font-size: 12.5px !important;
    color: #64748b !important;
    font-weight: 600 !important;
  }

  .col__bar {
    padding: 14px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin: 0 12px 16px !important;
  }

  /* ===== 12. Cart Page on Mobile ===== */
  .cartx__grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .cartx__item {
    display: grid !important;
    grid-template-columns: 80px 1fr !important;
    gap: 12px !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .cartx__media img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 8px !important;
  }

  .cartx__actions {
    margin-top: 8px !important;
  }

  .cartx__summary {
    position: static !important;
    border-radius: 12px !important;
    padding: 18px 14px !important;
  }
}
