/* CAPITAL VAPE - Comprehensive Mobile & Responsive Engine */

/* ==========================================================================
   GLOBAL VIEWPORT & OVERFLOW LOCK
   ========================================================================== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

body.menu-open-scroll-lock {
  overflow: hidden !important;
}

/* ==========================================================================
   TABLET RESPONSIVENESS (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
    max-width: 100%;
  }

  .hero-desc {
    max-width: 600px;
    margin: 0 auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-image-wrapper {
    width: 100%;
  }

  .hero-bestseller-card {
    max-width: 440px;
    margin: 0 auto;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
  }

  .contact-card-box {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

/* ==========================================================================
   MOBILE PHONES (max-width: 768px) - 2 COLUMNS STRICT LAYOUT
   ========================================================================== */
@media (max-width: 768px) {
  /* Container Padding */
  .container {
    padding: 0 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ----------------- NAVBAR & MOBILE DRAWER ----------------- */
  .cv-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 8px 0 !important;
    z-index: 1000 !important;
    background: rgba(11, 4, 16, 0.98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7) !important;
  }

  body {
    padding-top: 56px !important;
  }

  section,
  #inicio,
  #catalogo,
  #mayoristas,
  #contacto {
    scroll-margin-top: 64px !important;
  }

  .nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  .brand-wrapper {
    gap: 6px !important;
  }

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

  .brand-name {
    font-size: 1.05rem !important;
  }

  /* Mobile Drawer Menu (Persistent ☰ - Lighter Translucent Glass Background) */
  .nav-menu {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: linear-gradient(180deg, rgba(42, 18, 62, 0.92) 0%, rgba(26, 11, 40, 0.92) 100%) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    padding: 20px 18px !important;
    flex-direction: column !important;
    gap: 14px !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  [data-theme="light"] .nav-menu {
    background: linear-gradient(180deg, rgba(252, 245, 255, 0.96) 0%, rgba(243, 230, 248, 0.96) 100%) !important;
  }

  .nav-menu.open {
    display: flex !important;
    animation: drawerFadeIn 0.25s ease-out;
  }

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

  .mobile-menu-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-menu-close {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    font-size: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  .nav-link {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    padding: 13px 16px !important;
    border-radius: var(--radius-md) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(216, 27, 183, 0.3) !important;
    display: block !important;
    width: 100% !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  }

  [data-theme="light"] .nav-link {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(179, 13, 150, 0.2) !important;
    color: #1C0722 !important;
  }

  .nav-link.nav-link-wholesale {
    border-color: var(--accent-gold) !important;
    color: var(--accent-yellow) !important;
    background: linear-gradient(135deg, rgba(229, 183, 0, 0.12), rgba(216, 27, 183, 0.12)) !important;
  }

  .mobile-menu-extra {
    margin-top: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .theme-toggle-mobile-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
  }

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .nav-actions .theme-toggle-btn,
  .nav-actions .nav-wholesale-btn {
    display: none !important; /* Managed inside the clean mobile drawer */
  }

  .nav-cart-btn {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
  }

  .cart-btn-text {
    display: none !important;
  }

  .mobile-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: var(--radius-sm) !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 1.3rem !important;
    cursor: pointer !important;
  }

  /* ----------------- HERO SECTION ----------------- */
  .hero-section {
    padding: 20px 0 16px 0 !important;
  }

  .hero-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    width: 100% !important;
  }

  .hero-content {
    text-align: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .hero-badge {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
  }

  .hero-title {
    font-size: 1.7rem !important;
    line-height: 1.18 !important;
  }

  .hero-desc {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
  }

  .hero-cta-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
  }

  .hero-bestseller-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 12px !important;
    box-sizing: border-box !important;
  }

  .hero-product-img-box {
    height: 160px !important;
  }

  /* ----------------- WHOLESALE PROMO BANNER MOBILE ----------------- */
  .wholesale-promo-banner-section {
    padding: 10px 0 !important;
    margin: 4px 0 14px 0 !important;
  }

  .wholesale-promo-card {
    padding: 18px 14px !important;
    gap: 12px !important;
  }

  .ws-promo-title {
    font-size: 1.4rem !important;
  }

  .ws-promo-desc {
    font-size: 0.85rem !important;
  }

  .ws-promo-perks {
    gap: 6px !important;
  }

  .ws-perk-pill {
    font-size: 0.74rem !important;
    padding: 4px 8px !important;
  }

  .ws-promo-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .ws-promo-actions .btn {
    width: 100% !important;
    padding: 11px 14px !important;
    font-size: 0.88rem !important;
  }

  /* ----------------- CATALOG TOOLBAR MOBILE ----------------- */
  .section-header {
    margin-bottom: 14px !important;
  }

  .section-title {
    font-size: 1.55rem !important;
  }

  .section-subtitle {
    font-size: 0.82rem !important;
  }

  .catalog-toolbar {
    padding: 10px !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .category-pills {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    gap: 5px !important;
    width: 100% !important;
  }

  .cat-pill-btn {
    white-space: nowrap !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  .search-input {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }

  /* ----------------- STRICT 2 COLUMNS PRODUCTS GRID ----------------- */
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-card {
    border-radius: var(--radius-md) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .card-image-wrapper {
    height: 145px !important;
    padding: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-img-real {
    max-height: 125px !important;
    max-width: 90% !important;
  }

  .card-body {
    padding: 7px 5px !important;
    gap: 5px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .card-meta-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 2px !important;
    width: 100% !important;
  }

  .card-rating-badge, .card-top-seller-pill, .card-stock-badge {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
  }

  .card-header-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .card-title {
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    min-height: 2em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word !important;
  }

  .card-puffs-tag {
    font-size: 0.62rem !important;
    padding: 1px 5px !important;
    line-height: 1.2 !important;
    margin-top: 1px !important;
  }

  .card-flavor-picker-block {
    margin-top: auto !important;
    width: 100% !important;
  }

  .btn-open-flavor-modal {
    padding: 4px 5px !important;
    font-size: 0.68rem !important;
    width: 100% !important;
  }

  .flavor-current-tag {
    max-width: 55px !important;
    font-size: 0.58rem !important;
  }

  /* ----------------- ZERO OVERFLOW PRICING BOX ----------------- */
  .card-pricing-block {
    padding: 4px 5px !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .pricing-tier-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .tier-label-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
  }

  .tier-badge-tag {
    font-size: 0.52rem !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    line-height: 1.1 !important;
  }

  .tier-name {
    display: none !important;
  }

  .tier-price-val {
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-align: right !important;
  }

  .tier-save-tag {
    font-size: 0.54rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .card-actions-wrapper {
    margin-top: 2px !important;
    width: 100% !important;
  }

  .btn-add-cart {
    padding: 7px 4px !important;
    font-size: 0.7rem !important;
    width: 100% !important;
    white-space: nowrap !important;
  }

  /* ----------------- WHOLESALE SECTION 2 COLUMNS ----------------- */
  .ws-tier-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .btn-ws-tier {
    padding: 4px 2px !important;
    font-size: 0.65rem !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .tier-qty-tag {
    font-size: 0.68rem !important;
  }

  .tier-unit-price {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
  }

  .tier-pack-subtotal {
    font-size: 0.54rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* ----------------- CHECKOUT MODAL RESPONSIVE ----------------- */
  .cv-modal-box {
    padding: 16px 12px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  .checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* ----------------- BOTTOM FIXED ACTION BAR MOBILE ----------------- */
  body {
    padding-bottom: 70px !important;
  }

  .cv-bottom-bar-container {
    padding: 8px 10px !important;
  }

  .cv-bottom-bar-inner {
    gap: 8px !important;
  }

  .cv-bottom-btn {
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    gap: 6px !important;
  }

  .bottom-btn-icon {
    width: 17px !important;
    height: 17px !important;
  }

  .bottom-cart-badge {
    min-width: 17px !important;
    height: 17px !important;
    font-size: 0.65rem !important;
    padding: 0 3px !important;
  }


  /* ----------------- WHOLESALE BUDGET BAR MOBILE ----------------- */
  .ws-budget-bar-card {
    padding: 14px 12px !important;
    margin-bottom: 16px !important;
  }

  .ws-budget-form-inline {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .ws-budget-input-group {
    max-width: 100% !important;
    min-width: 100% !important;
    width: 100% !important;
  }

  .ws-budget-calc-btn, .ws-budget-clear-btn {
    width: 100% !important;
    text-align: center !important;
  }
}


  /* Wholesale Gate Login Form (Button Below Input) */
  .wholesale-gate-box {
    padding: 24px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .wholesale-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .wholesale-input {
    width: 100% !important;
    font-size: 0.95rem !important;
    padding: 12px 14px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  #btnWholesaleSubmit {
    width: 100% !important;
    padding: 13px 16px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    display: block !important;
    box-sizing: border-box !important;
  }

/* Small mobile devices */
@media (max-width: 380px) {
  .cv-bottom-bar-container {
    padding: 6px 8px !important;
  }

  .cv-bottom-btn {
    padding: 8px 6px !important;
    font-size: 0.72rem !important;
    gap: 4px !important;
  }

  .bottom-btn-icon {
    width: 15px !important;
    height: 15px !important;
  }

  .bottom-cart-badge {
    min-width: 15px !important;
    height: 15px !important;
    font-size: 0.6rem !important;
    padding: 0 2px !important;
  }
}

