/*
Theme Name: Digital Hub
Theme URI: https://debmediatechnologies.com
Author: Debasis Bhattacharjee
Author URI: https://debasisbhattacharjee.com
Description: A premium digital products showcase theme with admin panel management. List and showcase your digital products beautifully with pricing tiers, categories, and direct offer links.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: digital-hub
Tags: digital-products, showcase, custom-post-type, dark-theme
*/

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
  --primary:       #e8a020;
  --primary-hover: #f5b830;
  --accent:        #1a7abf;
  --accent2:       #13a55e;
  --bg-dark:       #0d1117;
  --bg-card:       #161b22;
  --bg-header:     #0a0f14;
  --bg-section:    #111518;
  --border:        #2a3040;
  --text:          #e0e6ef;
  --text-muted:    #7a8a9e;
  --text-light:    #b0bec5;
  --tag-bg:        #1e2d40;
  --tag-color:     #5bc4f0;
  --radius:        8px;
  --shadow:        0 4px 24px rgba(0,0,0,0.45);
  --font-head:     'Rajdhani', 'Segoe UI', sans-serif;
  --font-body:     'Source Sans 3', 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-hover); }

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

/* ============================================================
   GOOGLE FONTS IMPORT (loaded via functions.php)
============================================================ */

/* ============================================================
   SITE HEADER
============================================================ */
#site-header {
  background: var(--bg-header);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.6);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.site-logo .rocket { font-size: 1.5rem; }

.site-logo span.sub {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: .5px;
}

/* NAV */
#main-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
}

#main-nav a {
  color: var(--text-light);
  font-size: .9rem;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all .2s;
}

#main-nav a:hover,
#main-nav a.active {
  color: var(--primary);
  background: rgba(232,160,32,.08);
}

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}

/* ============================================================
   HERO BANNER
============================================================ */
#hero-banner {
  background: linear-gradient(135deg, #0d1117 0%, #0a1a2e 50%, #0d1117 100%);
  border-bottom: 1px solid var(--border);
  padding: 36px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(26,122,191,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 50%, rgba(232,160,32,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.hero-inner h1 {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-inner h1 span { color: var(--primary); }

.hero-inner p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================================
   MAIN LAYOUT
============================================================ */
#main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ============================================================
   SECTION TITLE
============================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title h2 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.section-title .title-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
  border-radius: 2px;
}

.section-title .badge {
  background: var(--primary);
  color: #000;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ============================================================
   FILTER BAR
============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  align-items: center;
}

.filter-bar label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-right: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  font-weight: 600;
}

/* ============================================================
   PRODUCT CARDS GRID
============================================================ */
#products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ============================================================
   SINGLE PRODUCT CARD
============================================================ */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .2s;
  position: relative;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 32px rgba(232,160,32,.15);
  transform: translateY(-2px);
}

/* CARD IMAGE */
.card-image-wrap {
  width: 160px;
  min-width: 160px;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card-image-wrap::after {
  content: '🔍';
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: .75rem;
  background: rgba(0,0,0,.65);
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .2s;
}

.card-image-wrap:hover::after { opacity: 1; }

.card-image-wrap img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 4px;
  transition: transform .3s;
}

.card-image-wrap:hover img { transform: scale(1.04); }

/* CARD BODY */
.card-body {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* product name */
.card-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

/* tags row */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}

.card-tag {
  background: var(--tag-bg);
  color: var(--tag-color);
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border: 1px solid rgba(91,196,240,.2);
}

/* snippet */
.card-snippet {
  color: var(--text-light);
  font-size: .88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CARD RIGHT: prices + buttons */
.card-right {
  width: 190px;
  min-width: 190px;
  padding: 16px 16px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  justify-content: center;
}

/* pricing tiers */
.price-tiers {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.price-tier {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 9px;
}

.tier-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.tier-price {
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent2);
  font-family: var(--font-head);
}

.no-price {
  text-align: center;
  color: var(--text-muted);
  font-size: .78rem;
  font-style: italic;
}

/* buttons */
.btn-offer {
  display: block;
  background: var(--primary);
  color: #000 !important;
  font-weight: 700;
  font-size: .88rem;
  text-align: center;
  padding: 9px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: background .2s, transform .15s;
  font-family: var(--font-head);
}

.btn-offer:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  color: #000 !important;
}

.btn-learn {
  display: block;
  background: transparent;
  color: var(--text-light) !important;
  font-weight: 600;
  font-size: .82rem;
  text-align: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all .2s;
  font-family: var(--font-body);
}

.btn-learn:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: rgba(26,122,191,.08);
}

/* NEW badge on card */
.card-new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent2);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
  z-index: 2;
}

/* ============================================================
   LIGHTBOX
============================================================ */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 60px rgba(0,0,0,.8);
  cursor: default;
}

#lightbox-close {
  position: fixed;
  top: 20px;
  right: 26px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: .7;
  transition: opacity .2s;
}

#lightbox-close:hover { opacity: 1; }

/* ============================================================
   EMPTY STATE
============================================================ */
.no-products {
  text-align: center;
  color: var(--text-muted);
  padding: 80px 20px;
  font-size: 1rem;
}

.no-products .icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================================
   FOOTER
============================================================ */
#site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

#site-footer a { color: var(--text-muted); }
#site-footer a:hover { color: var(--primary); }

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   ADMIN NOTICE HELPER
============================================================ */
.dh-admin-notice {
  background: rgba(232,160,32,.1);
  border-left: 4px solid var(--primary);
  padding: 12px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 28px;
  font-size: .9rem;
  color: var(--text-light);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .card-right {
    width: 160px;
    min-width: 160px;
  }
}

@media (max-width: 680px) {
  .product-card {
    flex-direction: column;
  }

  .card-image-wrap {
    width: 100%;
    min-width: unset;
    height: 160px;
    padding: 16px;
  }

  .card-image-wrap img {
    height: 130px;
    width: auto;
    max-width: 100%;
  }

  .card-right {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }

  .price-tiers { flex: 1; min-width: 140px; }

  .btn-offer, .btn-learn { flex: 1; min-width: 100px; }

  .header-inner { position: relative; }

  #main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
    z-index: 999;
  }

  #main-nav.open { display: block; }

  #main-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .nav-toggle { display: flex; }

  .hero-inner h1 { font-size: 1.6rem; }
}

@media (max-width: 420px) {
  .card-image-wrap { height: 130px; }
  .card-title { font-size: 1.05rem; }
}
