/* Kriptoentuzijasti Webshop - Frontend Styles */

:root {
  --ken-ws-primary: #6366f1;
  --ken-ws-primary-hover: #4f46e5;
  --ken-ws-dark: #121212;
  --ken-ws-dark-soft: #1e1e1e;
  --ken-ws-white: #ffffff;
  --ken-ws-gray: #f8fafc;
  --ken-ws-text: #334155;
  --ken-ws-success: #22c55e;
  --ken-ws-sale: #ef4444;
  --ken-ws-featured: #f59e0b;
  --ken-ws-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ken-ws-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ken-ws-bg-dark: #1e1e2f;
  --ken-ws-bg-light: #f8fafc;
  --ken-ws-text-main: #1e293b;
  --ken-ws-text-muted: #64748b;
  --ken-ws-border: #e2e8f0;
}

/* GLOBAL THEME INTEGRATION FOR SHOP PAGES */
body.ken-ws-active .container {
  max-width: 1400px !important;
  width: 95% !important;
}

/* Force our Grid regardless of Elementor */
body.ken-ws-active .elementor-widget-container,
body.ken-ws-active .elementor-section,
body.ken-ws-active .elementor-widget,
body.ken-ws-active .eael-product-grid {
  display: none !important;
}

body.ken-ws-active ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 30px !important;
  margin: 40px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Hide WooCommerce default category images */
body.ken-ws-active ul.products li.product-category {
  display: none !important;
} /* Base resets for Shop */
.ken-ws-main-wrapper {
  padding: 0;
  background-color: transparent;
}

body.dark-mode .ken-ws-main-wrapper {
  background-color: transparent;
}

/* Shop Hero Section */
.ken-ws-shop-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 80px 40px;
  margin: -40px -40px 60px -40px;
  border-radius: 0 0 30px 30px;
  position: relative;
  overflow: hidden;
}

.ken-ws-shop-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
}

.ken-ws-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 900px;
  margin: 0 auto;
}

.ken-ws-hero-title {
  font-size: 52px;
  font-weight: 900;
  margin: 0 0 15px 0;
  letter-spacing: -1px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ken-ws-hero-subtitle {
  font-size: 20px;
  margin: 0 0 40px 0;
  opacity: 0.95;
  font-weight: 400;
  line-height: 1.6;
}

.ken-ws-hero-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.ken-ws-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ken-ws-stat-number {
  font-size: 36px;
  font-weight: 900;
  display: block;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ken-ws-stat-label {
  font-size: 13px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Category Filter Section */
.ken-ws-category-filter {
  margin: 0 0 50px 0;
  padding: 0 20px;
}

.ken-ws-section-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 30px 0;
  color: var(--ken-ws-text-main);
  text-align: center;
}

.ken-ws-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.ken-ws-category-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 25px;
  border-radius: 16px;
  border: 2px solid #f1f5f9;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}

.ken-ws-category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
  border-color: var(--ken-ws-primary);
}

.ken-ws-category-card.active {
  background: linear-gradient(135deg, var(--ken-ws-primary) 0%, #764ba2 100%);
  color: white;
  border-color: var(--ken-ws-primary);
}

.ken-ws-category-icon {
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
}

.ken-ws-category-info h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
  font-weight: 700;
}

.ken-ws-category-count {
  font-size: 13px;
  opacity: 0.7;
}

.ken-ws-category-card.active .ken-ws-category-count {
  opacity: 0.9;
}

body.dark-mode .ken-ws-main-wrapper {
  background-color: transparent;
}

/* Empty State for Categories */
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message,
.woocommerce-page .woocommerce-info {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
  border: none !important;
  border-left: 4px solid var(--ken-ws-primary) !important;
  padding: 30px !important;
  border-radius: 12px !important;
  color: var(--ken-ws-text-main) !important;
  font-size: 16px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  margin: 40px 0 !important;
}

.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-info::before {
  content: "📦";
  font-size: 32px;
  margin-right: 15px;
  vertical-align: middle;
}

/* Make sure products display even when term count is 0 */
body.ken-ws-active .woocommerce-notices-wrapper {
  margin: 20px 0;
}

/* Fix for empty categories showing WC default message */
body.ken-ws-active .entry-content > .woocommerce.columns-3 {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Product Grid */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 30px !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
}

.woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  background: var(--ken-ws-white);
  border: 1px solid #edf2f7;
  border-radius: 16px !important;
  padding: 20px !important;
  overflow: hidden;
  position: relative;
  transition: var(--ken-ws-transition);
}

.woocommerce ul.products li.product:hover {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-8px);
  border-color: var(--ken-ws-primary);
}

/* Badges */
.ken-ws-badges {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ken-ws-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
}

.ken-ws-badge.sale {
  background: var(--ken-ws-sale);
}
.ken-ws-badge.featured {
  background: var(--ken-ws-featured);
}

/* Buttons */
.woocommerce ul.products li.product .button {
  margin-top: 15px !important;
  background-color: var(--ken-ws-primary) !important;
  color: white !important;
  border-radius: 10px !important;
  padding: 12px 20px !important;
  width: 100%;
  text-align: center;
  transition: var(--ken-ws-transition);
}

.woocommerce ul.products li.product .button:hover {
  background-color: var(--ken-ws-primary-hover) !important;
}

/* Side Cart Styling Enhanced */
.ken-ws-side-cart-wrapper {
  position: fixed;
  top: 0;
  right: -450px;
  width: 400px;
  height: 100%;
  z-index: 9999;
  background: var(--ken-ws-white);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .ken-ws-side-cart-wrapper {
    width: 100%;
    right: -100%;
  }
}

.ken-ws-side-cart-wrapper.active {
  right: 0;
}

.ken-ws-side-cart-header {
  padding: 25px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ken-ws-side-cart-content-inner {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
}

.ken-ws-side-cart-footer {
  padding: 25px;
  background: var(--ken-ws-gray);
  border-top: 1px solid #f1f5f9;
}

/* Overlay Styling */
.ken-ws-side-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
}

.ken-ws-side-cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Items */
.ken-ws-cart-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ken-ws-cart-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 15px;
  border-bottom: 1px solid #f1f5f9;
}

.item-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
}
.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-details .item-title {
  display: block;
  font-weight: 600;
  color: var(--ken-ws-text);
  margin-bottom: 5px;
}
.item-details .item-meta {
  color: #64748b;
  font-size: 13px;
}

.ken-ws-remove-item {
  position: absolute;
  top: 0;
  right: 0;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 20px;
}

.ken-ws-remove-item:hover {
  color: var(--ken-ws-sale);
}

/* Cart Buttons */
.ken-ws-cart-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.ken-ws-btn {
  display: block;
  padding: 14px;
  text-align: center;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--ken-ws-transition);
}

.btn-solid {
  background: var(--ken-ws-primary);
  color: white;
}
.btn-solid:hover {
  background: var(--ken-ws-primary-hover);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--ken-ws-primary);
  color: var(--ken-ws-primary);
}

/* Empty Cart State */
.ken-ws-empty-msg-v2 {
  text-align: center;
  padding: 40px 0;
}
.empty-icon {
  font-size: 60px;
  display: block;
  margin-bottom: 20px;
}

/* Dark Mode Support */
body.dark-mode .ken-ws-side-cart-wrapper,
body.dark-mode .woocommerce ul.products li.product {
  background: var(--ken-ws-dark-soft);
  border-color: #333;
  color: white;
}

body.dark-mode .item-details .item-title {
  color: white;
}
body.dark-mode .ken-ws-side-cart-footer {
  background: #1a1a1a;
}

/* Single Product Styles */
.ken-ws-single-meta {
  margin-bottom: 1rem;
}

.ken-ws-premium-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ken-ws-trust-badges {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.ken-ws-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.ken-ws-trust-item i {
  font-size: 1.5rem;
  color: #6366f1;
  width: 24px;
  height: 24px;
}

.ken-ws-trust-item span {
  font-size: 0.7rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Premium Styles */
.ken-ws-product-card {
  position: relative;
  background: var(--ken-ws-white);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.ken-ws-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.ken-ws-product-card .add_to_cart_button {
  background: #6366f1;
  color: white !important;
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ken-ws-product-card .add_to_cart_button:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ken-ws-product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
}

.ken-ws-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ken-ws-product-card:hover .ken-ws-product-image img {
  transform: scale(1.08);
}

/* Skeleton loader effect for AJAX loading states (optional but cool) */
.ken-ws-loading {
  position: relative;
  overflow: hidden;
  background: #f3f4f6;
}

.ken-ws-loading::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Floating Cart Trigger */
.ken-ws-floating-cart-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #6366f1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ken-ws-floating-cart-trigger:hover {
  transform: scale(1.1) rotate(-10deg);
  background: #4f46e5;
}

.ken-ws-floating-cart-trigger i {
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.ken-ws-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Header Cart Trigger (Replacement for old shortcode) */
.ken-ws-header-cart-trigger {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  gap: 8px !important;
  cursor: pointer !important;
  position: relative !important;
  padding: 8px 12px !important; /* Increased hit area */
  background: transparent !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  color: inherit !important;
  line-height: 1.2 !important;
  margin: 0 5px !important;
  height: auto !important;
  text-decoration: none !important;
  z-index: 99999 !important; /* Ensure it is on top */
  pointer-events: auto !important;
}

.ken-ws-header-cart-trigger:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  transform: translateY(-1px) !important;
}

/* Adjust for white text headers */
.ken-ws-header-cart-trigger i {
  font-size: 20px !important; /* Slightly larger */
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  color: inherit !important;
  pointer-events: none !important; /* Prevent icon from blocking click */
}

.ken-ws-header-cart-trigger .ken-ws-cart-count {
  position: static !important;
  background: var(--ken-ws-primary) !important;
  color: white !important;
  font-size: 11px !important;
  width: 22px !important;
  height: 22px !important;
  border: none !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  pointer-events: none !important; /* Prevent count from blocking click */
}

/* FORCE OVERRIDES: Neutralize Elementor and Theme Defaults */
.elementor-template-full-width .ken-ws-main-wrapper,
.elementor-page .ken-ws-main-wrapper {
  max-width: 1400px !important;
  margin: 40px auto !important;
  display: block !important;
  width: 95% !important;
}

/* Hide theme/elementor default sale flashes since we use custom badges */
.onsale,
.elementor-badge {
  display: none !important;
}

/* Fix grid conflicts with NewsCard and Elementor Row/Column */
.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 30px !important;
  width: 100% !important;
}

.products .product {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure our badges are always on top */
.ken-ws-badges {
  z-index: 10;
}

/* responsive */
@media (max-width: 768px) {
  .ken-ws-trust-badges {
    flex-direction: column;
    align-items: center;
  }
}

.ken-ws-buy-now-btn {
  background: #10b981 !important; /* Green for Buy Now */
  color: white !important;
  width: 100%;
  margin-top: 10px;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ken-ws-buy-now-btn:hover {
  background: #059669 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.single-product div.product form.cart {
  display: flex;
  flex-direction: column;
}

.single-product div.product form.cart .button {
  padding: 1rem !important;
  font-size: 1rem !important;
  background: #6366f1 !important;
  border-radius: 8px !important;
}

/* Header Alignment Fixes */
.news-card-header-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
}

.header-ads {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
}

/* Ensure the hijacked cart icon is in the same row */
.ken-ws-cart-icon-wrapper {
  display: inline-flex !important;
  vertical-align: middle !important;
  margin-left: 15px !important;
}

/* Fix account and search icons if they are list items */
.news-card-header-right ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.news-card-header-right li {
  margin: 0 10px !important;
}

/* Adjust the cart trigger specifically */
#ken-ws-cart-trigger {
  padding: 8px 12px !important;
  background: rgba(99, 102, 241, 0.1) !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
}

#ken-ws-cart-trigger:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  transform: translateY(-2px);
}
