/*
 Theme Name:   Death and Dissonance
 Theme URI:    https://deathanddissonance.com
 Description:  Death & Dissonance metal distro shop — child theme of Storefront
 Author:       Ryan Miller
 Author URI:   https://deathanddissonance.com
 Template:     storefront
 Version:      1.0.0
 Text Domain:  dnd-child
*/

  /* ==============================
     CSS VARIABLES
  ============================== */
  :root {
    --bg:        #080808;
    --bg2:       #111111;
    --bg3:       #1a1a1a;
    --border:    #2a2a2a;
    --text:      #d8d4cc;
    --text-dim:  #8a8680;
    --accent:    #a80000;
    --accent2:   #cc2200;
    --white:     #f0ece4;
    --font-head: 'Bebas Neue', 'Impact', sans-serif;
    --font-body: 'Courier Prime', 'Courier New', monospace;
    --font-title:'UnifrakturMaguntia', serif;
  }

  /* ==============================
     RESET & BASE
  ============================== */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    min-height: 100vh;
    /* Subtle grain overlay */
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  }

  a { color: inherit; text-decoration: none; }
  img { display: block; width: 100%; }

  /* ==============================
     HEADER / MASTHEAD
  ============================== */
  .masthead {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 2rem;
  }

  .masthead-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    flex-shrink: 0;
  }

  .brand-sigil {
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 18px;
    color: var(--accent);
    letter-spacing: 0;
    position: relative;
  }
  .brand-sigil::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(168,0,0,0.3);
  }

  .brand-name {
    font-family: var(--font-title);
    font-size: 22px;
    color: var(--white);
    letter-spacing: 1px;
    line-height: 1;
  }
  .brand-sub {
    font-family: var(--font-body);
    font-size: 9px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 3px;
  }

  .masthead-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
  }

  .masthead-nav a {
    display: flex;
    align-items: center;
    padding: 0 1.1rem;
    font-family: var(--font-head);
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
  }
  .masthead-nav a:first-child { border-left: 1px solid var(--border); }
  .masthead-nav a:hover { color: var(--white); background: var(--bg2); }
  .masthead-nav a.active {
    color: var(--white);
    background: var(--bg2);
    border-bottom: 2px solid var(--accent);
  }

  .masthead-cart {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0 0 1.5rem;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    flex-shrink: 0;
    cursor: pointer;
    transition: color 0.15s;
  }
  .masthead-cart:hover { color: var(--white); }
  .cart-icon {
    width: 18px;
    height: 14px;
    border: 1px solid currentColor;
    position: relative;
    top: 1px;
  }
  .cart-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 3px;
    width: 10px;
    height: 6px;
    border: 1px solid currentColor;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
  }
  .cart-count {
    background: var(--accent);
    color: white;
    font-size: 9px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
  }

  /* ==============================
     CATEGORY BANNER
  ============================== */
  .cat-banner {
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 2rem 2rem;
    position: relative;
    overflow: hidden;
  }
  .cat-banner::before {
    content: 'LP';
    position: absolute;
    right: -1rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-head);
    font-size: 160px;
    color: rgba(168,0,0,0.05);
    line-height: 1;
    pointer-events: none;
    user-select: none;
  }

  .cat-breadcrumb {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
  }
  .cat-breadcrumb a:hover { color: var(--accent); }
  .cat-breadcrumb span { margin: 0 0.5rem; color: var(--border); }

  .cat-title {
    font-family: var(--font-head);
    font-size: 52px;
    letter-spacing: 4px;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.4rem;
  }

  .cat-count {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
  }

  /* ==============================
     TOOLBAR (sort/filter/count)
  ============================== */
  .toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    gap: 1rem;
    flex-wrap: wrap;
  }

  .toolbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .toolbar-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dim);
  }

  .filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .pill {
    padding: 3px 10px;
    border: 1px solid var(--border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-body);
  }
  .pill:hover { border-color: var(--text-dim); color: var(--text); }
  .pill.active {
    border-color: var(--accent);
    color: var(--white);
    background: rgba(168,0,0,0.12);
  }

  .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .sort-select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 11px;
    padding: 4px 8px;
    cursor: pointer;
    letter-spacing: 1px;
  }
  .sort-select:focus { outline: none; border-color: var(--accent); }

  /* ==============================
     MAIN LAYOUT
  ============================== */
  .shop-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: calc(100vh - 200px);
  }

  /* ==============================
     SIDEBAR
  ============================== */
  .sidebar {
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    position: sticky;
    top: 57px;
    height: calc(100vh - 57px);
    overflow-y: auto;
  }

  .sidebar-section { margin-bottom: 2rem; }

  .sidebar-heading {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    padding: 0 1.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }

  .sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1.5rem;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-dim);
    transition: all 0.12s;
    border-left: 2px solid transparent;
  }
  .sidebar-nav a:hover {
    color: var(--white);
    background: var(--bg2);
    border-left-color: var(--border);
  }
  .sidebar-nav a.active {
    color: var(--white);
    background: var(--bg2);
    border-left-color: var(--accent);
  }
  .sidebar-nav .count {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.6;
  }

  .price-filter {
    padding: 0 1.5rem;
  }
  .price-range {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
  }
  .price-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 11px;
    padding: 4px 6px;
    width: 65px;
  }
  .price-input:focus { outline: none; border-color: var(--accent); }
  .price-sep { color: var(--text-dim); font-size: 11px; }

  .btn-small {
    background: var(--accent);
    border: none;
    color: white;
    font-family: var(--font-head);
    font-size: 12px;
    letter-spacing: 1px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .btn-small:hover { background: var(--accent2); }

  /* ==============================
     PRODUCT GRID
  ============================== */
  .shop-main { padding: 2rem; }

  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 1.5px;
    margin-bottom: 3rem;
    background: var(--border);
    border: 1px solid var(--border);
  }

  .product-card {
    background: var(--bg);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    overflow: hidden;
  }
  .product-card:hover {
    background: var(--bg2);
    z-index: 2;
  }

  .product-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg3);
  }
  .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s;
    filter: grayscale(15%);
  }
  .product-card:hover .product-img img {
    transform: scale(1.04);
    filter: grayscale(0%);
  }

  .product-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8,8,8,0.7) 0%, transparent 50%);
    pointer-events: none;
  }

  .product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: white;
    font-size: 8px;
    font-family: var(--font-head);
    letter-spacing: 1px;
    padding: 2px 6px;
    text-transform: uppercase;
  }

  .product-info {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .product-artist {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-title {
    font-size: 12px;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 700;
  }

  .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .product-price {
    font-family: var(--font-head);
    font-size: 17px;
    color: var(--white);
    letter-spacing: 0.5px;
  }

  .product-format {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 1px 5px;
  }

  .btn-add {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .btn-add:hover {
    border-color: var(--accent);
    color: var(--white);
    background: rgba(168,0,0,0.1);
  }

  /* ==============================
     PAGINATION
  ============================== */
  .pagination {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
  }

  .page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    margin: 0 -1px 0 0;
    font-size: 12px;
    font-family: var(--font-body);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.12s;
    background: transparent;
    text-decoration: none;
  }
  .page-btn:hover { background: var(--bg2); color: var(--white); z-index: 1; }
  .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    z-index: 1;
  }

  /* ==============================
     FOOTER
  ============================== */
  footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    background: var(--bg2);
  }

  .footer-col-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 0.8rem;
  }

  .footer-col a {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
    letter-spacing: 0.5px;
    transition: color 0.12s;
  }
  .footer-col a:hover { color: var(--white); }

  .footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg2);
  }

  .footer-bottom-text {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  /* ==============================
     HOVER QUICK-VIEW PANEL
     (shown on product hover)
  ============================== */
  .product-card .quick-view {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(8,8,8,0.92);
    backdrop-filter: blur(4px);
    padding: 0.6rem 0.75rem;
    transform: translateY(100%);
    transition: transform 0.2s ease;
    border-top: 1px solid var(--accent);
  }
  .product-card:hover .quick-view {
    transform: translateY(0);
  }
  .quick-view-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-align: center;
  }

  /* ==============================
     EMPTY PLACEHOLDER IMAGES
     (while no real images loaded)
  ============================== */
  .img-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 2px;
  }

  /* ==============================
     SCROLL REVEAL ANIMATION
  ============================== */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .product-card {
    animation: fadeUp 0.4s ease both;
  }
  .product-card:nth-child(1)  { animation-delay: 0.02s; }
  .product-card:nth-child(2)  { animation-delay: 0.04s; }
  .product-card:nth-child(3)  { animation-delay: 0.06s; }
  .product-card:nth-child(4)  { animation-delay: 0.08s; }
  .product-card:nth-child(5)  { animation-delay: 0.10s; }
  .product-card:nth-child(6)  { animation-delay: 0.12s; }
  .product-card:nth-child(7)  { animation-delay: 0.14s; }
  .product-card:nth-child(8)  { animation-delay: 0.16s; }
  .product-card:nth-child(9)  { animation-delay: 0.18s; }
  .product-card:nth-child(10) { animation-delay: 0.20s; }
  .product-card:nth-child(n+11){ animation-delay: 0.22s; }

  /* ==============================
     RESPONSIVE
  ============================== */
  @media (max-width: 900px) {
    .shop-layout { grid-template-columns: 1fr; }
    .sidebar {
      position: static;
      height: auto;
      border-right: none;
      border-bottom: 1px solid var(--border);
      padding: 1rem 0;
    }
    .sidebar-nav a { padding: 0.35rem 1rem; }
    footer { grid-template-columns: repeat(2, 1fr); }
    .masthead-nav { display: none; }
    .cat-banner::before { display: none; }
  }

  @media (max-width: 600px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-title { font-size: 36px; }
    footer { grid-template-columns: 1fr; }
    .masthead { padding: 0 1rem; }
    .shop-main { padding: 1rem; }
  }
