/*
Theme Name: PhatCable Premium
Theme URI: https://phatcable.com/
Author: PhatCable
Description: Premium dark block theme for PhatCable. Built for WooCommerce, mobile-first, with editable homepage patterns, announcement bar, warranty and comparison components.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: phatcable-premium
Tags: block-theme, e-commerce, dark, one-column, full-site-editing
*/

:root {
  --pc-black: #050505;
  --pc-charcoal: #101010;
  --pc-card: #171717;
  --pc-red: #e6202a;
  --pc-red-dark: #9f1018;
  --pc-text: #f7f7f7;
  --pc-muted: #a7a7a7;
  --pc-line: rgba(255, 255, 255, 0.1);
}

body {
  background: var(--pc-black);
  color: var(--pc-text);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--pc-red);
  color: #fff;
}

/* ---------- Announcement bar ---------- */
.pc-announcement {
  background: #0b0b0b;
  border-bottom: 1px solid var(--pc-line);
  color: var(--pc-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.65rem 1rem;
}
.pc-announcement strong { color: var(--pc-text); font-weight: 600; }

/* ---------- Sticky header ---------- */
.pc-header {
  position: sticky;
  top: 0;
  z-index: 40;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.pc-header.is-scrolled {
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--pc-line);
}
.pc-wordmark { font-weight: 500; letter-spacing: -0.02em; }
.pc-wordmark b { font-weight: 700; }
.pc-wordmark i { color: var(--pc-muted); font-style: normal; }
.pc-wordmark span {
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--pc-red);
  vertical-align: middle;
}

/* ---------- Components ---------- */
.pc-card {
  background: var(--pc-card);
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  padding: 1.5rem;
}
.pc-card:hover { border-color: rgba(230, 32, 42, 0.4); }

.pc-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--pc-line);
  background: var(--pc-charcoal);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--pc-muted);
}
.pc-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pc-red);
}

.pc-placeholder {
  border: 1px dashed rgba(230, 32, 42, 0.5);
  color: var(--pc-red);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}

.pc-btn,
.wp-block-button__link,
.woocommerce .button,
.woocommerce button.button.alt,
.woocommerce #respond input#submit {
  background: var(--pc-red);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 1.75rem;
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.pc-btn:hover,
.wp-block-button__link:hover,
.woocommerce .button:hover {
  background: var(--pc-red);
  box-shadow: 0 0 0 1px rgba(230, 32, 42, 0.35), 0 18px 60px -18px rgba(230, 32, 42, 0.55);
}
.pc-btn--outline {
  background: transparent; color: var(--pc-text);
  border: 1px solid var(--pc-line);
}
.pc-btn--outline:hover { border-color: rgba(230, 32, 42, 0.6); color: var(--pc-red); box-shadow: none; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--pc-red);
  outline-offset: 2px;
}

/* Text link with cable-line animation */
.pc-link { position: relative; text-decoration: none; }
.pc-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--pc-red), var(--pc-red-dark));
  border-radius: 2px; transition: width 0.35s ease;
}
.pc-link:hover::after { width: 100%; }

/* Tables */
.pc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pc-table th, .pc-table td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--pc-line); }
.pc-table thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pc-muted); }
.pc-table-wrap { overflow-x: auto; border: 1px solid var(--pc-line); border-radius: 12px; background: var(--pc-card); }

/* FAQ accordion */
.pc-faq details { border-bottom: 1px solid var(--pc-line); }
.pc-faq summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; font-weight: 500; padding: 1rem 1.25rem; list-style: none; }
.pc-faq summary::-webkit-details-marker { display: none; }
.pc-faq summary::after { content: "+"; color: var(--pc-red); font-size: 1.25rem; }
.pc-faq details[open] summary::after { content: "–"; }
.pc-faq p { padding: 0 1.25rem 1.25rem; color: var(--pc-muted); font-size: 0.9rem; }

/* Hero glow */
.pc-hero { position: relative; overflow: hidden; }
.pc-hero::before {
  content: ""; position: absolute; inset: auto 0 0 50%;
  width: 680px; height: 260px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(230, 32, 42, 0.28), transparent 70%);
  filter: blur(24px); pointer-events: none;
}
.pc-float { animation: pc-float 9s ease-in-out infinite; }
@keyframes pc-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- WooCommerce ---------- */
.woocommerce ul.products li.product,
.woocommerce div.product .summary { color: var(--pc-text); }
.woocommerce ul.products li.product {
  background: var(--pc-card); border: 1px solid var(--pc-line); border-radius: 12px; padding: 1rem;
}
.woocommerce div.product p.price, .woocommerce ul.products li.product .price { color: var(--pc-text); font-weight: 600; }
.woocommerce .woocommerce-variation-add-to-cart .quantity input,
.woocommerce input[type="text"], .woocommerce input[type="email"], .woocommerce textarea, .woocommerce select {
  background: var(--pc-black); color: var(--pc-text); border: 1px solid var(--pc-line);
  border-radius: 8px; min-height: 48px; padding: 0 0.75rem;
}
.woocommerce .variations td { padding-bottom: 0.75rem; }
.pc-swatches { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pc-swatch {
  min-height: 48px; padding: 0 1.25rem; border-radius: 8px;
  border: 1px solid var(--pc-line); background: transparent; color: var(--pc-muted);
  font-weight: 600; cursor: pointer;
}
.pc-swatch[aria-pressed="true"] { border-color: var(--pc-red); background: rgba(230, 32, 42, 0.1); color: var(--pc-text); }
.pc-swatch[disabled] { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

/* Mobile sticky purchase bar */
.pc-sticky-buy {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(11, 11, 11, 0.96);
  border-top: 1px solid var(--pc-line);
  backdrop-filter: blur(8px);
}
.pc-sticky-buy .pc-sticky-meta { min-width: 0; flex: 1; }
.pc-sticky-buy .pc-sticky-meta p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sticky-buy .pc-sticky-meta .pc-var { font-size: 0.75rem; color: var(--pc-muted); }
@media (min-width: 1024px) { .pc-sticky-buy { display: none; } }
body.single-product { padding-bottom: 84px; }
@media (min-width: 1024px) { body.single-product { padding-bottom: 0; } }

/* Basket drawer */
.pc-drawer { position: fixed; inset: 0; z-index: 50; display: none; }
.pc-drawer.is-open { display: block; }
.pc-drawer__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); border: 0; width: 100%; }
.pc-drawer__panel {
  position: absolute; right: 0; top: 0; height: 100%; width: min(100%, 384px);
  background: #0b0b0b; border-left: 1px solid var(--pc-line);
  display: flex; flex-direction: column;
}
.pc-drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.pc-drawer__foot { border-top: 1px solid var(--pc-line); padding: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
