/* ============================================================
   Phone Directory Pro v2 — Full Dark/Light Mode Compatible CSS
   Consumes --ryv-* tokens from Ryvonix Theme with safe fallbacks
   ============================================================ */
.pdp-single-container, .pdp-brand-container, .pdp-brands-container, .pdp-search-results-page, .pdp-cp-wrap {
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px 20px 52px;
    color: var(--ryv-text, #0f172a);
}

.pdp-single-layout { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; }
.pdp-phone-title { font-family: var(--ryv-font-display, sans-serif); font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; margin: 0 0 10px; line-height: 1.15; }
.pdp-release { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--ryv-accent-soft, rgba(79,70,229,.1)); color: var(--ryv-accent, #4f46e5); font-size: 13px; font-weight: 600; margin-bottom: 22px; }

.pdp-phone-image-box {
    position: relative;
    overflow: hidden;
    background: var(--ryv-surface-2, #f1f5f9);
    border: 1px solid var(--ryv-border, #e2e8f0);
    border-radius: 18px;
    padding: 36px 24px 86px;
    text-align: center;
    margin-bottom: 26px;
}
.pdp-phone-image { max-height: 400px; width: auto; object-fit: contain; filter: drop-shadow(0 18px 34px rgba(0,0,0,.18)); }
.pdp-compare-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 18px; display: flex; justify-content: center;
    background: linear-gradient(to top, rgba(9,13,22,.65), transparent);
}
.pdp-buttons-container { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pdp-compare-btn, .pdp-buy-now-btn-active, .pdp-buy-now-btn-inactive {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; border: none; cursor: pointer; text-decoration: none;
}
.pdp-compare-btn { background: #fff; color: #4f46e5; }
.pdp-compare-btn:hover { background: #4f46e5; color: #fff; }
.pdp-buy-now-btn-active { background: #16a34a; color: #fff; }
.pdp-buy-now-btn-active:hover { background: #15803d; color: #fff; }
.pdp-buy-now-btn-inactive { background: rgba(255,255,255,.18); color: rgba(255,255,255,.85); backdrop-filter: blur(6px); }

.pdp-section, .pdp-sidebar-box {
    background: var(--ryv-surface, #fff);
    border: 1px solid var(--ryv-border, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--ryv-shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}
.pdp-section h2, .pdp-sidebar-box h3 { font-family: var(--ryv-font-display, sans-serif); margin: 0 0 18px; color: var(--ryv-text, #0f172a); }
.pdp-section h2 { font-size: 1.35rem; padding-bottom: 12px; border-bottom: 2px solid var(--ryv-border, #e2e8f0); }

.pdp-key-specs { background: var(--ryv-spec-panel-bg, #0f172a); border-color: var(--ryv-spec-panel-border, rgba(255,255,255,.12)); }
.pdp-key-specs h2 { color: var(--ryv-spec-panel-text, #f8fafc); border-bottom-color: var(--ryv-spec-panel-border, rgba(255,255,255,.12)); }
.pdp-key-specs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pdp-key-spec-item { background: var(--ryv-spec-panel-card, rgba(255,255,255,.06)); border: 1px solid var(--ryv-spec-panel-border, rgba(255,255,255,.1)); border-radius: 12px; padding: 16px; }
.key-spec-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ryv-spec-panel-muted, #94a3b8); margin-bottom: 6px; font-weight: 700; }
.key-spec-value { font-size: 15px; font-weight: 700; color: var(--ryv-spec-panel-text, #f8fafc); }
.key-spec-sub { font-size: 12px; color: var(--ryv-spec-panel-muted, #94a3b8); margin-top: 4px; }

.pdp-toggle-buttons { display: inline-flex; gap: 6px; padding: 5px; background: var(--ryv-surface-2, #f1f5f9); border: 1px solid var(--ryv-border, #e2e8f0); border-radius: 12px; margin-bottom: 18px; }
.pdp-toggle-btn { padding: 10px 20px; border: none; border-radius: 8px; background: transparent; color: var(--ryv-text-muted, #64748b); font-weight: 600; cursor: pointer; }
.pdp-toggle-btn.active { background: var(--ryv-surface, #fff); color: var(--ryv-accent, #4f46e5); box-shadow: var(--ryv-shadow-sm); }

.pdp-spec-table { width: 100%; border-collapse: collapse; }
.pdp-spec-table tr { border-bottom: 1px solid var(--ryv-border, #e2e8f0); }
.pdp-spec-table tr:last-child { border-bottom: none; }
.pdp-spec-table td { padding: 13px 10px; vertical-align: top; }
.spec-label { width: 170px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ryv-accent, #4f46e5); }
.spec-value { color: var(--ryv-text-secondary, #334155); font-size: 14.5px; }

.pdp-phones-grid, .pdp-brands-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pdp-phone-card, .pdp-brand-card, .pdp-related-card, .pdp-trending-card {
    display: flex; flex-direction: column;
    background: var(--ryv-surface, #fff);
    border: 1px solid var(--ryv-border, #e2e8f0);
    border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ryv-text, #0f172a);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pdp-phone-card:hover, .pdp-brand-card:hover, .pdp-related-card:hover, .pdp-trending-card:hover {
    transform: translateY(-4px); border-color: var(--ryv-accent, #4f46e5); box-shadow: var(--ryv-shadow-md);
}
.pdp-phone-card img, .pdp-trending-img img { width: 100%; height: 190px; object-fit: contain; padding: 18px; background: var(--ryv-surface-2, #f1f5f9); }
.pdp-phone-card h3 { font-size: 15px; font-weight: 700; padding: 14px 16px; margin: 0; color: var(--ryv-text, #0f172a); }
.pdp-brand-card { align-items: center; padding: 28px 20px; text-align: center; }
.pdp-brand-card img { width: 90px; height: 90px; object-fit: contain; margin-bottom: 14px; background: #fff; padding: 8px; border-radius: 12px; }
.pdp-badge { background: var(--ryv-accent-soft, rgba(79,70,229,.1)); color: var(--ryv-accent, #4f46e5); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.pdp-trending-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.pdp-trending-body { padding: 12px 14px 14px; }
.pdp-trending-brand { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ryv-accent, #4f46e5); }
.pdp-trending-name { font-size: 14px; font-weight: 700; margin: 3px 0 8px; color: var(--ryv-text, #0f172a); }
.pdp-trending-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.pdp-trending-meta span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-text-muted, #64748b); }

.pdp-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pdp-related-card { padding: 14px; text-align: center; }
.pdp-related-card img { height: 110px; object-fit: contain; margin-bottom: 8px; }
.pdp-related-card h4 { margin: 0; font-size: 13.5px; color: var(--ryv-text, #0f172a); }

.pdp-sidebar { position: sticky; top: 92px; }
.pdp-brand-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pdp-brand-list a { display: block; text-align: center; padding: 7px 5px; border-radius: 6px; background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-text, #0f172a); font-size: 12px; font-weight: 600; }
.pdp-brand-list a:hover { background: var(--ryv-accent, #4f46e5); color: #fff; }
.pdp-all-brands-btn { display: block; text-align: center; padding: 10px; border-radius: 8px; background: var(--ryv-accent, #4f46e5); color: #fff; font-weight: 600; font-size: 13px; }
.pdp-related-widget { display: flex; flex-direction: column; gap: 8px; }
.pdp-related-widget-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-text, #0f172a); font-size: 13px; font-weight: 600; }
.pdp-related-widget-item img { width: 38px; height: 38px; object-fit: contain; }

/* Live Search & Compare */
.pdp-live-search-wrap { position: relative; }
.pdp-live-search-bar { display: flex; align-items: center; gap: 10px; background: var(--ryv-surface, #fff); border: 1.5px solid var(--ryv-border-strong, #cbd5e1); border-radius: 12px; padding: 0 14px; }
.pdp-live-search-bar:focus-within { border-color: var(--ryv-accent, #4f46e5); }
.pdp-live-search-input { flex: 1; border: none; outline: none; background: transparent; color: var(--ryv-text, #0f172a); font-size: 15px; padding: 12px 0; }
.pdp-ls-clear { border: none; background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-text, #0f172a); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.pdp-live-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--ryv-surface-elevated, #fff); border: 1px solid var(--ryv-border, #e2e8f0); border-radius: 12px; box-shadow: var(--ryv-shadow-lg); max-height: 360px; overflow-y: auto; z-index: 9999; padding: 6px; }
.pdp-ls-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--ryv-text, #0f172a); font-weight: 600; font-size: 14px; }
.pdp-ls-item:hover { background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-accent, #4f46e5); }
.pdp-ls-item img { width: 36px; height: 36px; object-fit: contain; }

.pdp-mobile-overlay { position: fixed; inset: 0; background: var(--ryv-bg, #fff); z-index: 10005; flex-direction: column; }
.pdp-mobile-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ryv-border, #e2e8f0); background: var(--ryv-surface, #fff); }
.pdp-mobile-back { border: none; background: transparent; color: var(--ryv-text, #0f172a); font-size: 20px; padding: 6px 10px; cursor: pointer; }
.pdp-mobile-search-input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--ryv-border, #e2e8f0); background: var(--ryv-surface-2, #f1f5f9); color: var(--ryv-text, #0f172a); font-size: 16px; }
.pdp-mobile-body { flex: 1; overflow-y: auto; padding: 12px; }

.pdp-cp-title { text-align: center; font-family: var(--ryv-font-display, sans-serif); font-size: 2.2rem; margin: 0 0 8px; }
.pdp-cp-sub { text-align: center; color: var(--ryv-text-muted, #64748b); margin: 0 0 24px; }
.pdp-cp-select { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.pdp-cp-search-wrap { position: relative; }
.pdp-cp-search-input { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--ryv-border-strong, #cbd5e1); background: var(--ryv-surface, #fff); color: var(--ryv-text, #0f172a); font-size: 15px; }
.pdp-cp-search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--ryv-surface-elevated, #fff); border: 1px solid var(--ryv-border, #e2e8f0); border-radius: 10px; box-shadow: var(--ryv-shadow-lg); z-index: 99; display: none; max-height: 260px; overflow-y: auto; margin-top: 4px; }
.pdp-cp-selected { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ryv-accent-soft, rgba(79,70,229,.1)); border: 1px solid var(--ryv-accent, #4f46e5); border-radius: 10px; font-weight: 700; }
.pdp-cp-selected img { width: 32px; height: 32px; object-fit: contain; }
.pdp-cp-remove-sel { margin-left: auto; border: none; background: transparent; color: var(--ryv-danger, #dc2626); font-size: 16px; cursor: pointer; }
.pdp-cp-top { display: flex; align-items: center; text-align: center; margin-bottom: 20px; }
.pdp-cp-top-col { flex: 1; }
.pdp-cp-top-col img { max-height: 150px; object-fit: contain; }
.pdp-cp-top-vs span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ryv-accent, #4f46e5); color: #fff; font-weight: 800; font-size: 12px; }
.pdp-cp-spec-row { display: flex; border-bottom: 1px solid var(--ryv-border, #e2e8f0); }
.pdp-cp-spec-label { width: 150px; flex-shrink: 0; padding: 12px; font-size: 12.5px; font-weight: 700; color: var(--ryv-accent, #4f46e5); background: var(--ryv-surface-2, #f1f5f9); }
.pdp-cp-spec-val { flex: 1; padding: 12px; font-size: 13.5px; color: var(--ryv-text-secondary, #334155); border-left: 1px solid var(--ryv-border, #e2e8f0); }

.pdp-front-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.pdp-front-pagination a { padding: 8px 14px; border-radius: 8px; background: var(--ryv-surface, #fff); border: 1px solid var(--ryv-border, #e2e8f0); color: var(--ryv-text, #0f172a); font-weight: 600; }
.pdp-front-pagination a.is-current { background: var(--ryv-accent, #4f46e5); color: #fff; border-color: var(--ryv-accent, #4f46e5); }

.pdp-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10010; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pdp-modal-card { background: var(--ryv-surface, #fff); color: var(--ryv-text, #0f172a); border: 1px solid var(--ryv-border, #e2e8f0); border-radius: 16px; padding: 28px 32px; max-width: 400px; text-align: center; box-shadow: var(--ryv-shadow-lg); }

.pdp-mobile-ad-section, .pdp-mobile-normal-section { display: none; }
.pdp-ad-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ryv-text-muted, #64748b); text-align: center; margin-bottom: 8px; }

@media (max-width: 960px) {
    .pdp-single-layout { grid-template-columns: 1fr; }
    .pdp-sidebar { position: static; }
    .pdp-phones-grid, .pdp-brands-grid { grid-template-columns: repeat(2, 1fr); }
    .pdp-trending-grid { grid-template-columns: repeat(2, 1fr); }
    .pdp-related-grid { grid-template-columns: repeat(2, 1fr); }
    .pdp-key-specs-grid { grid-template-columns: repeat(2, 1fr); }
    .pdp-mobile-ad-section, .pdp-mobile-normal-section { display: block; }
    .pdp-sidebar .pdp-custom-widget { display: none; }
}
@media (max-width: 640px) {
    .pdp-cp-select { grid-template-columns: 1fr; }
    .pdp-spec-table td { display: block; width: 100%; padding: 6px 0; }
}
