/*
 * Mega Fans — Custom CSS Overrides
 * Additional styles layered on top of the main theme stylesheet
 */

/* ============================================================
   WOOCOMMERCE PRODUCT LOOP — CUSTOM CARD STRUCTURE
   ============================================================ */
.woocommerce ul.products li.product {
  background: var(--mega-white);
  border: 1px solid var(--mega-silver-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.woocommerce ul.products li.product:hover {
  border-color: var(--mega-red);
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}
.woocommerce ul.products li.product a img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 20px;
  background: var(--mega-off-white);
  transition: transform 0.4s ease;
}
.woocommerce ul.products li.product:hover a img {
  transform: scale(1.05);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-heading) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  color: var(--mega-black) !important;
  padding: 0 16px 8px !important;
}
.woocommerce ul.products li.product .product-card-body {
  padding: 12px 16px;
  flex: 1;
}
.woocommerce ul.products li.product .product-card-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--mega-silver-light);
}

/* ============================================================
   WC NOTICES
   ============================================================ */
.woocommerce-info,
.woocommerce-error,
.woocommerce-message {
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-body) !important;
}
.woocommerce-info { border-color: var(--mega-red) !important; }
.woocommerce .woocommerce-info::before { color: var(--mega-red) !important; }

/* ============================================================
   SINGLE PRODUCT TABS
   ============================================================ */
.woocommerce div.product .woocommerce-tabs {
  margin-top: 48px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0;
  border-bottom: 2px solid var(--mega-silver-light);
  margin-bottom: 24px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: transparent;
  border: none;
  border-radius: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mega-gray);
  padding: 12px 20px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--mega-red);
  border-bottom-color: var(--mega-red);
  background: transparent;
}

/* ============================================================
   TAXONOMY PAGE HEADER
   ============================================================ */
.term-description {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.6);
  max-width: 600px;
  margin-top: 12px;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.mega-search-wrap {
  position: relative;
  max-width: 400px;
}
.mega-search-wrap input[type="search"] {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border: 2px solid var(--mega-silver-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.mega-search-wrap input[type="search"]:focus {
  border-color: var(--mega-red);
}
.mega-search-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mega-gray);
}

/* ============================================================
   PAGE — GENERIC CONTENT
   ============================================================ */
.mega-page-content {
  padding: 60px 0;
}
.mega-page-content h1,
.mega-page-content h2,
.mega-page-content h3 {
  font-family: var(--font-heading);
}
.mega-page-content p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--mega-gray-mid);
}
.mega-page-content ul {
  list-style: none;
  padding: 0;
}
.mega-page-content ul li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.92rem;
  color: var(--mega-gray-mid);
}
.mega-page-content ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--mega-red);
  font-weight: 700;
}

/* ============================================================
   PRODUCT FILTER ACTIVE STATE
   ============================================================ */
.sidebar-cat-list li.current-cat a {
  color: var(--mega-red) !important;
  font-weight: 600;
  padding-left: 8px !important;
}
.sidebar-cat-list li.current-cat .sidebar-cat-count {
  background: var(--mega-red);
  color: var(--mega-white);
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.mega-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--mega-white);
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   BACK TO TOP BUTTON — Z-INDEX WHEN MODAL OPEN
   ============================================================ */
.mega-modal-overlay.active ~ .scroll-top {
  z-index: 1;
}

/* ============================================================
   PRODUCT DETAIL — COLOUR SWATCHES (if used)
   ============================================================ */
.color-swatch-white  { background: #FFFFFF; border: 2px solid #ddd !important; }
.color-swatch-ivory  { background: #FFFFF0; }
.color-swatch-chocolate { background: #7B3F00; }
.color-swatch-french-gold { background: #C8A951; }
.color-swatch-silver-blue { background: #8BA7C7; }
.color-swatch-oyster { background: #D4C9B0; }
.color-swatch-bronze { background: #8C6239; }
.color-swatch-copper { background: #B87333; }
.color-swatch-nickle { background: #A8A9AD; }
.color-swatch-mountain-grey { background: #6D6E71; }
.color-swatch-aqua-blue { background: #00B5CC; }
.color-swatch-cherry-gold { background: #A8232A; }
.color-swatch-green { background: #4A7C59; }

/* ============================================================
   PRODUCT WARRANTY BADGE
   ============================================================ */
.product-warranty-badge {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* ============================================================
   CONTACT FORM 7 — CUSTOM STYLING
   ============================================================ */
.wpcf7-form p { margin-bottom: 16px; }
.wpcf7-form label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mega-black);
  margin-bottom: 6px;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form select,
.wpcf7-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--mega-silver-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--mega-black);
  background: var(--mega-white);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
  border-color: var(--mega-red);
  box-shadow: 0 0 0 4px rgba(208,2,27,0.1);
}
.wpcf7-form textarea { min-height: 120px; resize: vertical; }
.wpcf7-not-valid-tip {
  font-size: 0.75rem;
  color: var(--mega-red);
  margin-top: 4px;
  display: block;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
  .single-product-wrap { padding: 40px 0; }
  .product-detail-title { font-size: 1.6rem; }
  .woo-archive-header { padding: 40px 0; }
  .contact-form-card { padding: 24px 20px; }
  .contact-info-card { padding: 28px 20px; }
  .about-hero { padding: 60px 0; }
  .section-pad { padding: 40px 0; }
  .stat-card { padding: 24px 16px; }
  .stat-number { font-size: 2rem; }
  .footer-top { padding: 48px 0 32px; }
}

@media (max-width: 480px) {
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; justify-content: center; }
  .product-specs-table th, .product-specs-table td { font-size: 0.82rem; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .mega-modal-overlay { display: none !important; }
  .mega-toast { display: none !important; }
  .scroll-top { display: none !important; }
  .mega-hero { min-height: auto; }
  .mega-hero::before, .mega-hero-bg-accent { display: none; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--mega-red);
  outline-offset: 3px;
}
.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;
}

/* High-contrast mode */
@media (prefers-contrast: high) {
  :root {
    --mega-red: #C00010;
    --mega-black: #000000;
    --mega-gray-mid: #333333;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  .hero-image-wrap img { animation: none; }
}
