/*
Theme Name: Product Directory
Description: Premium product directory theme with search, category sidebar and card grid. Requires the Product Directory plugin.
Version: 1.1.0
Text Domain: product-directory-theme
*/

:root {
    --pd-blue-900: #0b1f4d;
    --pd-blue-700: #1e40af;
    --pd-blue-600: #2563eb;
    --pd-blue-500: #3b82f6;
    --pd-blue-100: #dbeafe;
    --pd-blue-50: #eff6ff;
    --pd-ink: #0f172a;
    --pd-text: #1e293b;
    --pd-muted: #64748b;
    --pd-line: #e2e8f0;
    --pd-bg: #f5f8ff;
    --pd-card: #ffffff;
    --pd-radius: 18px;
    --pd-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -16px rgba(37, 99, 235, .18);
    --pd-shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 28px 56px -20px rgba(37, 99, 235, .32);
    --pd-ease: cubic-bezier(.2, .8, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Inter", "Hind Siliguri", -apple-system, system-ui, sans-serif;
    color: var(--pd-text);
    background: var(--pd-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--pd-blue-600); }
:focus-visible { outline: 2px solid var(--pd-blue-500); outline-offset: 2px; border-radius: 8px; }

.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.pd-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.pd-topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, .7);
}
.pd-topbar-inner { display: flex; align-items: center; height: 60px; }
.pd-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--pd-ink); text-decoration: none; letter-spacing: -0.01em; }
.pd-brand-mark {
    width: 26px; height: 26px; border-radius: 8px;
    background: linear-gradient(135deg, var(--pd-blue-600), var(--pd-blue-500) 60%, #38bdf8);
    box-shadow: 0 6px 14px -4px rgba(37, 99, 235, .55);
}

/* Hero */
.pd-hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 56px 0 44px;
    background:
        radial-gradient(60% 80% at 15% 0%, rgba(59, 130, 246, .18), transparent 60%),
        radial-gradient(50% 70% at 90% 10%, rgba(56, 189, 248, .16), transparent 60%),
        linear-gradient(180deg, #eef4ff 0%, var(--pd-bg) 100%);
}
.pd-hero-kicker {
    margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pd-blue-600);
}
.pd-hero-title {
    margin: 0 0 24px; font-size: clamp(36px, 6vw, 56px); font-weight: 800; letter-spacing: -0.03em; color: var(--pd-ink); line-height: 1.05;
}

.pd-search {
    display: flex; align-items: center; gap: 8px;
    max-width: 640px; margin: 0 auto; padding: 6px 6px 6px 22px;
    background: #fff; border: 1px solid var(--pd-line); border-radius: 999px;
    box-shadow: var(--pd-shadow); transition: box-shadow .25s var(--pd-ease), border-color .25s var(--pd-ease);
}
.pd-search:focus-within { border-color: var(--pd-blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .15), var(--pd-shadow); }
.pd-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 16px; color: var(--pd-ink); padding: 10px 0;
}
.pd-search input::placeholder { color: #94a3b8; }
.pd-search button {
    flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; cursor: pointer;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, var(--pd-blue-600), var(--pd-blue-500));
    box-shadow: 0 8px 18px -6px rgba(37, 99, 235, .6);
    transition: transform .2s var(--pd-ease);
}
.pd-search button:hover { transform: scale(1.05); }

/* Layout */
.pd-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding: 24px 16px 56px; align-items: start; }

.pd-sidebar { position: sticky; top: 84px; }
.pd-side-card {
    background: #fff; border: 1px solid var(--pd-line); border-radius: var(--pd-radius); box-shadow: var(--pd-shadow); padding: 20px;
}
.pd-eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pd-muted); }
.pd-side-card h2 { margin: 2px 0 14px; font-size: 20px; color: var(--pd-ink); letter-spacing: -0.01em; }

.pd-cats { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.pd-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 12px; border-radius: 10px; color: var(--pd-text); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: background .2s var(--pd-ease), color .2s var(--pd-ease);
}
.pd-cat:hover { background: var(--pd-blue-50); color: var(--pd-blue-700); }
.pd-cat.is-active { background: linear-gradient(135deg, var(--pd-blue-600), var(--pd-blue-500)); color: #fff; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .7); }
.pd-count { font-size: 12px; color: var(--pd-muted); font-variant-numeric: tabular-nums; }
.pd-cat.is-active .pd-count { color: rgba(255, 255, 255, .85); }

/* Content */
.pd-content-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.pd-content-head h2 { margin: 0; font-size: 22px; color: var(--pd-ink); letter-spacing: -0.01em; }
.pd-meta-count { font-size: 13px; color: var(--pd-muted); font-variant-numeric: tabular-nums; }

.pd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (min-width: 1024px) { .pd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pd-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--pd-card); border: 1px solid var(--pd-line); border-radius: 10px; box-shadow: var(--pd-shadow);
    transition: transform .35s var(--pd-ease), box-shadow .35s var(--pd-ease), border-color .35s var(--pd-ease);
    animation: pd-rise .5s var(--pd-ease) both;
}
.pd-card:hover { transform: translateY(-4px); box-shadow: var(--pd-shadow-hover); border-color: #bfdbfe; }
.pd-grid .pd-card:nth-child(3n+2) { animation-delay: .05s; }
.pd-grid .pd-card:nth-child(3n) { animation-delay: .1s; }

@keyframes pd-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pd-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.pd-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--pd-ease); }
.pd-card:hover .pd-card-media img { transform: scale(1.04); }
.pd-card-placeholder { display: block; width: 100%; height: 100%; }

.pd-card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 18px; flex: 1; }
.pd-card-type { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 500; color: var(--pd-muted); }
.pd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pd-blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.pd-card-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--pd-ink); }
.pd-card-title a { color: inherit; text-decoration: none; }
.pd-card-title a:hover { color: var(--pd-blue-600); }

.pd-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-keys li { display: flex; align-items: center; gap: 6px; }
.pd-keys code {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 6px 10px; border-radius: 10px; background: var(--pd-blue-50); color: var(--pd-blue-700);
    font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pd-copy {
    flex: none; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--pd-blue-100); background: #fff;
    color: var(--pd-blue-700); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
    transition: background .2s var(--pd-ease), border-color .2s var(--pd-ease), color .2s var(--pd-ease);
}
.pd-copy:hover { background: var(--pd-blue-50); border-color: var(--pd-blue-500); }
.pd-copy.is-done { background: var(--pd-blue-600); border-color: var(--pd-blue-600); color: #fff; }
.pd-nokey { margin: 0; font-size: 12px; font-style: italic; color: #94a3b8; }

.pd-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: auto; padding-top: 6px; }
.pd-actions:has(> :only-child) { grid-template-columns: 1fr; }
.pd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none;
    transition: transform .2s var(--pd-ease), box-shadow .2s var(--pd-ease), background .2s var(--pd-ease);
}
.pd-btn:hover { transform: translateY(-1px); }
.pd-btn-ghost { background: var(--pd-blue-50); color: var(--pd-blue-700); border: 1px solid var(--pd-blue-100); }
.pd-btn-ghost:hover { background: var(--pd-blue-100); }
.pd-btn-solid {
    color: #fff; background: linear-gradient(135deg, var(--pd-blue-600), var(--pd-blue-500));
    box-shadow: 0 10px 20px -10px rgba(37, 99, 235, .7);
}
.pd-btn-solid:hover { box-shadow: 0 14px 26px -10px rgba(37, 99, 235, .8); color: #fff; }

/* Pagination */
.pd-pagination { margin-top: 32px; display: flex; justify-content: center; }
.pd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pd-pagination .page-numbers {
    min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--pd-line); background: #fff; color: var(--pd-text); text-decoration: none; font-weight: 600; font-size: 14px;
    transition: background .2s var(--pd-ease), color .2s var(--pd-ease), border-color .2s var(--pd-ease);
}
.pd-pagination a.page-numbers:hover { border-color: var(--pd-blue-500); color: var(--pd-blue-600); }
.pd-pagination .page-numbers.current { background: linear-gradient(135deg, var(--pd-blue-600), var(--pd-blue-500)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .7); }
.pd-pagination .page-numbers.dots { border: 0; background: transparent; }
.pd-pagination .prev.page-numbers, .pd-pagination .next.page-numbers { padding: 0 16px; }
.pd-pagination .page-numbers.disabled, .pd-pagination .page-numbers:not(a):not(.current) { opacity: .45; }

/* Empty state */
.pd-empty { text-align: center; padding: 56px 16px; background: #fff; border: 1px dashed #bfdbfe; border-radius: var(--pd-radius); color: var(--pd-muted); }
.pd-empty a { font-weight: 600; }

/* Footer */
.pd-footer { border-top: 1px solid var(--pd-line); background: #fff; color: var(--pd-muted); font-size: 14px; }
.pd-footer .pd-container { padding-top: 22px; padding-bottom: 22px; text-align: center; }

/* Mobile */
@media (max-width: 860px) {
    .pd-layout { grid-template-columns: 1fr; }
    .pd-sidebar { position: static; }
    .pd-cats { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-height: none; padding-bottom: 4px; scrollbar-width: none; }
    .pd-cats::-webkit-scrollbar { display: none; }
    .pd-cat { flex: none; white-space: nowrap; }
    .pd-side-card h2, .pd-eyebrow { display: none; }
    .pd-side-card { padding: 12px; }
}
@media (max-width: 640px) {
    .pd-grid { gap: 12px; }
    .pd-card-body { padding: 12px; gap: 8px; }
    .pd-card-title { font-size: 14px; }
    .pd-keys code { font-size: 11px; padding: 5px 8px; }
    .pd-copy { padding: 4px 8px; font-size: 11px; }
    .pd-actions { gap: 6px; }
    .pd-btn { padding: 8px 6px; font-size: 12px; border-radius: 10px; }
}
@media (max-width: 480px) {
    .pd-hero { padding: 40px 0 32px; }
    .pd-search { padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Hero v2 */
.pd-hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pd-pill {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 14px; border-radius: 999px;
    background: #fff; border: 1px solid #bfdbfe; color: var(--pd-blue-700); font-size: 13px; font-weight: 600; box-shadow: var(--pd-shadow);
}
.pd-pill .pd-dot { width: 7px; height: 7px; }
.pd-hero-title { max-width: 760px; }
.pd-hero-title span {
    background: linear-gradient(135deg, var(--pd-blue-600), #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pd-hero-sub { margin: -6px 0 26px; color: var(--pd-muted); font-size: 16px; max-width: 560px; }
.pd-hero .pd-search { width: 100%; }
.pd-stats { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.pd-stat { background: #fff; border: 1px solid var(--pd-line); border-radius: 10px; padding: 10px 18px; min-width: 120px; box-shadow: var(--pd-shadow); }
.pd-stat strong { display: block; font-size: 20px; color: var(--pd-ink); font-variant-numeric: tabular-nums; }
.pd-stat span { font-size: 12px; color: var(--pd-muted); }

/* Borbila importer section */
.pd-promo { padding: 8px 0 24px; }
.pd-section-card { background: #fff; border: 1px solid var(--pd-line); border-radius: 18px; box-shadow: var(--pd-shadow); padding: 36px; }
.pd-promo-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
.pd-promo h2 { font-size: 26px; margin: 6px 0 10px; color: var(--pd-ink); letter-spacing: -0.01em; }
.pd-promo p { color: var(--pd-muted); margin: 0; }
.pd-promo ul { margin: 16px 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--pd-text); }
.pd-promo li::before {
    content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pd-blue-500); margin-right: 10px; vertical-align: middle;
}
.pd-promo-visual {
    min-height: 220px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: linear-gradient(135deg, #eef4ff, #dbeafe);
}
.pd-promo-visual span { font-size: 54px; font-weight: 800; color: var(--pd-ink); letter-spacing: -0.03em; }
.pd-promo-visual span::after {
    content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pd-blue-600); margin-left: 4px;
}
.pd-promo-visual small { margin-top: 8px; font-size: 12px; letter-spacing: .2em; color: var(--pd-blue-700); font-weight: 600; }

/* Privacy section */
.pd-privacy { padding: 0 0 56px; }
.pd-privacy-card {
    display: flex; gap: 18px; align-items: flex-start; border-radius: 18px; padding: 30px; color: #fff;
    background: linear-gradient(135deg, #0b1f4d, #1e40af);
    box-shadow: 0 24px 48px -24px rgba(11, 31, 77, .6);
}
.pd-privacy-card h2 { margin: 0 0 10px; font-size: 20px; }
.pd-privacy-card ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.pd-privacy-card li { opacity: .95; }
.pd-lock {
    flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
    background: rgba(255, 255, 255, .14);
}

@media (max-width: 760px) {
    .pd-promo-grid { grid-template-columns: 1fr; }
    .pd-section-card { padding: 22px; }
    .pd-privacy-card { padding: 22px; }
}
