/* Component-specific styles */

/* Product Card Styles */
.product-card {
  /* Added pink gradient background to product cards like the example image */
  background: linear-gradient(135deg, #ffe0f0 0%, #ffeef5 50%, #fff5f8 100%);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  min-width: 170px;
}

@media (min-width: 768px) {
  .product-card {
    min-width: 250px;
    /* Increased margin between products on desktop for better spacing */
    margin: 0 1rem;
  }
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(255, 182, 193, 0.4);
  border-color: rgba(255, 105, 180, 0.8);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card-image {
  position: relative;
  width: 100%;
  /* Changed aspect ratio from 1:1 to 4:5 for all products */
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

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

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

.sale-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-card-content {
  padding: 1rem;
  /* Center align product text */
  text-align: center;
}

.product-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.product-card-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  /* Reduced gap from 0.5rem to 0.25rem and added center justification for better single-line display */
  gap: 0.25rem;
  flex-wrap: nowrap;
  justify-content: center;
  white-space: nowrap;
}

/* بهبود نمایش قیمت اصلی با خط خورده */
.product-card-price del,
.product-card-price del .woocommerce-Price-amount {
  /* Reduced font size from 0.875rem to 0.75rem for better fit in mobile */
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.7;
  text-decoration: line-through;
  font-weight: 500;
}

/* استایل قیمت حراجی */
.product-card-price ins,
.product-card-price ins .woocommerce-Price-amount {
  /* Reduced font size from 1.125rem to 1rem for better fit in mobile */
  font-size: 1rem;
  color: hsl(var(--destructive));
  text-decoration: none;
  font-weight: 700;
}

/* Countdown Timer Styles */
.countdown-timer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  min-width: 60px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.countdown-number {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1;
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 255, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 255, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    text-shadow: 0 0 15px rgba(255, 255, 255, 1), 0 0 30px rgba(255, 255, 255, 0.9), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

.countdown-label {
  font-size: clamp(0.625rem, 2vw, 0.875rem);
  font-weight: 600;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

/* Improved mobile timer layout - bigger text, thicker banner */
@media (max-width: 640px) {
  .sale-banner {
    padding: 0.75rem 0.6rem !important;
    gap: 0.4rem !important;
    flex-wrap: nowrap !important;
  }

  .sale-banner h3 {
    font-size: 0.9rem !important;
    margin-right: 0;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .sale-banner a {
    font-size: 0.65rem !important;
    padding: 0.3rem 0.5rem !important;
    margin-left: 0;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .countdown-timer {
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .countdown-unit {
    min-width: 36px;
    padding: 0.2rem 0.25rem;
    gap: 0.1rem;
  }

  .countdown-number {
    font-size: 0.85rem;
  }

  .countdown-label {
    font-size: 0.5rem;
  }
}

/* Added View More button styles with hover effects */
.view-more-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.view-more-btn:active {
  transform: translateY(0);
}

/* Added grid layout styles for accordion products */
/* Accordion Products Grid Layout - for vertical display mode */
.accordion-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0.5rem 0;
}

@media (min-width: 768px) {
  .accordion-products-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
  }
}

/* Ensure product cards fit properly in grid layout */
.accordion-products-grid .product-card {
  min-width: unset;
  width: 100%;
}

/* Added styles for "click here" hint below view all button */
.view-all-hint {
  font-size: 0.65rem;
  opacity: 0.9;
  font-weight: 500;
  margin-top: 2px;
}

/* Category Item Hover Effects */
.category-item:hover .category-image-wrapper {
  border-color: hsl(var(--primary));
}

.category-item:hover .category-image-wrapper img {
  transform: scale(1.1);
}

.category-item:hover .category-image-wrapper div {
  background-color: rgba(0, 0, 0, 0.3);
}

.category-item:hover h3 {
  color: hsl(var(--primary));
}

/* Added responsive sizing for categories on large screens (TV) */
@media (min-width: 1200px) {
  .categories-grid {
    max-width: 700px !important;
  }

  .category-image-wrapper {
    width: 100px !important;
    height: 100px !important;
  }
}

/* Ensure categories stay small on mobile */
@media (max-width: 767px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) !important;
    gap: 1rem !important;
  }
}

/* Accordion Styles */
.accordion-item .accordion-trigger:hover {
  background-color: hsla(var(--accent), 0.7);
}

/* Enhanced accordion button styles with better visual hierarchy */
.accordion-trigger {
  position: relative;
}

.accordion-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
}

.accordion-trigger:active {
  transform: translateY(0);
}

/* Reduced accordion button height on mobile */
@media (max-width: 767px) {
  .accordion-trigger {
    /* Reduced height by 30% from 1rem to 0.7rem */
    padding: 0.7rem 0.7rem !important;
    font-size: 1.125rem !important;
  }

  .accordion-trigger span {
    font-size: 1.125rem !important;
  }

  .accordion-trigger a {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
  }

  .accordion-icon {
    font-size: 1rem !important;
  }
}

/* More attractive "View All" button in accordion with pulse animation */
.accordion-trigger a {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 15px rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 25px rgba(255, 255, 255, 0.6);
  }
}

/* Removed hardcoded accordion colors with !important - now uses inline styles from admin panel */
/* Accordion hover effects only - colors are applied via inline styles from PHP */
.accordion-latest:hover,
.accordion-girls:hover,
.accordion-boys:hover,
.accordion-sport:hover,
.accordion-extra:hover {
  filter: brightness(0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* Blog Card Hover */
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Navigation Link Hover */
.nav-link:hover {
  opacity: 1 !important;
}

/* Responsive Styles */
@media (min-width: 768px) {
  .desktop-nav {
    display: flex !important;
  }

  .desktop-blog {
    display: grid !important;
  }

  .mobile-blog {
    display: none;
  }
}

/* Fixed products page grid to ensure proper 2-column mobile layout with correct sizing */
.products-page-grid {
  display: grid;
  gap: 1rem;
  /* Mobile: 2 columns with fixed width to match main page */
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .products-page-grid {
    /* Tablet: 4 columns */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .products-page-grid {
    /* Desktop: 6 columns */
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
  }
}

/* Ensure product cards in products page match main page sizing */
.products-page-grid .product-card {
  min-width: unset;
  width: 100%;
  max-width: 100%;
}

.products-page-grid .product-card-image {
  /* Match the aspect ratio from main page */
  aspect-ratio: 4 / 5;
}

/* Mobile-specific sizing for products page */
@media (max-width: 767px) {
  .products-page-grid {
    gap: 0.75rem;
  }

  .products-page-grid .product-card {
    min-width: unset;
    width: 100%;
  }

  .products-page-grid .product-card-image {
    aspect-ratio: 4 / 5;
  }

  .products-page-grid .product-card-content {
    padding: 0.75rem;
  }

  .products-page-grid .product-card-title {
    font-size: 0.875rem;
  }

  .products-page-grid .product-card-price {
    font-size: 1rem;
    /* Added mobile-specific styles for single-line price display */
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  /* Reduce font sizes in mobile for better single-line display */
  .products-page-grid .product-card-price del {
    font-size: 0.7rem;
  }

  .products-page-grid .product-card-price ins {
    font-size: 0.9rem;
  }
}

/* Ensure product cards in products page have consistent sizing */
.products-page-grid .product-card {
  min-width: unset;
  width: 100%;
}

/* Responsive product grid for mobile - 2 columns */
@media (max-width: 767px) {
  .mobile-blog {
    display: block;
  }

  /* Ensure product cards fit properly in 2-column mobile layout */
  .product-card {
    min-width: unset;
    width: 100%;
  }
}

/* Desktop product grid adjustments */
@media (min-width: 768px) {
  .desktop-nav {
    display: flex !important;
  }

  .desktop-blog {
    display: grid !important;
  }

  .mobile-blog {
    display: none;
  }

  /* Larger product cards on desktop */
  .product-card {
    min-width: 250px;
  }
}

/* Swiper Custom Styles */
.swiper-button-next,
.swiper-button-prev {
  color: hsl(var(--primary));
}

.swiper-pagination-bullet-active {
  background-color: hsl(var(--primary));
}

/* Added spacing between swiper slides on desktop */
@media (min-width: 768px) {
  .swiper-slide {
    padding: 0 0.5rem;
  }
}

/* Added image loading optimization to prevent flash */
.product-card-image img,
.hero-slide img,
.category-image-wrapper img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card-image img.loaded,
.hero-slide img.loaded,
.category-image-wrapper img.loaded {
  opacity: 1;
}

/* Prevent layout shift during image load */
.product-card-image,
.hero-slide,
.category-image-wrapper {
  background-color: hsl(var(--muted));
}

/* Added Dashboard Mobile Responsive Styles */
/* Dashboard Mobile Optimizations */
@media (max-width: 767px) {
  .khoshtip-dashboard {
    padding: 0.5rem;
  }

  .khoshtip-dashboard-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    color: white;
  }

  .khoshtip-user-info {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .khoshtip-user-avatar {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    flex-shrink: 0;
  }

  .khoshtip-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .khoshtip-user-details {
    flex: 1;
    min-width: 0;
  }

  .khoshtip-user-name {
    font-size: 1.125rem !important;
    color: white !important;
    margin: 0 !important;
  }

  .khoshtip-user-email {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0.25rem 0 0 0 !important;
  }

  /* Hide desktop edit profile button on mobile */
  .khoshtip-btn-edit-profile {
    display: none !important;
  }

  /* Show hamburger menu button only on mobile */
  .khoshtip-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
  }

  .khoshtip-menu-toggle svg {
    color: white;
  }

  .khoshtip-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
  }

  .khoshtip-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    margin-top: 1rem;
  }

  .khoshtip-stat-card {
    padding: 0.75rem 0.5rem !important;
    text-align: center;
  }

  .khoshtip-stat-icon {
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto 0.5rem !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .khoshtip-stat-icon svg {
    width: 18px !important;
    height: 18px !important;
    color: white;
  }

  .khoshtip-stat-value {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
  }

  .khoshtip-stat-label {
    font-size: 0.7rem !important;
    margin: 0.25rem 0 0 0 !important;
  }

  .khoshtip-links-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
  }

  .khoshtip-quick-link {
    padding: 0.75rem 0.25rem !important;
    font-size: 0.7rem !important;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .khoshtip-link-icon {
    width: 40px !important;
    height: 40px !important;
    margin: 0 auto !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .khoshtip-link-icon svg {
    width: 20px !important;
    height: 20px !important;
    color: white;
  }

  .khoshtip-order-item {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem !important;
  }

  .khoshtip-order-info,
  .khoshtip-order-meta {
    width: 100%;
  }

  .khoshtip-order-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .khoshtip-order-view {
    padding: 0.5rem 1rem !important;
    font-size: 0.8rem !important;
  }

  .khoshtip-empty-state {
    padding: 2rem 1rem !important;
  }

  .khoshtip-empty-state svg {
    width: 48px !important;
    height: 48px !important;
  }

  .khoshtip-empty-state h3 {
    font-size: 1.125rem !important;
  }

  .khoshtip-empty-state p {
    font-size: 0.875rem !important;
  }
}

/* Desktop: Show edit profile button, hide menu toggle */
@media (min-width: 768px) {
  .khoshtip-menu-toggle {
    display: none !important;
  }

  .khoshtip-btn-edit-profile {
    display: inline-flex !important;
  }

  .khoshtip-dashboard-menu {
    display: none !important;
  }
}

/* Added slide-out menu styles for mobile navigation */
.khoshtip-dashboard-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  /* Menu starts hidden by default */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.khoshtip-dashboard-menu.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.khoshtip-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.khoshtip-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85%;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  /* Panel starts off-screen */
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 10;
}

.khoshtip-dashboard-menu.active .khoshtip-menu-panel {
  transform: translateX(0);
}

.khoshtip-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.khoshtip-menu-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.khoshtip-menu-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.khoshtip-menu-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.khoshtip-menu-close svg {
  color: white;
}

.khoshtip-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.khoshtip-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: all 0.3s ease;
  border-right: 3px solid transparent;
}

.khoshtip-menu-item:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
  border-right-color: hsl(var(--primary));
}

.khoshtip-menu-item svg {
  color: hsl(var(--primary));
  flex-shrink: 0;
}

.khoshtip-menu-item span {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Added Single Product Page Styles */
/* Single Product Page Styles */
.khoshtip-single-product {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.khoshtip-product-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .khoshtip-product-container {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Product Gallery */
.khoshtip-product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.khoshtip-main-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #ffe0f0 0%, #ffeef5 50%, #fff5f8 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.khoshtip-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.khoshtip-gallery-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.khoshtip-gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
}

.khoshtip-thumbnail {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #ffe0f0 0%, #fff5f8 100%);
}

.khoshtip-thumbnail:hover,
.khoshtip-thumbnail.active {
  border-color: hsl(var(--primary));
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.khoshtip-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info */
.khoshtip-product-info {
}
