/* ==========================================================================
   Custom Variables
   ========================================================================== */

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --telegram-gradient: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
  --wb-gradient: linear-gradient(135deg, #CB11AB 0%, #A020F0 100%);
  --wb-primary: #CB11AB;
  --wb-secondary: #A020F0;
  --wb-hover: #A00D8F;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-wb: 0 4px 16px rgba(203, 17, 171, 0.3);
}

/* ==========================================================================
   Global Styles
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow-x: hidden;
}

/* Fix navbar spacing */
body {
  padding-top: 52px;
}

/* ==========================================================================
   Navbar Styles
   ========================================================================== */

.navbar {
  box-shadow: var(--shadow-sm);
  background-color: white;
}

.navbar-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.navbar .button {
  font-weight: 600;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-gradient {
  background: var(--primary-gradient);
  position: relative;
  overflow: hidden;
}

/* Hero Video Background */
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex;
  flex-direction: row;
}

.hero-video-block {
  flex: 1 1 33.333%;
  width: 33.333%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  display: block;
}

.hero-video.loaded {
  opacity: 1;
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.75) 0%, rgba(118, 75, 162, 0.75) 100%);
  z-index: 1;
}

.hero-body {
  position: relative;
  z-index: 2;
}

.hero .title,
.hero .subtitle {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-fade-in-delay {
  animation: fadeIn 0.8s ease-out 0.2s both;
}

/* ==========================================================================
   Feature Boxes
   ========================================================================== */

.feature-box {
  height: 100%;
  transition: all 0.3s ease;
  border: none;
  box-shadow: var(--shadow-sm);
}

.feature-box:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.feature-box .icon {
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.feature-box:hover .icon {
  transform: scale(1.1);
}

/* ==========================================================================
   Product Cards
   ========================================================================== */

.product-card {
  height: 100%;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, rgba(203, 17, 171, 0.1) 0%, rgba(160, 32, 240, 0.1) 100%) border-box;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-wb);
  border-color: var(--wb-primary);
}

.product-card .card-image {
  position: relative;
  overflow: hidden;
}

.product-card .card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(203, 17, 171, 0) 0%, rgba(160, 32, 240, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .card-image::after {
  opacity: 1;
}

.product-card .card-image img {
  transition: transform 0.5s ease;
  object-fit: cover;
  object-position: top center;
  width: 100%;
  height: 100%;
}

.product-card:hover .card-image img {
  transform: scale(1.1);
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

/* WB accent for card content */
.product-card .card-content {
  position: relative;
}

.product-card .card-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--wb-gradient);
  transition: height 0.4s ease;
  border-radius: 0 4px 4px 0;
}

.product-card:hover .card-content::before {
  height: 100%;
}

.product-card .title {
  transition: color 0.3s ease;
}

.product-card:hover .title {
  color: var(--wb-primary);
}

.product-card .button {
  transition: all 0.3s ease;
}

.product-card .button:hover {
  transform: scale(1.05);
}

/* Wildberries button styles */
.button.is-wb {
  background: var(--wb-gradient);
  border: none;
  color: white;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(203, 17, 171, 0.3);
}

.button.is-wb:hover {
  background: linear-gradient(135deg, #A00D8F 0%, #8B1AD9 100%);
  box-shadow: 0 6px 20px rgba(203, 17, 171, 0.5);
  transform: translateY(-3px);
  color: white;
}

.button.is-wb:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(203, 17, 171, 0.4);
}

.button.is-wb .icon {
  color: white;
}

/* WB pulse animation */
@keyframes wb-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(203, 17, 171, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(203, 17, 171, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(203, 17, 171, 0);
  }
}

.product-card:hover .button.is-wb {
  animation: wb-pulse 1.5s ease-out;
}

/* ==========================================================================
   Telegram CTA Section
   ========================================================================== */

.telegram-cta {
  background: var(--telegram-gradient);
  position: relative;
  overflow: hidden;
}

.telegram-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.3;
}

.telegram-cta .container {
  position: relative;
  z-index: 1;
}

.telegram-benefits li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.telegram-benefits i {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.telegram-mockup {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */

.faq-item {
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.faq-item:hover {
  border-color: hsl(217, 71%, 53%);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: #f8f9fa;
  padding: 3rem 1.5rem;
}

.footer a {
  color: #4a4a4a;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: hsl(217, 71%, 53%);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.has-text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 768px) {
  .hero.is-large .hero-body {
    padding: 6rem 1.5rem;
  }
  
  .product-card {
    margin-bottom: 2rem;
  }
  
  .telegram-mockup {
    min-height: 200px;
  }
  
  .telegram-mockup i {
    font-size: 8rem !important;
  }
  
  /* На мобильных показываем только одно видео по центру */
  .hero-video-container {
    flex-direction: row;
  }
  
  .hero-video:first-child,
  .hero-video:last-child {
    display: none;
  }
  
  /* Табы на мобильных */
  .tabs.is-boxed li {
    margin: 0.25rem;
  }
  
  .tabs.is-boxed a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .collection-arrow {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .collection-tabs-wrapper {
    gap: 0.5rem;
  }
}

@media screen and (max-width: 1023px) {
  .navbar-menu {
    box-shadow: var(--shadow-sm);
  }
}

/* ==========================================================================
   Animations & Interactions
   ========================================================================== */

.button {
  transition: all 0.3s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button:active {
  transform: translateY(0);
}

/* Pulse animation for primary CTA buttons */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 221, 87, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 221, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 221, 87, 0);
  }
}

.button.is-warning {
  animation: pulse 2s infinite;
}

/* Smooth scrolling offset for fixed navbar */
section[id] {
  scroll-margin-top: 70px;
}

/* Loading state for images */
img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}

/* ==========================================================================
   Collection Tabs
   ========================================================================== */

.collection-tabs-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto 1.5rem; /* Уменьшили отступ снизу */
  overflow: visible;
  min-height: 60px; /* Уменьшили высоту */
}

.collection-tabs-container {
  flex: 0 1 auto;
  width: calc(100% - 120px);
  overflow: hidden;
  position: relative;
  height: 5rem; /* Фиксированная высота 5rem */
  display: flex;
  align-items: center;
}

.collection-tabs-container .tabs {
  margin-bottom: 0 !important;
  overflow: visible !important;
  border-bottom: none !important;
  height: 100%;
  display: flex;
  align-items: center;
}

#collection-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-behavior: smooth !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  user-select: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  padding-top: 0 !important;
  list-style: none !important;
  max-width: 1200px !important;
  width: 100% !important;
  justify-content: flex-start !important;
  border-bottom: none !important;
  height: 5rem; /* Фиксированная высота 5rem */
  align-items: center;
}

#collection-tabs::-webkit-scrollbar {
  display: none !important;
}

.collection-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #e8e8e8;
  background: white;
  color: #667eea;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  outline: none;
}

.collection-arrow:hover:not(:disabled) {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transform: scale(1.05);
}

.collection-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.collection-arrow:active:not(:disabled) {
  transform: scale(0.95);
}

.tabs.is-boxed {
  border-bottom: none !important;
}

.tabs.is-boxed li {
  margin: 0 0.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.tabs.is-boxed a {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.65rem 1.25rem; /* Уменьшили padding */
  transition: all 0.3s ease;
  background: white;
  color: #4a4a4a;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.tabs.is-boxed a:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: transparent;
}

.tabs.is-boxed li.is-active a {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.tabs.is-boxed a .icon {
  margin-right: 0.5rem;
}

/* ==========================================================================
   Placeholder Image for Products
   ========================================================================== */

.product-placeholder {
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
  position: relative;
}

/* ==========================================================================
   Products Grid Smooth Transition
   ========================================================================== */

#products-grid {
  transition: opacity 0.3s ease;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* Выравнивание по верху, не растягивать */
}

#products-grid .column {
  align-self: flex-start; /* Предотвращаем растягивание колонок */
}

#products-grid.loading {
  opacity: 0;
  pointer-events: none;
}

.product-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  height: 100%; /* Карточка занимает всю высоту колонки */
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================================================
   Pagination Styles
   ========================================================================== */

.pagination {
  margin-top: 2rem;
}

.pagination-link.is-current {
  background-color: var(--wb-primary);
  border-color: var(--wb-primary);
}

.pagination-link:hover {
  border-color: var(--wb-primary);
  color: var(--wb-primary);
}

.pagination-previous:disabled,
.pagination-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .navbar,
  .button,
  .footer,
  .tabs,
  .pagination {
    display: none;
  }

  .hero {
    page-break-after: always;
  }

  .product-card {
    page-break-inside: avoid;
  }
}
