/*
Theme Name: Xanifer's Cards
Theme URI: https://www.xanifer.com
Author: Jared W. Horsch
Author URI: https://www.xanifer.com
Description: Custom WooCommerce theme for Xanifer's Cards — Premium Magic: The Gathering cards & accessories. Features light/dark mode, branded homepage, and full WooCommerce support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: xanifers-cards
Tags: e-commerce, woocommerce, custom-logo, custom-menu, dark-mode
*/

/* ============================================================
   CSS VARIABLES — LIGHT (default) & DARK
   ============================================================ */
:root {
  --gold: #C9A227;
  --gold-light: #D4AF37;
  --gold-dark: #A68B1A;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f7f7f7;
  --bg-hero: linear-gradient(180deg, #faf9f6 0%, #ffffff 100%);
  --text: #1a1a1a;
  --text-muted: #4a4a4a;
  --border: #e5e0d0;
  --card-border: #e5e0d0;
  --header-bg: #ffffff;
  --footer-bg: #1a1a1a;
  --footer-text: #cccccc;
  --footer-muted: #777777;
  --footer-border: #333333;
  --btn-dark: #1a1a1a;
  --shadow: 0 12px 28px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --gold: #D4AF37;
  --gold-light: #E0C15A;
  --gold-dark: #C9A227;
  --bg: #121212;
  --bg-elevated: #1a1a1a;
  --bg-muted: #1e1e1e;
  --bg-hero: linear-gradient(180deg, #161616 0%, #121212 100%);
  --text: #f0f0f0;
  --text-muted: #b0b0b0;
  --border: #2a2a2a;
  --card-border: #2e2e2e;
  --header-bg: #161616;
  --footer-bg: #0d0d0d;
  --footer-text: #bbbbbb;
  --footer-muted: #666666;
  --footer-border: #2a2a2a;
  --btn-dark: #C9A227;
  --shadow: 0 12px 28px rgba(0,0,0,0.45);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-branding img,
.custom-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
}

[data-theme="dark"] .site-branding img,
[data-theme="dark"] .custom-logo {
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.site-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.site-title span {
  display: block;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--gold-dark);
  letter-spacing: 0.04em;
}

.site-title a {
  color: inherit;
}

.primary-menu {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.primary-menu a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.primary-menu a:hover {
  color: var(--gold-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-btn,
.header-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.theme-btn:hover,
.header-icon-btn:hover {
  background: var(--bg-muted);
}

.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--gold);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 72px;
  text-align: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-logo {
  width: 160px;
  height: auto;
  margin: 0 auto 24px;
  border-radius: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
}

[data-theme="dark"] .hero-logo {
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.hero-tagline {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: var(--gold-dark);
  font-style: italic;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #111;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--gold);
}

.btn-outline:hover {
  background: var(--gold);
  color: #111;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

.gold-line {
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ============================================================
   PRODUCTS (WooCommerce + custom cards)
   ============================================================ */
.products-grid,
ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-card,
ul.products li.product {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s, background-color 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

.product-card:hover,
ul.products li.product:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.product-image,
ul.products li.product a img {
  aspect-ratio: 5/7;
  background: var(--bg-muted);
  object-fit: cover;
  width: 100%;
  margin: 0 !important;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 2;
}

.product-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-set {
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.product-name,
ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  margin: 0 0 6px !important;
  line-height: 1.3;
  padding: 0 !important;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-price,
ul.products li.product .price {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin: 0 !important;
}

.add-btn,
ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button {
  background: var(--btn-dark) !important;
  color: #fff !important;
  border: none !important;
  padding: 8px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

[data-theme="dark"] .add-btn,
[data-theme="dark"] ul.products li.product .button,
[data-theme="dark"] .woocommerce a.button {
  color: #111 !important;
}

.add-btn:hover,
ul.products li.product .button:hover,
.woocommerce a.button:hover {
  background: var(--gold-dark) !important;
  color: #111 !important;
}

/* ============================================================
   ABOUT + CTA
   ============================================================ */
.about-strip {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.about-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.about-inner p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.about-name {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  color: var(--text);
  margin-top: 16px;
}

.about-title {
  font-size: 0.9rem;
  color: var(--gold-dark);
  font-weight: 500;
}

.cta {
  text-align: center;
  padding: 56px 24px;
}

.cta h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--text);
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 24px 24px;
  transition: background-color 0.3s ease;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-title {
  color: #ffffff;
  margin-bottom: 12px;
}

.footer-brand .site-title span {
  color: var(--gold-light);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 260px;
  margin: 0;
}

.site-footer h4 {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: 0.03em;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 10px;
}

.site-footer a {
  color: #aaa;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--gold-light);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--footer-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--footer-muted);
}

.footer-bottom a {
  color: var(--footer-muted);
  margin-left: 16px;
}

.footer-bottom a:hover {
  color: var(--gold-light);
}

/* ============================================================
   WOOCOMMERCE OVERRIDES (shop, product, cart basics)
   ============================================================ */
.woocommerce .woocommerce-breadcrumb {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.woocommerce-page .site-main,
.woocommerce .site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.woocommerce div.product .product_title {
  color: var(--text);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--text);
  font-weight: 700;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--gold) !important;
}

/* ============================================================
   HIDE DEFAULT SIDEBARS / WIDGET TREES
   (prevents classic WP "Pages / Archives / Meta" lists)
   ============================================================ */
.widget-area,
#secondary,
#sidebar,
aside.widget-area,
.sidebar,
.wp-block-legacy-widget,
.wp-block-page-list,
.wp-block-archives,
.wp-block-categories,
.wp-block-search,
.widget_pages,
.widget_archive,
.widget_categories,
.widget_meta,
.widget_search {
  display: none !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .primary-menu {
    display: none;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .hero {
    padding: 48px 20px 56px;
  }
  .products-grid,
  ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .footer-bottom a {
    margin-left: 8px;
  }
}
