/*
Theme Name: BezPaleva Mobile
Theme URI: https://bez-paleva.site
Author: BezPaleva
Description: Кастомная мобильная тема для интернет-магазина BezPaleva. Только для мобильных устройств.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
WC requires at least: 8.0
WC tested up to: 9.0
License: Private
Text Domain: bezpaleva
Tags: mobile, woocommerce, pharmacy
*/

/* ============================
   ПЕРЕМЕННЫЕ
============================ */
:root {
  --purple:       #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark:  #6D28D9;
  --pink:         #EC4899;
  --pink-light:   #F9A8D4;
  --blue:         #3B82F6;
  --blue-dark:    #1D4ED8;
  --white:        #FFFFFF;
  --gray-100:     #F3F4F6;
  --gray-200:     #E5E7EB;
  --gray-600:     #4B5563;
  --gray-900:     #111827;
  --bg:           #FAF5FF;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(139,92,246,0.12);
  --shadow-lg:    0 4px 24px rgba(139,92,246,0.22);
  --font:         'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================
   RESET & BASE
============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }

/* ============================
   ДЕСКТОП — ЗАГЛУШКА
============================ */
#desktop-block {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  padding: 40px;
}
#desktop-block .logo-text {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}
#desktop-block p {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  max-width: 360px;
  line-height: 1.6;
}
#desktop-block .qr-hint {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* ============================
   ШАПКА
============================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1.5px solid var(--gray-200);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 8px rgba(139,92,246,0.08);
}

/* Бургер */
.header-burger {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.header-burger span {
  display: block;
  height: 2px;
  background: var(--purple);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Логотип в шапке */
.header-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--purple);
  display: none; /* показывается только на внутренних страницах */
}

/* Языки */
.header-langs {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.header-langs a {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.header-langs a.active,
.header-langs a:hover {
  background: var(--purple);
  color: #fff;
}
.header-langs .lang-sep {
  color: var(--gray-200);
  font-size: 10px;
}
.header-langs .flag {
  font-size: 14px;
  line-height: 1;
}

/* Корзина */
.header-cart {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  border-radius: 10px;
  flex-shrink: 0;
}
.header-cart svg { width: 20px; height: 20px; color: #fff; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================
   МЕНЮ-ДРАВЕР
============================ */
#nav-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}
#nav-drawer.open { transform: translateX(0); }
#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1999;
}
#nav-overlay.open { display: block; }

.drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--purple);
  letter-spacing: -0.5px;
}
.drawer-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--gray-600);
  font-size: 22px;
  line-height: 1;
}

.drawer-nav { padding: 12px 0; flex: 1; }
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-900);
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.drawer-nav a:hover,
.drawer-nav a.active {
  background: var(--gray-100);
  color: var(--purple);
  border-left-color: var(--purple);
}
.drawer-nav .nav-icon { font-size: 20px; }

/* ============================
   ГЛАВНАЯ — HERO
============================ */
.home-hero {
  padding: 28px 20px 20px;
  text-align: center;
}
.home-logo {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.home-logo .dollar { color: var(--purple); -webkit-text-fill-color: var(--purple); }
.home-tagline {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 400;
}

/* Кнопки разделов на главной */
.home-sections {
  padding: 8px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-section-pharmacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, #F3E8FF 0%, #FDE8F7 100%);
  border: 1.5px solid var(--purple-light);
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 700;
  color: var(--purple-dark);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-section-pharmacy:active { transform: scale(0.97); }
.btn-section-pharmacy .btn-icon {
  width: 36px; height: 36px;
  background: var(--purple);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
}

.btn-section-tg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, #DBEAFE 0%, #EDE9FE 100%);
  border: 1.5px solid #93C5FD;
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-dark);
  box-shadow: 0 2px 12px rgba(59,130,246,0.12);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-section-tg:active { transform: scale(0.97); }
.btn-section-tg .btn-icon {
  width: 36px; height: 36px;
  background: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
}

/* ============================
   ГОРЯЧИЕ ТОВАРЫ (главная)
============================ */
.hot-section {
  padding: 0 20px 28px;
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before,
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Слайдер товаров */
.products-slider {
  position: relative;
}
.products-slider-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.products-slider-track::-webkit-scrollbar { display: none; }
.products-slider-track .product-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

/* Стрелки слайдера */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  color: var(--purple);
  font-size: 16px;
}
.slider-arrow.prev { left: -8px; }
.slider-arrow.next { right: -8px; }

/* ============================
   КАРТОЧКА ТОВАРА
============================ */
.product-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.product-card-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8px;
}
.product-card-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--purple);
  padding: 8px 10px 2px;
}
.product-card-body { padding: 6px 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.35;
}
.product-card-name a { color: inherit; }
.product-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}
.product-card-price .old-price {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-600);
  text-decoration: line-through;
  margin-right: 4px;
}

/* Счётчик + кнопка */
.product-card-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--purple);
  background: var(--gray-100);
  transition: background 0.15s;
}
.qty-btn:active { background: var(--gray-200); }
.qty-num {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: none;
  outline: none;
  background: #fff;
  color: var(--gray-900);
}
.btn-add-cart {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: var(--purple);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-add-cart:active { background: var(--purple-dark); transform: scale(0.97); }
.btn-add-cart.loading { opacity: 0.7; pointer-events: none; }

/* ============================
   СТРАНИЦА АПТЕКИ
============================ */
.shop-page-header {
  padding: 16px 20px 12px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}
.shop-page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.shop-description {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}
.shop-description a { color: var(--blue); font-weight: 500; }

/* Категории */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 56px;
  z-index: 100;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1.5px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab.active,
.cat-tab:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* Сетка товаров */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 16px 100px;
}

/* Лоадер */
.products-loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-600);
  font-size: 14px;
  grid-column: 1 / -1;
}
.products-loading.active { display: block; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================
   СТРАНИЦА ДОСТАВКИ
============================ */
.delivery-page { padding: 20px 20px 100px; }
.delivery-page h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 20px; }
.delivery-city {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.delivery-city h3 { font-size: 16px; font-weight: 700; color: var(--purple); margin-bottom: 8px; }
.delivery-city p { font-size: 14px; color: var(--gray-600); line-height: 1.6; }
.delivery-city .time-badge {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

/* ============================
   КОРЗИНА (мини, в шапке)
============================ */
.mini-cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  display: none;
}
.mini-cart-drawer.open { display: flex; flex-direction: column; }
.mini-cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.mini-cart-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 0 0 env(safe-area-inset-bottom);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mini-cart-handle {
  width: 40px; height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.mini-cart-header {
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.mini-cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.mini-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  align-items: center;
}
.mini-cart-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--gray-100); flex-shrink: 0; }
.mini-cart-item-info { flex: 1; min-width: 0; }
.mini-cart-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-cart-item-price { font-size: 14px; font-weight: 700; color: var(--purple); margin-top: 2px; }
.mini-cart-item-remove { color: var(--gray-600); font-size: 18px; padding: 4px; }
.mini-cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.mini-cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.btn-checkout {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ============================
   WHATSAPP КНОПКА
============================ */
#whatsapp-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  z-index: 900;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#whatsapp-btn:active { transform: scale(0.93); box-shadow: 0 2px 8px rgba(37,211,102,0.3); }
#whatsapp-btn svg { width: 30px; height: 30px; fill: #fff; }

/* ============================
   TOAST
============================ */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s;
  z-index: 5000;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================
   АНИМАЦИИ
============================ */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.product-card { animation: fadeIn 0.3s ease both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
