/*
 * ═══════════════════════════════════════════════════════════════
 * LIVI Design System
 * assets/css/livi-design-system.css
 *
 * Єдина точка правди для всіх кольорів, шрифтів, відступів,
 * компонентів. Діє на всі сторінки сайту.
 * ═══════════════════════════════════════════════════════════════
 */


/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */

:root {
  /* Кольори */
  --livi-black:       #111111;
  --livi-text:        #171717;
  --livi-muted:       #777777;
  --livi-muted-light: #aaaaaa;
  --livi-white:       #ffffff;
  --livi-cream:       #f7f2ef;
  --livi-soft:        #fbf8f7;
  --livi-line:        #e8dfdd;
  --livi-accent:      #c98b96;
  --livi-accent-dark: #b5707c;
  --livi-accent-pale: #f0dde0;
  --livi-error:       #c0392b;
  --livi-success:     #4caf87;

  /* Шрифт */
  --livi-font:        'Poppins', sans-serif;

  /* Розміри тексту */
  --livi-text-2xs: 10px;
  --livi-text-xs:  12px;
  --livi-text-sm:  13px;
  --livi-text-base:15px;
  --livi-text-md:  17px;
  --livi-text-lg:  20px;
  --livi-text-xl:  24px;
  --livi-text-2xl: 32px;
  --livi-text-3xl: 42px;
  --livi-text-4xl: 56px;
  --livi-text-5xl: 72px;

  /* Відступи */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Радіуси */
  --livi-radius-sm: 14px;
  --livi-radius-md: 20px;
  --livi-radius-lg: 28px;
  --livi-radius-pill: 999px;

  /* Тіні */
  --livi-shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
  --livi-shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --livi-shadow-md: 0 4px 20px rgba(0,0,0,0.09);
  --livi-shadow-lg: 0 8px 40px rgba(0,0,0,0.12);

  /* Контейнер */
  --livi-container:      1240px;
  --livi-container-pad:  20px;

  /* Переходи */
  --livi-ease:      0.24s ease;
  --livi-ease-slow: 0.42s ease;
}


/* ── 2. GLOBAL RESET / BASE ────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
}

body,
.woocommerce,
.woocommerce-page {
  font-family:             var(--livi-font) !important;
  font-size:               var(--livi-text-base) !important;
  color:                   var(--livi-text) !important;
  line-height:             1.65 !important;
  background-color:        var(--livi-white) !important;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family:    var(--livi-font) !important;
  color:          var(--livi-black) !important;
  font-weight:    600 !important;
  line-height:    1.15 !important;
  letter-spacing: -0.015em !important;
  margin-top:     0;
}

p { margin-top: 0; }

a {
  color:           var(--livi-black);
  text-decoration: none;
  transition:      color var(--livi-ease);
}
a:hover { color: var(--livi-accent); }

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

::selection {
  background: var(--livi-accent-pale);
  color:      var(--livi-black);
}

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--livi-cream); }
::-webkit-scrollbar-thumb { background: var(--livi-line); border-radius: 99px; }


/* ── 3. CONTAINER ──────────────────────────────────────────── */

/* Porto header alignment */
body.home #header,
body.home #header .header-main,
body.home #header .header-top,
body.home #header .header-bottom,
body.home #header .header-wrapper,
body.home .header-wrapper,
body.home .header-builder {
  background: var(--livi-white) !important;
  color: var(--livi-black) !important;
}

body.home #header {
  width: 100% !important;
  z-index: 20;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: none !important;
}

body.home:not(.fixed-header):not(.sticky-header-active) #header:not(.sticky-header):not(.fixed-header):not(.sticky) {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
}

body.home:not(.fixed-header):not(.sticky-header-active) .header-wrapper:not(.sticky-header):not(.fixed-header):not(.sticky) {
  position: relative !important;
  top: auto !important;
}

body.home #header .header-main {
  min-height: 80px;
  border-bottom: 0 !important;
}

body.home #header .header-main .container,
body.home #header .header-main .container-fluid,
body.home #header .header-row,
body.home #header .header-col {
  min-height: 80px;
  align-items: center;
}

body.home #header .header-row {
  display: flex;
  width: 100%;
  gap: var(--sp-5);
}

body.home #header .header-col,
body.home #header .header-left,
body.home #header .header-center,
body.home #header .header-right {
  display: flex;
  align-items: center;
}

body.home #header .header-left,
body.home #header .header-col:first-child {
  flex: 0 0 auto;
  gap: var(--sp-4);
}

body.home #header .header-center,
body.home #header .header-main-menu,
body.home #header .main-menu-wrap {
  flex: 1 1 auto;
  justify-content: flex-start;
}

body.home #header .header-right,
body.home #header .header-col:last-child {
  margin-left: auto;
  justify-content: flex-end;
  gap: var(--sp-4);
}

body.home #header .logo,
body.home #header .header-logo,
body.home #header .site-logo {
  display: flex !important;
  align-items: center;
  flex: 0 0 auto;
  margin: 0 var(--sp-5) 0 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  white-space: nowrap;
}

body.home #header .logo a,
body.home #header .header-logo a,
body.home #header .site-logo a {
  display: inline-flex !important;
  align-items: center;
  color: var(--livi-black) !important;
  font-family: var(--livi-font) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  line-height: 1 !important;
  white-space: nowrap;
}

body.home #header .logo img,
body.home #header .header-logo img,
body.home #header .site-logo img {
  display: block !important;
  width: auto !important;
  max-width: 176px !important;
  max-height: 36px !important;
  object-fit: contain;
  opacity: 1 !important;
  visibility: visible !important;
  filter: brightness(0) !important;
}

body.home #header .logo img:not(:first-of-type),
body.home #header .header-logo img:not(:first-of-type),
body.home #header .site-logo img:not(:first-of-type),
body.home #header .logo .sticky-logo,
body.home #header .header-logo .sticky-logo,
body.home #header .site-logo .sticky-logo {
  display: none !important;
}

body.home #header a,
body.home #header .main-menu > li > a,
body.home #header .main-menu .menu-item > a,
body.home #header .header-main-menu > li > a,
body.home #header .header-main-menu .menu-item > a,
body.home #header .top-links a,
body.home #header .searchform-popup .search-toggle,
body.home #header .my-account,
body.home #header .wishlist,
body.home #header .cart-head,
body.home #header .cart-icon,
body.home #header .cart-items,
body.home #header .mobile-toggle,
body.home #header i {
  color: var(--livi-black) !important;
}

body.home #header .main-menu > li > a,
body.home #header .main-menu .menu-item > a,
body.home #header .header-main-menu > li > a,
body.home #header .header-main-menu .menu-item > a {
  font-family: var(--livi-font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  line-height: 1.4 !important;
  padding-left: 13px !important;
  padding-right: 13px !important;
}

body.home #header .main-menu,
body.home #header .header-main-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
}

body.home #header .searchform-popup,
body.home #header .my-account,
body.home #header .wishlist,
body.home #header .cart-head,
body.home #header .cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
}

body.home #header .cart-items,
body.home #header .cart-count,
body.home #header .cart-qty,
body.home #header .cart-items-count,
body.home #header .cart-count-badge,
body.home #header .cart-subtotal .count,
body.home #header .mini-cart .count,
body.home #header .mybag-link .count {
  position: absolute !important;
  top: -3px !important;
  right: -5px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: var(--livi-radius-pill) !important;
  background: var(--livi-accent) !important;
  color: var(--livi-white) !important;
  font-family: var(--livi-font) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  box-shadow: 0 0 0 2px var(--livi-white) !important;
}

body.home #header .main-menu > li > a:hover,
body.home #header .main-menu .menu-item > a:hover,
body.home #header .header-main-menu > li > a:hover,
body.home #header .header-main-menu .menu-item > a:hover,
body.home #header .top-links a:hover {
  color: var(--livi-accent) !important;
}

body.home #header .header-main.sticky,
body.home #header.sticky-header,
body.home #header .sticky-header {
  background: var(--livi-white) !important;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}

.livi-container {
  width:     100%;
  max-width: calc(var(--livi-container) + var(--livi-container-pad) * 2);
  margin:    0 auto;
  padding:   0 var(--livi-container-pad);
}


/* ── 4. BUTTONS ────────────────────────────────────────────── */

/* Базова кнопка */
.livi-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  font-family:     var(--livi-font);
  font-size:       var(--livi-text-xs);
  font-weight:     500;
  letter-spacing:  0.08em;
  text-transform:  uppercase;
  white-space:     nowrap;
  text-decoration: none;
  border:          2px solid transparent;
  border-radius:   var(--livi-radius-pill);
  padding:         13px 30px;
  cursor:          pointer;
  transition:      background var(--livi-ease),
                   color var(--livi-ease),
                   border-color var(--livi-ease),
                   transform var(--livi-ease),
                   box-shadow var(--livi-ease);
  -webkit-appearance: none;
}
.livi-btn:active { transform: translateY(1px); }

/* Первинна — чорна */
.livi-btn-primary,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .single_add_to_cart_button {
  background:   var(--livi-black) !important;
  border-color: var(--livi-black) !important;
  color:        var(--livi-white) !important;
  font-family:  var(--livi-font) !important;
  font-size:    var(--livi-text-xs) !important;
  font-weight:  500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  border-radius: var(--livi-radius-pill) !important;
  padding:      13px 30px !important;
  transition:   all var(--livi-ease) !important;
  line-height:  1 !important;
}

.livi-btn-primary:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce .single_add_to_cart_button:hover {
  background:   var(--livi-accent) !important;
  border-color: var(--livi-accent) !important;
  color:        var(--livi-white) !important;
  transform:    translateY(-1px) !important;
}

/* Outline — чорний контур */
.livi-btn-outline {
  background:   transparent;
  border-color: var(--livi-black);
  color:        var(--livi-black);
}
.livi-btn-outline:hover {
  background:   var(--livi-black);
  color:        var(--livi-white);
  transform:    translateY(-1px);
}

/* Ghost — для темних фонів */
.livi-btn-ghost {
  background:   transparent;
  border-color: rgba(255,255,255,0.6);
  color:        var(--livi-white);
}
.livi-btn-ghost:hover {
  background:   var(--livi-white);
  border-color: var(--livi-white);
  color:        var(--livi-black);
}

/* Accent */
.livi-btn-accent {
  background:   var(--livi-accent);
  border-color: var(--livi-accent);
  color:        var(--livi-white);
}
.livi-btn-accent:hover {
  background:   var(--livi-accent-dark);
  border-color: var(--livi-accent-dark);
  transform:    translateY(-1px);
}

/* Розміри */
.livi-btn-sm { font-size: var(--livi-text-2xs) !important; padding: 10px 22px !important; }
.livi-btn-lg { font-size: var(--livi-text-sm)  !important; padding: 16px 40px !important; }
.livi-btn-xl { font-size: var(--livi-text-base) !important; padding: 18px 52px !important; }
.livi-btn-full { width: 100%; }


/* ── 5. BADGE / TAG ────────────────────────────────────────── */

.livi-badge {
  display:        inline-block;
  font-family:    var(--livi-font);
  font-size:      var(--livi-text-2xs);
  font-weight:    600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding:        4px 11px;
  border-radius:  var(--livi-radius-pill);
  line-height:    1.5;
}
.livi-badge-cream  { background: var(--livi-cream);       color: var(--livi-muted); }
.livi-badge-black  { background: var(--livi-black);       color: var(--livi-white); }
.livi-badge-accent { background: var(--livi-accent-pale); color: var(--livi-accent-dark); }
.livi-badge-sale   { background: var(--livi-accent);      color: var(--livi-white); }


/* ── 6. SECTION LAYOUT ─────────────────────────────────────── */

.livi-section    { padding: var(--sp-9) 0; }
.livi-section-sm { padding: var(--sp-7) 0; }
.livi-section-lg { padding: calc(var(--sp-9) * 1.3) 0; }

.livi-section-label {
  display:        block;
  font-size:      var(--livi-text-xs);
  font-weight:    600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:          var(--livi-accent);
  margin-bottom:  var(--sp-2);
}

.livi-section-title {
  font-size:   clamp(26px, 3.5vw, var(--livi-text-2xl));
  font-weight: 600 !important;
  color:       var(--livi-black) !important;
  margin:      0 !important;
}

.livi-section-subtitle {
  font-size:  var(--livi-text-base);
  color:      var(--livi-muted);
  margin-top: var(--sp-3);
  font-weight: 300;
}

.livi-section-header { margin-bottom: var(--sp-7); }
.livi-section-header--between {
  display:         flex;
  align-items:     flex-end;
  justify-content: space-between;
  gap:             var(--sp-4);
}


/* ── 7. PRODUCT CARD — shared across all pages ─────────────── */

.livi-product-card {
  background:    var(--livi-white);
  border-radius: var(--livi-radius-md);
  overflow:      hidden;
  transition:    transform var(--livi-ease), box-shadow var(--livi-ease);
  position:      relative;
}
.livi-product-card:hover {
  transform:  translateY(-4px);
  box-shadow: var(--livi-shadow-md);
}

.livi-product-card__thumb {
  position:     relative;
  aspect-ratio: 4 / 5;
  overflow:     hidden;
  background:   var(--livi-cream);
  display:      block;
}
.livi-product-card__thumb img {
  width:       100%;
  height:      100%;
  object-fit:  cover;
  transition:  transform var(--livi-ease-slow);
  display:     block;
}
.livi-product-card:hover .livi-product-card__thumb img {
  transform: scale(1.05);
}

.livi-product-card__badge {
  position: absolute;
  top:      var(--sp-3);
  left:     var(--sp-3);
  z-index:  2;
}

.livi-product-card__body {
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
}

.livi-product-card__category {
  font-size:      var(--livi-text-xs);
  color:          var(--livi-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom:  var(--sp-1);
  display:        block;
}

.livi-product-card__name {
  font-size:      var(--livi-text-sm);
  font-weight:    500;
  color:          var(--livi-text);
  line-height:    1.4;
  margin-bottom:  var(--sp-3);
  display:        block;
  transition:     color var(--livi-ease);
}
.livi-product-card__name:hover { color: var(--livi-accent); }

.livi-product-card__price {
  font-size:     var(--livi-text-base);
  font-weight:   600;
  color:         var(--livi-black);
  margin-bottom: var(--sp-4);
}
.livi-product-card__price del {
  font-weight:     400;
  color:           var(--livi-muted-light);
  margin-right:    var(--sp-1);
  text-decoration: line-through;
}
.livi-product-card__price ins {
  color:           var(--livi-accent);
  text-decoration: none;
  font-weight:     600;
}

.livi-product-card__btn {
  width:      100%;
  text-align: center;
}


/* ── 8. UTILITIES ──────────────────────────────────────────── */

.livi-text-center  { text-align: center; }
.livi-text-muted   { color: var(--livi-muted); }
.livi-text-accent  { color: var(--livi-accent); }
.livi-text-upper   { text-transform: uppercase; letter-spacing: 0.08em; }
.livi-font-light   { font-weight: 300 !important; }
.livi-font-medium  { font-weight: 500 !important; }
.livi-font-semi    { font-weight: 600 !important; }

.livi-bg-white  { background: var(--livi-white); }
.livi-bg-cream  { background: var(--livi-cream); }
.livi-bg-soft   { background: var(--livi-soft); }
.livi-bg-black  { background: var(--livi-black); }

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

.livi-divider {
  border: none;
  border-top: 1px solid var(--livi-line);
  margin: var(--sp-7) 0;
}

.livi-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.livi-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.livi-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }

/* Scroll-fade анімація */
@keyframes livi-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.livi-rise { animation: livi-rise 0.5s ease forwards; }
