/*
Theme Name: NexusBooks
Theme URI: https://example.com/nexusbooks
Author: Nexus Themes
Author URI: https://example.com
Description: A futuristic, dark-mode WooCommerce theme designed for modern ebook stores. Features neon cyan & purple accents, glassmorphism cards, full Breakdance compatibility, Customizer color options, and One Click Demo Import support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nexusbooks
Tags: e-commerce, woocommerce, dark, custom-colors, custom-logo, custom-menu, featured-images, full-width-template, theme-options, translation-ready
*/

/* ==========================================================================
   CSS Variables - Futuristic Palette
   ========================================================================== */
:root {
  --nx-bg: #0B0B12;
  --nx-surface: #15151F;
  --nx-surface-2: #1C1C2A;
  --nx-border: rgba(0, 229, 255, 0.12);
  --nx-primary: #00E5FF;
  --nx-primary-hover: #00B8D4;
  --nx-secondary: #A855F7;
  --nx-accent: #F472B6;
  --nx-text: #F1F5F9;
  --nx-text-muted: #94A3B8;
  --nx-success: #34D399;
  --nx-warning: #FBBF24;
  --nx-danger: #F87171;
  --nx-radius: 12px;
  --nx-radius-sm: 8px;
  --nx-shadow: 0 0 20px rgba(0, 229, 255, 0.08);
  --nx-glow: 0 0 30px rgba(0, 229, 255, 0.25);
  --nx-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --nx-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--nx-font);
  background-color: var(--nx-bg);
  color: var(--nx-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--nx-primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--nx-text);
  margin-top: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.nx-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: rgba(11, 11, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nx-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-branding img {
  height: 42px;
  width: auto;
}

.site-title {
  font-family: var(--nx-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--nx-text);
  background: linear-gradient(90deg, var(--nx-primary), var(--nx-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}

.main-navigation a {
  color: var(--nx-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--nx-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-cart {
  position: relative;
  color: var(--nx-text);
  font-size: 1.25rem;
}

.header-cart .count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--nx-primary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.nx-btn,
.button,
button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--nx-font);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--nx-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  line-height: 1.2;
}

.nx-btn-primary,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce a.button,
.woocommerce button.button {
  background: linear-gradient(135deg, var(--nx-primary), #00B8D4);
  color: #0B0B12 !important;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.nx-btn-primary:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce a.button.alt:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.45);
  color: #0B0B12 !important;
}

.nx-btn-secondary {
  background: transparent;
  color: var(--nx-primary);
  border: 1px solid var(--nx-primary);
}

.nx-btn-secondary:hover {
  background: rgba(0, 229, 255, 0.1);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.nx-hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  background: radial-gradient(ellipse at top, rgba(0, 229, 255, 0.08) 0%, transparent 60%);
}

.nx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.nx-hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.nx-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #fff, var(--nx-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nx-hero p {
  font-size: 1.15rem;
  color: var(--nx-text-muted);
  margin-bottom: 2rem;
}

.nx-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Product Cards (WooCommerce)
   ========================================================================== */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce ul.products li.product {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-6px);
  box-shadow: var(--nx-glow);
  border-color: rgba(0, 229, 255, 0.35);
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
  display: block;
}

.woocommerce ul.products li.product img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-bottom: 1px solid var(--nx-border);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 1rem 1rem 0.35rem;
  margin: 0;
  color: var(--nx-text);
}

.woocommerce ul.products li.product .price {
  display: block;
  padding: 0 1rem 1rem;
  color: var(--nx-primary);
  font-weight: 600;
  font-size: 1.05rem;
}

.woocommerce ul.products li.product .price del {
  color: var(--nx-text-muted);
  opacity: 0.7;
  margin-right: 0.4rem;
}

.woocommerce ul.products li.product .button {
  margin: 0 1rem 1.15rem;
  width: calc(100% - 2rem);
}

/* ==========================================================================
   Single Product
   ========================================================================== */
.woocommerce div.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.woocommerce div.product .woocommerce-product-gallery {
  position: sticky;
  top: 100px;
}

.woocommerce div.product .woocommerce-product-gallery img {
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
}

.woocommerce div.product .product_title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.woocommerce div.product .price {
  font-size: 1.5rem;
  color: var(--nx-primary);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--nx-text-muted);
  margin-bottom: 1.5rem;
}

.woocommerce div.product form.cart {
  margin-bottom: 2rem;
}

.woocommerce div.product .quantity .qty {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
  border-radius: var(--nx-radius-sm);
  padding: 0.6rem;
  width: 70px;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
  border-radius: var(--nx-radius-sm);
  padding: 0.7rem 1rem;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--nx-primary);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--nx-surface);
  border-top: 1px solid var(--nx-border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.site-info {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--nx-border);
  color: var(--nx-text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.nx-section {
  padding: 4rem 0;
}

.nx-section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.85rem;
}

.nx-section-title span {
  background: linear-gradient(90deg, var(--nx-primary), var(--nx-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass card */
.nx-glass {
  background: rgba(21, 21, 31, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
}

/* ==========================================================================
   WooCommerce Notices
   ========================================================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  background: var(--nx-surface) !important;
  border: 1px solid var(--nx-border) !important;
  border-radius: var(--nx-radius-sm);
  color: var(--nx-text) !important;
}

.woocommerce-message {
  border-left: 4px solid var(--nx-success) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .woocommerce div.product {
    grid-template-columns: 1fr;
  }

  .main-navigation {
    display: none; /* Can be replaced by Breakdance mobile menu */
  }

  .nx-hero {
    padding: 3rem 0;
  }
}

/* Breakdance compatibility helpers */
.breakdance .site-header,
.breakdance .site-footer {
  /* Allow Breakdance to fully control header/footer when present */
}

body.breakdance-themeless .site-header,
body.breakdance-themeless .site-footer {
  display: none;
}

/* ==========================================================================
   Extra Responsive & Mobile
   ========================================================================== */
@media (max-width: 1024px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .site-title {
    font-size: 1.15rem;
  }
  .nx-hero h1 {
    font-size: 2rem;
  }
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.95rem;
    padding: 0.75rem 0.75rem 0.25rem;
  }
  .woocommerce ul.products li.product .price {
    padding: 0 0.75rem 0.75rem;
    font-size: 0.95rem;
  }
  .woocommerce ul.products li.product .button {
    margin: 0 0.75rem 0.9rem;
    width: calc(100% - 1.5rem);
    padding: 0.6rem;
    font-size: 0.85rem;
  }
  .nx-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr;
  }
  .nx-hero-actions {
    flex-direction: column;
  }
  .nx-btn, .button {
    width: 100%;
  }
}

/* Mobile menu toggle (simple) */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
}
@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }
  .main-navigation {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-navigation.toggled {
    display: block;
  }
  .main-navigation ul {
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
  }
  .main-navigation li {
    border-bottom: 1px solid var(--nx-border);
  }
  .main-navigation a {
    display: block;
    padding: 0.75rem 0;
  }
}

/* WooCommerce cart & checkout basic styling */
.woocommerce-cart .cart-collaterals,
.woocommerce-checkout .woocommerce {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  padding: 1.5rem;
}
.woocommerce table.shop_table {
  border-color: var(--nx-border) !important;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-color: var(--nx-border) !important;
  color: var(--nx-text);
}
.woocommerce-checkout #payment {
  background: var(--nx-surface-2) !important;
  border-radius: var(--nx-radius-sm);
}

/* Breakdance themeless helpers */
body.breakdance .site-header,
body.breakdance .site-footer,
.breakdance-zero-theme .site-header,
.breakdance-zero-theme .site-footer {
  /* When Breakdance is controlling the site these can be hidden via Global Settings */
}
