/* ═══════════════════════════════════════════════════
   CC Wishlist — Public Frontend Styles v1.1
   Single card structure, 3 layout modes via parent class
   ═══════════════════════════════════════════════════ */

/* ─── Base ─── */
.ccwp-wishlist {
    max-width: 1200px; margin: 0 auto; padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b; line-height: 1.5;
}
.ccwp-wishlist *, .ccwp-wishlist *::before, .ccwp-wishlist *::after { box-sizing: border-box; }

/* ─── Header ─── */
.ccwp-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.ccwp-title { font-size: 28px; font-weight: 800; margin: 0; color: #0f172a; }
.ccwp-count {
    font-size: 14px; color: #64748b; background: #f1f5f9;
    padding: 2px 10px; border-radius: 12px; font-weight: 600;
}
.ccwp-subtitle { margin: 0 0 20px; font-size: 15px; color: #64748b; }
.ccwp-subtitle a { color: #2563eb; text-decoration: none; }
.ccwp-subtitle a:hover { text-decoration: underline; }

/* ─── Filter Toolbar ─── */
.ccwp-filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-bottom: 12px; padding: 10px 14px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.ccwp-search-form {
    display: flex; gap: 6px; flex: 1 1 280px; align-items: center;
}
.ccwp-search-input {
    flex: 1; padding: 7px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 14px; outline: none; transition: border-color 0.15s;
}
.ccwp-search-input:focus { border-color: #2563eb; }
.ccwp-search-btn {
    padding: 7px 16px; background: #1e3a5f; color: #fff; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ccwp-search-btn:hover { background: #2d4f7e; }
.ccwp-clear-btn {
    font-size: 13px; color: #dc2626; text-decoration: none; white-space: nowrap;
}
.ccwp-clear-btn:hover { text-decoration: underline; }
.ccwp-filter-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.ccwp-filter-select {
    padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; background: #fff; cursor: pointer;
}

/* ─── Alphabet Bar ─── */
.ccwp-alpha-bar {
    display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
    margin-bottom: 12px; padding: 6px 0;
}
.ccwp-alpha-btn {
    display: inline-block; padding: 4px 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; color: #555; background: #f3f4f6; border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.ccwp-alpha-btn:hover { background: #e5e7eb; color: #1e3a5f; }
.ccwp-alpha-active { background: #1e3a5f; color: #fff; }
.ccwp-alpha-active:hover { background: #2d4f7e; color: #fff; }

/* ─── Active Filters ─── */
.ccwp-active-filters {
    font-size: 13px; color: #64748b; margin-bottom: 12px; padding: 0 2px;
}
.ccwp-active-filters strong { color: #334155; }
.ccwp-active-filters a { color: #dc2626; text-decoration: none; }
.ccwp-active-filters a:hover { text-decoration: underline; }

/* ─── Pagination ─── */
.ccwp-pagination {
    display: flex; justify-content: center; align-items: center; gap: 4px;
    margin: 24px 0 16px; flex-wrap: wrap;
}
.ccwp-page-btn {
    display: inline-block; padding: 6px 12px; font-size: 14px; font-weight: 600;
    text-decoration: none; color: #374151; background: #f3f4f6; border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.ccwp-page-btn:hover { background: #e5e7eb; color: #1e3a5f; }
.ccwp-page-active { background: #1e3a5f; color: #fff; }
.ccwp-page-active:hover { background: #2d4f7e; color: #fff; }
.ccwp-page-dots { padding: 6px 4px; color: #9ca3af; }

@media (max-width: 600px) {
    .ccwp-filter-bar { flex-direction: column; }
    .ccwp-search-form { flex: 1 1 100%; }
    .ccwp-filter-selects { width: 100%; }
    .ccwp-filter-select { flex: 1; }
    .ccwp-alpha-btn { padding: 4px 5px; font-size: 11px; }
}

/* ─── View Switcher Bar ─── */
.ccwp-view-bar {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 20px; padding: 8px 12px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.ccwp-view-label { font-size: 13px; font-weight: 600; color: #64748b; margin-right: 4px; }
.ccwp-view-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; color: #475569; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.ccwp-view-btn:hover { border-color: #93c5fd; color: #2563eb; }
.ccwp-view-btn.ccwp-view-active {
    background: #2563eb; color: #fff; border-color: #2563eb;
}
.ccwp-view-btn svg { flex-shrink: 0; }

/* ─── Group Headings ─── */
.ccwp-group-heading {
    font-size: 18px; font-weight: 700; margin: 28px 0 12px; padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0; color: #334155;
}
.ccwp-group-count { font-weight: 400; color: #94a3b8; font-size: 14px; }

/* ═══════════════════════════════════════════════════
   CARD — shared structure
   ═══════════════════════════════════════════════════ */
.ccwp-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.ccwp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

/* Priority left border */
.ccwp-pri-high { border-left: 4px solid #ef4444; }
.ccwp-pri-medium { border-left: 4px solid #f59e0b; }
.ccwp-pri-low { border-left: 4px solid #e2e8f0; }

/* Cover area */
.ccwp-card-cover { position: relative; overflow: hidden; background: #f1f5f9; }
.ccwp-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* No-cover placeholder */
.ccwp-no-cover {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff; text-align: center; padding: 16px; width: 100%; height: 100%; min-height: 80px;
}
.ccwp-no-cover-title { font-size: 12px; font-weight: 600; line-height: 1.3; opacity: 0.8; }
.ccwp-no-cover-issue { font-size: 28px; font-weight: 800; opacity: 0.5; margin-top: 4px; }

/* Priority badge (over cover) */
.ccwp-priority-badge {
    position: absolute; top: 8px; right: 8px; background: rgba(239,68,68,0.9);
    color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px;
    border-radius: 6px; letter-spacing: 0.5px; z-index: 2;
}

/* Body */
.ccwp-card-body { padding: 12px 14px 14px; }
.ccwp-card-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.ccwp-issue { color: #2563eb; font-weight: 800; }

/* Meta chips */
.ccwp-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ccwp-chip {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px;
    background: #f1f5f9; color: #475569;
}
.ccwp-chip-variant { background: #ede9fe; color: #7c3aed; font-style: italic; }

/* Price, notes, eBay */
.ccwp-price {
    display: inline-block; font-size: 13px; font-weight: 700; color: #16a34a;
    background: #f0fdf4; padding: 2px 8px; border-radius: 4px; margin-top: 8px;
}
.ccwp-notes {
    font-size: 12px; color: #64748b; font-style: italic; margin: 6px 0 0; line-height: 1.4;
}
.ccwp-ebay-btn {
    display: inline-block; margin-top: 10px; padding: 6px 16px;
    background: #2563eb; color: #fff !important; text-decoration: none !important;
    font-size: 12px; font-weight: 600; border-radius: 6px;
    transition: background 0.15s;
}
.ccwp-ebay-btn:hover { background: #1d4ed8; }

/* ═══════════════════════════════════════════════════
   LAYOUT: Shelf — vertical cover cards (like a comic shelf)
   ═══════════════════════════════════════════════════ */
.ccwp-layout-shelf .ccwp-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}
.ccwp-layout-shelf .ccwp-card { display: block; }
.ccwp-layout-shelf .ccwp-card-cover { aspect-ratio: 2 / 3; }
.ccwp-layout-shelf .ccwp-no-cover { min-height: 200px; }
.ccwp-layout-shelf .ccwp-no-cover-issue { font-size: 36px; }

/* ═══════════════════════════════════════════════════
   LAYOUT: Horizontal — cover thumb left, details right
   ═══════════════════════════════════════════════════ */
.ccwp-layout-horizontal .ccwp-grid {
    display: grid; gap: 16px;
    grid-template-columns: 1fr;
}
.ccwp-layout-horizontal .ccwp-card {
    display: flex; align-items: stretch;
}
.ccwp-layout-horizontal .ccwp-card-cover {
    width: 110px; min-width: 110px; flex-shrink: 0;
}
.ccwp-layout-horizontal .ccwp-card-body {
    display: flex; flex-direction: column; padding: 14px 18px; flex: 1;
}
.ccwp-layout-horizontal .ccwp-card-body .ccwp-ebay-btn { margin-top: auto; align-self: flex-start; }
.ccwp-layout-horizontal .ccwp-no-cover { min-height: 100%; }
.ccwp-layout-horizontal .ccwp-no-cover-title { font-size: 10px; }
.ccwp-layout-horizontal .ccwp-no-cover-issue { font-size: 20px; }

/* ═══════════════════════════════════════════════════
   LAYOUT: Masonry — Pinterest-style staggered columns
   ═══════════════════════════════════════════════════ */
.ccwp-layout-masonry .ccwp-grid {
    columns: 4; column-gap: 20px;
}
.ccwp-layout-masonry .ccwp-card {
    display: inline-block; width: 100%;
    break-inside: avoid; margin-bottom: 20px;
}
.ccwp-layout-masonry .ccwp-card-cover { aspect-ratio: auto; }
.ccwp-layout-masonry .ccwp-card-cover img { height: auto; }
.ccwp-layout-masonry .ccwp-no-cover { min-height: 120px; }

/* ═══════════════════════════════════════════════════
   Custom Column Counts (via data-cols on parent)
   ═══════════════════════════════════════════════════ */
.ccwp-wishlist[data-cols="1"] .ccwp-layout-shelf .ccwp-grid,
.ccwp-layout-shelf.ccwp-wishlist[data-cols="1"] .ccwp-grid { grid-template-columns: 1fr; }
.ccwp-layout-shelf[data-cols="2"] .ccwp-grid { grid-template-columns: repeat(2, 1fr); }
.ccwp-layout-shelf[data-cols="4"] .ccwp-grid { grid-template-columns: repeat(4, 1fr); }
.ccwp-layout-shelf[data-cols="5"] .ccwp-grid { grid-template-columns: repeat(5, 1fr); }

.ccwp-layout-horizontal[data-cols="2"] .ccwp-grid { grid-template-columns: repeat(2, 1fr); }

.ccwp-layout-masonry[data-cols="2"] .ccwp-grid { columns: 2; }
.ccwp-layout-masonry[data-cols="3"] .ccwp-grid { columns: 3; }
.ccwp-layout-masonry[data-cols="5"] .ccwp-grid { columns: 5; }

/* ═══════════════════════════════════════════════════
   Footer / Empty
   ═══════════════════════════════════════════════════ */
.ccwp-footer { text-align: center; margin-top: 32px; font-size: 12px; color: #94a3b8; }
.ccwp-footer a { color: #94a3b8; text-decoration: underline; }
.ccwp-footer a:hover { color: #64748b; }
.ccwp-empty { text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 16px; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ccwp-layout-shelf .ccwp-grid { grid-template-columns: repeat(3, 1fr); }
    .ccwp-layout-masonry .ccwp-grid { columns: 3; }
}

@media (max-width: 768px) {
    .ccwp-layout-shelf .ccwp-grid { grid-template-columns: repeat(2, 1fr); }
    .ccwp-layout-horizontal .ccwp-card-cover { width: 80px; min-width: 80px; }
    .ccwp-layout-masonry .ccwp-grid { columns: 2; }
    .ccwp-header { flex-direction: column; gap: 4px; }
    .ccwp-title { font-size: 22px; }
    .ccwp-view-bar { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .ccwp-layout-shelf .ccwp-grid { grid-template-columns: 1fr; }
    .ccwp-layout-masonry .ccwp-grid { columns: 1; }
    .ccwp-layout-horizontal .ccwp-card { flex-direction: column; }
    .ccwp-layout-horizontal .ccwp-card-cover { width: 100%; min-width: 100%; aspect-ratio: 3/2; }
    .ccwp-view-btn span { display: none; } /* icons only on small screens */
}

/* ─── Animation on layout switch ─── */
.ccwp-grid { transition: all 0.3s ease; }
.ccwp-card { transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease; }

/* ═══════════════════════════════════════════════════
   "I Have This!" Contact Button
   ═══════════════════════════════════════════════════ */
.ccwp-contact-btn {
    display: inline-block; margin-top: 6px; padding: 5px 12px;
    background: #f8fafc; color: #334155 !important; border: 1px solid #cbd5e1;
    font-size: 12px; font-weight: 600; border-radius: 6px;
    cursor: pointer; transition: all 0.15s;
}
.ccwp-contact-btn:hover { background: #f0fdf4; border-color: #16a34a; color: #16a34a !important; }

/* ═══════════════════════════════════════════════════
   Contact Modal
   ═══════════════════════════════════════════════════ */
.ccwp-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(2px);
}
.ccwp-modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto; padding: 28px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative;
    animation: ccwpSlideIn 0.25s ease;
}
@keyframes ccwpSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.ccwp-modal-close {
    position: absolute; top: 12px; right: 16px; background: none;
    border: none; font-size: 24px; color: #94a3b8; cursor: pointer;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: all 0.15s;
}
.ccwp-modal-close:hover { background: #f1f5f9; color: #334155; }
.ccwp-modal-title { margin: 0 0 12px; font-size: 20px; font-weight: 800; color: #0f172a; }
.ccwp-modal-comic {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 20px; font-size: 14px; color: #334155;
}

/* Form rows */
.ccwp-form-row { margin-bottom: 14px; }
.ccwp-form-row label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.ccwp-form-row input, .ccwp-form-row select, .ccwp-form-row textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 14px; color: #1e293b; background: #fff;
    transition: border-color 0.15s; font-family: inherit;
}
.ccwp-form-row input:focus, .ccwp-form-row select:focus, .ccwp-form-row textarea:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.ccwp-form-row-half { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccwp-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.ccwp-submit-btn {
    padding: 10px 24px; background: #2563eb; color: #fff; border: none;
    border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer;
    transition: background 0.15s;
}
.ccwp-submit-btn:hover { background: #1d4ed8; }
.ccwp-submit-btn:disabled { background: #94a3b8; cursor: not-allowed; }

@media (max-width: 480px) {
    .ccwp-modal { padding: 20px; border-radius: 12px; }
    .ccwp-form-row-half { grid-template-columns: 1fr; }
}
