/*
Theme Name:  DivvyDen Shop
Description: DivvyDen's own look for the WooCommerce shop at shop.divvyden.com. Pairs with the DivvyDen Connect plugin, which syncs the products and runs checkout.
Version:     1.0.1
Author:      Otto Web Solutions, LLC
Requires PHP: 7.4
Text Domain: divvyden-shop
*/

/* Colors, type and spacing are copied from DivvyDen's Angular styles
   (frontend/src/app/shared/public-layout.component.ts and features/store/*)
   — change them there first, then here, so the two sites stay identical. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: #1e293b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
.dds-main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: #667eea; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.dd-icon { display: inline-block; }
[hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.pub-nav {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #f1f5f9; transition: box-shadow .2s;
}
.admin-bar .pub-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .pub-nav { top: 46px; } }
.pub-nav.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.pub-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px; height: 64px;
}
.pub-logo {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 18px; font-weight: 800; color: #1e293b; flex-shrink: 0;
}
.pub-logo-img { width: 28px; height: 28px; object-fit: contain; }
.pub-nav-links { display: flex; gap: 28px; align-items: center; flex: 1; }
.pub-nav-links a {
  text-decoration: none; font-size: 14px; font-weight: 500; color: #64748b; transition: color .15s;
}
.pub-nav-links a:hover, .pub-nav-links a.active { color: #667eea; }
.pub-nav-cta { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.pub-btn-ghost {
  text-decoration: none; font-size: 14px; font-weight: 600; color: #374151; padding: 8px 14px;
  border-radius: 8px; transition: background .15s;
}
.pub-btn-ghost:hover { background: #f1f5f9; }
.pub-btn-solid {
  display: inline-block; text-decoration: none; font-size: 14px; font-weight: 700; color: #fff;
  background: #667eea; padding: 9px 18px; border-radius: 8px; transition: background .15s;
}
.pub-btn-solid:hover { background: #5a6fd6; color: #fff; }
.pub-hamburger {
  display: none; background: none; border: none; cursor: pointer; padding: 10px;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
  margin-left: auto; color: #374151;
}
.pub-hamburger .dd-icon { width: 24px; height: 24px; }
.pub-mobile-menu {
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border-top: 1px solid #f1f5f9; padding: 16px 24px;
}
.pub-mobile-menu a {
  text-decoration: none; font-size: 15px; font-weight: 500; color: #374151; padding: 10px 0; display: block;
}
.pub-mobile-menu a:hover { color: #667eea; }
.pub-mobile-menu hr { border: none; border-top: 1px solid #f1f5f9; margin: 8px 0; width: 100%; }
.pub-mobile-menu .pub-mobile-cta { color: #667eea; font-weight: 700; }
@media (max-width: 640px) {
  .pub-nav-links, .pub-nav-cta { display: none; }
  .pub-hamburger { display: flex; }
}
@media (min-width: 641px) { .pub-mobile-menu { display: none !important; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.pub-footer { background: #0f172a; color: #94a3b8; margin-top: auto; }
.pub-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 32px;
  display: grid; grid-template-columns: 1fr auto; gap: 48px;
}
.pub-footer-brand p { font-size: 14px; line-height: 1.6; margin: 12px 0 0; max-width: 260px; }
.pub-footer-brand .pub-footer-company { font-size: 13px; }
.pub-footer-company a { color: #cbd5e1; }
.pub-footer-company a:hover { color: #fff; }
.pub-footer-logo { font-size: 20px; font-weight: 800; color: #fff; text-decoration: none; }
.pub-footer-logo:hover { color: #a78bfa; }
.pub-footer-links { display: flex; gap: 48px; }
.pub-footer-col { display: flex; flex-direction: column; gap: 10px; }
.pub-footer-col a { font-size: 14px; color: #94a3b8; text-decoration: none; transition: color .15s; }
.pub-footer-col a:hover { color: #fff; }
.pub-footer-heading {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #e2e8f0; margin-bottom: 4px;
}
.pub-footer-bottom {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px; border-top: 1px solid #1e293b; font-size: 13px;
}
@media (max-width: 640px) { .pub-footer-inner { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .pub-footer-links { gap: 24px; flex-wrap: wrap; } }

/* ── Store (archive) ────────────────────────────────────────────────────── */
.store-page { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }
.store-hero { text-align: center; padding: 60px 0 40px; }
.store-hero h1 { font-size: 36px; font-weight: 800; color: #1e293b; margin: 0 0 8px; }
.store-hero p { font-size: 16px; color: #64748b; margin: 0 0 24px; }
@media (max-width: 640px) { .store-hero { padding: 40px 0 28px; } .store-hero h1 { font-size: 28px; } }
.store-search {
  display: flex; align-items: center; max-width: 480px; margin: 0 auto;
  background: #fff; border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden;
}
.store-search:focus-within { border-color: #667eea; }
.store-search .dd-icon { margin: 0 12px; color: #94a3b8; width: 22px; height: 22px; }
.store-search input[type="search"] {
  flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; padding: 12px 0; font-family: inherit; background: transparent;
}
.store-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.store-search button {
  border: none; background: #667eea; color: #fff; padding: 12px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; border-radius: 0 10px 10px 0;
}

.store-empty { text-align: center; padding: 80px 24px; color: #94a3b8; }
.store-empty .dd-icon { width: 48px; height: 48px; display: block; margin: 0 auto 12px; }
.store-empty p { font-size: 16px; margin: 0; }

.store-meta { font-size: 13px; color: #94a3b8; margin-bottom: 16px; }
.store-meta strong { color: #475569; font-weight: 700; }
.store-clear { padding-left: 8px; color: #667eea; font-size: 13px; font-weight: 600; text-decoration: none; }
.store-clear:hover { text-decoration: underline; }

.store-filters {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid #e2e8f0;
}
.store-type-tabs {
  display: flex; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 12px;
  overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.store-type-tabs::-webkit-scrollbar { display: none; }
.store-type-tab {
  flex-shrink: 0; white-space: nowrap; color: #64748b; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; transition: background .15s, color .15s;
}
.store-type-tab:hover { color: #1e293b; }
.store-type-tab.active { background: #fff; color: #667eea; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.store-cat-select {
  position: relative; flex-shrink: 0; display: flex; align-items: center;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #64748b; transition: border-color .15s;
}
.store-cat-select:hover, .store-cat-select:focus-within, .store-cat-select.active { border-color: #667eea; }
.store-cat-select.active { color: #667eea; }
.store-cat-select::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg);
}
.store-cat-select select {
  appearance: none; -webkit-appearance: none; border: none; outline: none; background: transparent;
  color: inherit; font-size: 13px; font-weight: 600; font-family: inherit;
  padding: 9px 34px 9px 14px; cursor: pointer; max-width: 240px;
}
@media (max-width: 640px) {
  .store-filters { flex-direction: column; align-items: stretch; }
  .store-cat-select select { max-width: none; width: 100%; }
}

.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.store-card {
  position: relative; background: #fff; border-radius: 16px; border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.store-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.1); transform: translateY(-2px); }
.store-card-link { position: absolute; inset: 0; z-index: 1; }
.store-card-cover {
  height: 260px; padding: 18px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; background: linear-gradient(135deg, #667eea, #764ba2);
}
.store-card-cover > .dd-icon { width: 40px; height: 40px; color: rgba(255,255,255,.6); }
.store-card-cover-backdrop {
  position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); max-width: none;
  object-fit: cover; filter: blur(18px) brightness(.85); transform: scale(1.05);
}
.store-card-cover-img {
  position: relative; max-width: 100%; max-height: 100%; width: auto; object-fit: contain;
  border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .2s;
}
.store-card:hover .store-card-cover-img { transform: scale(1.03); }
.store-type-badge {
  position: absolute; top: 8px; left: 8px; color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px);
}
.badge-ebook  { background: rgba(102,126,234,.85); }
.badge-course { background: rgba(139,92,246,.85); }
.badge-pb     { background: rgba(16,185,129,.85); }
.badge-puzzle { background: rgba(245,158,11,.85); }
.store-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.store-card-title { font-size: 15px; font-weight: 700; color: #1e293b; margin: 0; line-height: 1.35; }
.store-card-sub { font-size: 12px; color: #64748b; font-style: italic; }
.store-card-author {
  position: relative; z-index: 2; display: inline-block; font-size: 12px; color: #667eea; font-weight: 600;
  width: fit-content; text-decoration: none;
}
.store-card-author:hover { text-decoration: underline; }
.store-card-cat { font-size: 11px; font-weight: 700; background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.store-card-desc { font-size: 12px; color: #64748b; line-height: 1.5; margin-top: 4px; flex: 1; }
.store-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.store-card-price { font-size: 15px; font-weight: 800; color: #1e293b; }

.store-pagination { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 40px; }
.store-pagination a, .store-pagination .is-disabled {
  padding: 8px 18px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 13px;
  color: #1e293b; text-decoration: none;
}
.store-pagination .is-disabled { opacity: .4; }
.store-page-count { font-size: 14px; color: #64748b; }

/* ── Product page ───────────────────────────────────────────────────────── */
.bd-page { max-width: 1040px; margin: 0 auto; padding: 28px 24px 80px; }
.bd-crumbs { font-size: 13px; color: #94a3b8; margin-bottom: 24px; display: flex; gap: 8px; }
.bd-crumbs a { color: #64748b; text-decoration: none; }
.bd-crumbs a:hover { color: #667eea; }
.bd-layout { display: grid; grid-template-columns: 380px 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .bd-layout { grid-template-columns: 300px 1fr; gap: 32px; } }
@media (max-width: 680px) { .bd-layout { grid-template-columns: 1fr; } }
.bd-cover {
  border-radius: 16px; aspect-ratio: 3/4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden; position: relative;
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
}
@media (max-width: 680px) { .bd-cover { width: 100%; max-width: 360px; margin: 0 auto; } }
.bd-cover > .dd-icon { width: 48px; height: 48px; opacity: .5; margin-bottom: 16px; }
.bd-cover-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.bd-cover.has-image { aspect-ratio: auto; padding: 0; background: none; }
.bd-cover-img { display: block; width: 100%; height: auto; border-radius: 16px; }

.bd-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bd-author { font-size: 13px; color: #667eea; font-weight: 600; margin: 0; }
.bd-author-link { color: inherit; text-decoration: none; }
.bd-author-link:hover { text-decoration: underline; }
.bd-title { font-size: 28px; font-weight: 800; color: #1e293b; margin: 0; line-height: 1.3; }
.bd-subtitle { font-size: 16px; color: #64748b; font-style: italic; margin: 0; }
.bd-category {
  font-size: 12px; font-weight: 700; background: #f1f5f9; color: #64748b; padding: 3px 10px;
  border-radius: 999px; width: fit-content; text-decoration: none;
}
.bd-price-row { display: flex; align-items: center; gap: 16px; }
.bd-price { font-size: 28px; font-weight: 800; color: #1e293b; }
.bd-desc { font-size: 15px; color: #374151; line-height: 1.7; }
.bd-desc p { margin: 0 0 12px; }
.bd-desc h2 { font-size: 17px; font-weight: 800; color: #1e293b; margin: 20px 0 8px; }
.bd-desc ul { margin: 0; padding-left: 20px; }
.bd-desc li { margin: 4px 0; }
.bd-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
}
.bd-details dt { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.bd-details dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: #1e293b; }
.bd-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-kw { font-size: 12px; background: #f1f5f9; color: #64748b; padding: 4px 10px; border-radius: 999px; text-decoration: none; }
.bd-kw:hover { color: #667eea; }

/* ── Plain pages, 404 ───────────────────────────────────────────────────── */
.dds-page { max-width: 760px; margin: 0 auto; padding: 60px 24px 80px; line-height: 1.7; }
.dds-page h1 { font-size: 32px; font-weight: 800; margin: 0 0 16px; }
.dds-404 { text-align: center; color: #64748b; }
.dds-404 > .dd-icon { width: 48px; height: 48px; color: #94a3b8; }
.dds-404 h1 { color: #1e293b; }
