/*
Theme Name: APS Clone
Theme URI: https://example.com/aps-clone
Author: Aka AlaDin
Author URI: https://example.com/
Description: Dark digital storefront theme replicating the agedprofiles.com layout (dark theme, red accent, product grid, crypto checkout flow). WooCommerce-ready.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.8
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: aps-clone
*/

/* ============ DESIGN TOKENS ============ */
:root {
  --aps-bg: #121212;
  --aps-card: rgba(22, 22, 22, 0.75);
  --aps-card-solid: #161616;
  --aps-red: #FF4D4F;
  --aps-red-dark: #d63a3c;
  --aps-text: #ffffff;
  --aps-muted: #9a9a9a;
  --aps-border: rgba(255, 255, 255, 0.05);
  --aps-hover: rgba(255, 255, 255, 0.025);
  --aps-font: 'Poetsen One', system-ui, sans-serif;
}

/* ============ BASE ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--aps-bg);
  color: var(--aps-text);
  font-family: var(--aps-font);
  line-height: 1.6;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--aps-font); color: var(--aps-text); }
a { color: var(--aps-text); text-decoration: none; }
a:hover { color: var(--aps-red); }
img { max-width: 100%; height: auto; }

#aps-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}
.aps-page { position: relative; z-index: 1; }
.aps-container { max-width: 85rem; margin: 0 auto; padding: 0 1rem; }
.aps-main { padding: 1.5rem 0 3rem; }

/* ============ BUTTONS (square corners) ============ */
.aps-btn {
  display: inline-block;
  font-family: var(--aps-font);
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 0;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.aps-btn-primary { background: var(--aps-red); color: #fff; border-color: var(--aps-red); }
.aps-btn-primary:hover { background: var(--aps-red-dark); color: #fff; }
.aps-btn-outline { background: transparent; color: var(--aps-red); border-color: var(--aps-red); }
.aps-btn-outline:hover { background: var(--aps-red); color: #fff; }

/* ============ CARDS ============ */
.aps-card {
  background: var(--aps-card);
  border: 1px solid var(--aps-border);
  border-radius: 0;
  transition: background 0.2s;
}
.aps-card:hover { background: var(--aps-hover); }

/* ============ HEADER ============ */
.aps-header {
  background: rgba(22, 22, 22, 0.92);
  border-bottom: 1px solid var(--aps-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.aps-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}
.aps-brand { display: flex; align-items: center; gap: 0.7rem; }
.aps-brand:hover { color: var(--aps-text); }
.aps-logo-mark {
  width: 42px; height: 42px;
  background: var(--aps-red);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.aps-logo-mark svg { width: 22px; height: 22px; fill: #fff; }
.aps-wordmark { font-size: 1.3rem; margin: 0; color: #fff; }
.aps-nav { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; }
.aps-nav ul { display: flex; align-items: center; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.aps-nav a:not(.aps-btn) { color: var(--aps-text); }
.aps-nav a:not(.aps-btn):hover { color: var(--aps-red); }
.aps-nav .aps-login-btn { padding: 0.5rem 1.1rem; font-size: 0.95rem; }
.aps-cart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--aps-red);
  color: var(--aps-red);
  position: relative;
  border-radius: 0;
}
.aps-cart:hover { background: var(--aps-red); color: #fff; }
.aps-cart-count {
  position: absolute; top: -9px; right: -9px;
  background: var(--aps-red); color: #fff;
  font-size: 0.7rem; min-width: 20px; height: 20px; line-height: 20px;
  border-radius: 50%; text-align: center; padding: 0 4px;
}
.aps-menu-toggle {
  display: none;
  background: transparent; border: 1px solid var(--aps-border);
  color: #fff; font-size: 1.3rem; padding: 0.4rem 0.7rem;
  cursor: pointer; margin-left: auto; border-radius: 0;
}

/* ============ SEARCH ============ */
.aps-search-wrap {
  position: relative;
  margin: 0.5rem 0 1.5rem;
}
.aps-search-wrap .fa-magnifying-glass {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--aps-muted);
}
.aps-search-wrap input {
  width: 100%;
  background: var(--aps-card-solid);
  border: 1px solid var(--aps-border);
  color: #fff;
  font-family: var(--aps-font);
  font-size: 1rem;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border-radius: 0;
}
.aps-search-wrap input::placeholder { color: var(--aps-muted); }
.aps-search-wrap input:focus { outline: 1px solid var(--aps-red); }

/* ============ PRODUCT GRID ============ */
.aps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .aps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .aps-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1536px) { .aps-grid { grid-template-columns: repeat(4, 1fr); } }

.aps-product-card { display: flex; flex-direction: column; }
.aps-card-link { display: flex; flex-direction: column; flex: 1; color: var(--aps-text); }
.aps-card-link:hover { color: var(--aps-text); }
.aps-card-title {
  text-align: center;
  font-size: 1.02rem;
  margin: 0;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--aps-border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aps-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background: var(--aps-card-solid);
}
.aps-card-img--placeholder { min-height: 120px; }
.aps-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 0.9rem 0.4rem;
}
.aps-price { color: var(--aps-red); font-size: 1.2rem; }
.aps-stock { color: var(--aps-muted); font-size: 0.92rem; }
.aps-card-btn { display: block; margin: 0.5rem 0.9rem 0.9rem; }
.aps-card-btn .fa-arrow-right { margin-left: 0.4rem; font-size: 0.85em; }

/* ============ WARNING CARD ============ */
.aps-warning { padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.aps-warning p { margin: 0; color: var(--aps-muted); font-size: 0.92rem; }

/* ============ FEATURE BLOCKS ============ */
.aps-features {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) { .aps-features { grid-template-columns: repeat(3, 1fr); } }
.aps-feature { text-align: center; padding: 1.75rem 1.25rem; }
.aps-feature i { color: var(--aps-red); font-size: 2.4rem; margin-bottom: 0.75rem; }
.aps-feature h3 { margin: 0 0 0.5rem; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; }
.aps-feature p { margin: 0; color: var(--aps-muted); font-size: 0.92rem; }

/* ============ FOOTER ============ */
.aps-footer { border-top: 1px solid var(--aps-border); padding: 1.5rem 0; background: rgba(22,22,22,0.6); }
.aps-footer-row { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.35rem 0; }
.aps-footer-brand { color: var(--aps-text); font-size: 1.05rem; }
.aps-telegram { color: var(--aps-text); font-size: 1.3rem; }
.aps-telegram:hover { color: #229ED9; }
.aps-footer-copy { color: var(--aps-muted); font-size: 0.9rem; }

/* ============ LOGIN MODAL ============ */
.aps-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.aps-modal.open { display: flex; }
.aps-modal-card {
  background: var(--aps-card-solid);
  border: 1px solid var(--aps-border);
  padding: 2rem;
  width: 100%; max-width: 420px;
  position: relative;
}
.aps-modal-card h2 { margin: 0 0 1.25rem; font-size: 1.25rem; text-align: center; }
.aps-modal-close {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: transparent; border: none; color: var(--aps-muted);
  font-size: 1.2rem; cursor: pointer;
}
.aps-modal-card label { display: block; margin-bottom: 1rem; color: var(--aps-muted); font-size: 0.9rem; }
.aps-modal-card input {
  display: block; width: 100%; margin-top: 0.35rem;
  background: var(--aps-bg); border: 1px solid var(--aps-border);
  color: #fff; font-family: var(--aps-font); padding: 0.7rem; border-radius: 0;
}
.aps-modal-card .aps-btn { width: 100%; }

/* ============ SHOP / FILTERS ============ */
.aps-shop-title { font-size: 1.8rem; margin: 0.5rem 0 0.25rem; }
.aps-shop-title::after {
  content: ""; display: block; width: 64px; height: 3px;
  background: var(--aps-red); margin-top: 0.4rem;
}
.aps-shop-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 1024px) { .aps-shop-layout { grid-template-columns: 260px 1fr; } }
.aps-filters { background: var(--aps-card); border: 1px solid var(--aps-border); padding: 1.25rem; align-self: start; }
.aps-filters h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.aps-filters label { display: block; margin-bottom: 1rem; color: var(--aps-muted); font-size: 0.9rem; }
.aps-filters input, .aps-filters select {
  display: block; width: 100%; margin-top: 0.35rem;
  background: var(--aps-bg); border: 1px solid var(--aps-border);
  color: #fff; font-family: var(--aps-font); padding: 0.6rem; border-radius: 0;
}
.aps-price-range { display: flex; gap: 0.5rem; }
.aps-filters .aps-btn { width: 100%; margin-bottom: 0.6rem; }

/* ============ SINGLE PRODUCT ============ */
.aps-sp-title { font-size: 1.7rem; margin: 0.5rem 0 1.25rem; }
.aps-sp-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (min-width: 1024px) { .aps-sp-grid { grid-template-columns: 1.2fr 1fr; } }
.aps-sp-gallery { padding: 0.75rem; }
.aps-sp-img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; display: block; background: var(--aps-card-solid); }
.aps-sp-panel { padding: 1.5rem; }
.aps-sp-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.aps-sp-price { color: var(--aps-red); font-size: 2rem; }
.aps-sp-each { color: var(--aps-muted); font-size: 0.95rem; margin-left: 0.4rem; }
.aps-qty-label { display: block; color: var(--aps-muted); margin-bottom: 0.4rem; }
.aps-qty { display: flex; align-items: stretch; margin-bottom: 1.25rem; max-width: 200px; }
.aps-qty-btn {
  background: var(--aps-bg); border: 1px solid var(--aps-border);
  color: #fff; font-size: 1.2rem; width: 44px; cursor: pointer; border-radius: 0;
}
.aps-qty-btn.aps-qty-plus { background: var(--aps-red); border-color: var(--aps-red); }
.aps-qty input.qty {
  width: 60px; text-align: center;
  background: var(--aps-bg); border: 1px solid var(--aps-border); border-left: none; border-right: none;
  color: #fff; font-family: var(--aps-font); font-size: 1.05rem; padding: 0.55rem 0;
}
.aps-sp-panel .aps-btn { width: 100%; margin-bottom: 0.7rem; }
.aps-sp-panel .aps-btn .fa-solid { margin-right: 0.5rem; }
.aps-sp-specs { padding: 1.5rem; margin-bottom: 2rem; }
.aps-sp-specs ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.aps-sp-specs li { margin-bottom: 0.35rem; }
.aps-sp-specs p { color: var(--aps-muted); margin: 0; }
.aps-sp-related-title { font-size: 1.4rem; margin: 0 0 1.25rem; }

/* ============ WOOCOMMERCE DARK OVERRIDES ============ */
.woocommerce table.shop_table,
.woocommerce .cart_totals table,
.woocommerce-checkout #order_review {
  background: var(--aps-card); border: 1px solid var(--aps-border); border-radius: 0; color: var(--aps-text);
}
.woocommerce table.shop_table th, .woocommerce table.shop_table td { border-color: var(--aps-border); }
.woocommerce input[type="text"], .woocommerce input[type="email"], .woocommerce input[type="tel"],
.woocommerce input[type="number"], .woocommerce input[type="password"], .woocommerce textarea, .woocommerce select,
.woocommerce-checkout .input-text {
  background: var(--aps-bg) !important; border: 1px solid var(--aps-border) !important;
  color: #fff !important; border-radius: 0 !important; font-family: var(--aps-font);
  padding: 0.7rem !important;
}
.woocommerce label { color: var(--aps-muted); }
.woocommerce .button, .woocommerce button.button, .woocommerce a.button,
.woocommerce #respond input#submit, .woocommerce input.button {
  background: var(--aps-red) !important; color: #fff !important;
  border-radius: 0 !important; font-family: var(--aps-font); font-weight: 400;
}
.woocommerce .button:hover, .woocommerce button.button:hover, .woocommerce a.button:hover { background: var(--aps-red-dark) !important; color: #fff !important; }
.woocommerce .button:disabled, .woocommerce .button.disabled { opacity: 0.5; }
.woocommerce-error, .woocommerce-info, .woocommerce-message {
  background: var(--aps-card); border: 1px solid var(--aps-border); border-top: 3px solid var(--aps-red); color: var(--aps-text);
}
.woocommerce-error::before, .woocommerce-info::before, .woocommerce-message::before { color: var(--aps-red); }
.woocommerce #payment, .woocommerce-checkout #payment { background: var(--aps-card); border-radius: 0; }
.woocommerce #payment div.payment_box { background: var(--aps-bg); color: var(--aps-muted); }
.woocommerce #payment div.payment_box::before { border-bottom-color: var(--aps-bg); }
.woocommerce .cart-empty { background: var(--aps-card); border: 1px solid var(--aps-border); padding: 2rem; text-align: center; }
.woocommerce a.remove { color: var(--aps-red) !important; }
.woocommerce a.remove:hover { background: var(--aps-red) !important; color: #fff !important; }
.woocommerce .quantity .qty { background: var(--aps-bg); border: 1px solid var(--aps-border); color: #fff; border-radius: 0; }

/* ============ MOBILE NAV ============ */
@media (max-width: 1023px) {
  .aps-menu-toggle { display: inline-block; }
  .aps-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(22,22,22,0.98);
    border-bottom: 1px solid var(--aps-border);
    flex-direction: column; align-items: stretch;
    padding: 1rem; gap: 0.75rem; margin-left: 0;
  }
  .aps-header { position: relative; }
  .aps-header-inner { position: static; }
  .aps-nav.open { display: flex; }
  .aps-nav ul { flex-direction: column; align-items: stretch; gap: 0.75rem; }
}
