/**
 * ShopifyLite Pakistan - Custom Styles
 * Additional custom styles and overrides
 */

/* ====================
   SCROLLBAR STYLING
==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ====================
   SELECTION STYLING
==================== */
::selection {
  background: var(--primary);
  color: white;
}

::-moz-selection {
  background: var(--primary);
  color: white;
}

/* ====================
   HEADER SCROLLED STATE
==================== */
.site-header.scrolled {
  box-shadow: var(--shadow);
}

/* ====================
   MOBILE MENU
==================== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ====================
   CATEGORY CARD
==================== */
.category-card .product-image {
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card .product-image img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* ====================
   PRODUCT ATTRIBUTES TABLE
==================== */
.product-attributes {
  border-collapse: collapse;
}

.product-attributes tr:nth-child(even) {
  background: var(--bg-light);
}

/* ====================
   REVIEWS STYLING
==================== */
.woocommerce-Reviews {
  max-width: 800px;
}

.woocommerce-Reviews .commentlist {
  list-style: none;
  padding: 0;
}

.woocommerce-Reviews .comment {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.woocommerce-Reviews .comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.woocommerce-Reviews .star-rating {
  color: var(--accent);
}

/* ====================
   COMMENT FORM
==================== */
.comment-form {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.comment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.comment-form input[type="submit"] {
  background: var(--primary);
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.comment-form input[type="submit"]:hover {
  background: var(--primary-dark);
}

/* ====================
   STAR RATING INPUT
==================== */
.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 16px;
}

.stars a {
  color: var(--border);
  font-size: 20px;
  transition: var(--transition);
}

.stars a:hover,
.stars a:hover ~ a,
.stars a.selected,
.stars a.selected ~ a {
  color: var(--accent);
}

/* ====================
   LOADING STATES
==================== */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  color: white;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====================
   WISHLIST BUTTON
==================== */
.add-to-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: var(--transition);
}

.add-to-wishlist:hover {
  background: var(--error);
  color: white;
}

.add-to-wishlist.added {
  background: var(--error);
  color: white;
}

/* ====================
   BADGE VARIATIONS
==================== */
.product-badge.low-stock {
  background: var(--error);
  color: white;
}

.product-badge.trending {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* ====================
   PROMO BANNER
==================== */
.promo-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 40px 0;
}

.promo-banner h2 {
  font-size: 32px;
  margin-bottom: 12px;
}

.promo-banner p {
  opacity: 0.9;
  margin-bottom: 24px;
}

/* ====================
   NEWSLETTER
==================== */
.newsletter-section {
  background: var(--bg-light);
  padding: 60px 0;
  text-align: center;
}

.newsletter-form {
  max-width: 500px;
  margin: 24px auto 0;
  display: flex;
  gap: 12px;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
}

.newsletter-form button {
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.newsletter-form button:hover {
  background: var(--primary-dark);
}

/* ====================
   BREADCRUMBS
==================== */
.breadcrumbs {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-light);
}

.breadcrumbs a {
  color: var(--text-medium);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .separator {
  margin: 0 8px;
}

/* ====================
   PAGINATION
==================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
}

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

.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ====================
   SALE BADGE ANIMATION
==================== */
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.product-badge {
  animation: pulse-badge 2s ease infinite;
}

/* ====================
   HOVER EFFECTS
==================== */
.product-card {
  will-change: transform;
}

.product-card:hover {
  will-change: auto;
}

/* ====================
   FOCUS STYLES
==================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ====================
   PRINT STYLES
==================== */
@media print {
  .site-header,
  .site-footer,
  .cookie-consent,
  .mini-cart,
  .mini-cart-overlay,
  .product-actions,
  .btn {
    display: none !important;
  }
  
  .product-single-inner {
    grid-template-columns: 1fr;
  }
  
  .product-gallery {
    position: static;
  }
}

/* ====================
   ACCESSIBILITY
==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 100000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* ====================
   RTL SUPPORT
==================== */
[dir="rtl"] .product-price {
  flex-direction: row-reverse;
}

[dir="rtl"] .section-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-inner {
  flex-direction: row-reverse;
}

/* ====================
   DARK MODE SUPPORT (Future)
==================== */
@media (prefers-color-scheme: dark) {
  /* Uncomment when dark mode is implemented */
  /*
  :root {
    --bg-white: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-dark: #ffffff;
    --text-medium: #b0b0b0;
    --border: #404040;
  }
  */
}

/* ====================
   REDUCED MOTION
==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
