/* ================================================================
   WayToB Smart Packing List Generator — style.css v1.0.0
   All selectors scoped under .wpl-wrap to avoid theme conflicts
================================================================ */

.wpl-wrap *, .wpl-wrap *::before, .wpl-wrap *::after {
    box-sizing: border-box;
}
.wpl-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    max-width: 740px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

/* ── Header ── */
.wpl-header {
    background: #0d1f3c;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.wpl-header-icon { font-size: 34px; line-height: 1; }
.wpl-header h2 {
    font-size: 18px !important; font-weight: 700 !important;
    color: #fff !important; margin: 0 0 4px !important;
    padding: 0 !important; border: none !important; line-height: 1.2 !important;
}
.wpl-header p { font-size: 13px; color: #8fafc8; margin: 0; }

/* ── Progress bar ── */
.wpl-progress-bar {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 0;
}
.wpl-prog-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
}
.wpl-prog-step.wpl-prog-active { color: #0d1f3c; }
.wpl-prog-step.wpl-prog-done   { color: #239e8a; }
.wpl-prog-dot {
    width: 20px; height: 20px; border-radius: 50%;
    background: #e5e7eb; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; transition: background 0.2s;
}
.wpl-prog-step.wpl-prog-active .wpl-prog-dot { background: #0d1f3c; }
.wpl-prog-step.wpl-prog-done   .wpl-prog-dot { background: #239e8a; color: #fff; }
.wpl-prog-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    transition: background 0.2s;
}
.wpl-prog-line.wpl-line-done { background: #239e8a; }

/* ── Steps ── */
.wpl-step { display: none; padding: 24px 28px 28px; }
.wpl-step.wpl-step-active { display: block; }
.wpl-step-title {
    font-size: 15px; font-weight: 700; color: #0d1f3c;
    margin-bottom: 18px;
}

/* ── Trip Type Grid ── */
.wpl-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.wpl-type-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    user-select: none;
}
.wpl-type-card:hover { border-color: #239e8a; }
.wpl-type-card.wpl-selected {
    border-color: #239e8a;
    background: #e8f7f5;
}
.wpl-type-icon  { font-size: 30px; margin-bottom: 8px; line-height: 1; }
.wpl-type-name  { font-size: 13px; font-weight: 700; color: #0d1f3c; margin-bottom: 4px; }
.wpl-type-desc  { font-size: 11px; color: #6b7280; line-height: 1.4; }

/* ── Form Grid ── */
.wpl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}
.wpl-field { display: flex; flex-direction: column; gap: 8px; }
.wpl-field-full { grid-column: 1 / -1; }
.wpl-label {
    font-size: 13px; font-weight: 600; color: #0d1f3c;
    display: flex; align-items: center; gap: 6px;
}
.wpl-lbl-icon { font-size: 16px; line-height: 1; }

/* Select */
.wpl-select {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; color: #1a1a2e; background: #fff;
    outline: none; transition: border-color 0.15s; cursor: pointer;
}
.wpl-select:focus { border-color: #239e8a; }
.wpl-select.wpl-input-err { border-color: #ef4444; }

/* Counter */
.wpl-counter-wrap { display: flex; align-items: center; gap: 8px; }
.wpl-counter-btn {
    width: 36px; height: 36px;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    background: #fff; font-size: 20px; line-height: 1;
    cursor: pointer; color: #0d1f3c;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-weight: 400; padding: 0;
    transition: border-color 0.15s, background 0.15s;
}
.wpl-counter-btn:hover { border-color: #239e8a; background: #e8f7f5; }
.wpl-counter-input {
    width: 58px; text-align: center;
    padding: 8px 4px; border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 15px; font-weight: 700; color: #0d1f3c; background: #fff;
    outline: none;
}
.wpl-counter-input::-webkit-outer-spin-button,
.wpl-counter-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.wpl-counter-input[type=number] { -moz-appearance: textfield; }
.wpl-counter-lbl { font-size: 13px; color: #6b7280; }

/* Who grid */
.wpl-who-grid {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.wpl-who-card {
    border: 1.5px solid #e5e7eb; border-radius: 10px;
    padding: 10px 16px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #374151;
    transition: border-color 0.15s, background 0.15s;
    user-select: none; white-space: nowrap;
}
.wpl-who-card:hover  { border-color: #239e8a; }
.wpl-who-card.wpl-who-active {
    border-color: #239e8a; background: #e8f7f5; color: #0d1f3c;
}
.wpl-who-icon { font-size: 18px; line-height: 1; }

/* Errors */
.wpl-err {
    font-size: 12px; color: #ef4444;
    display: none; margin-top: 2px;
}
.wpl-err.wpl-show { display: block; }

/* Buttons */
.wpl-btn-row {
    display: flex; justify-content: flex-end;
    margin-top: 8px;
}
.wpl-btn-row-2 { justify-content: space-between; }
.wpl-btn-next {
    background: #0d1f3c; color: #fff;
    border: none; border-radius: 10px;
    padding: 13px 28px; font-size: 14px; font-weight: 700;
    cursor: pointer; letter-spacing: 0.3px;
    transition: background 0.15s;
}
.wpl-btn-next:hover { background: #162d50; }
.wpl-btn-back {
    background: transparent; color: #6b7280;
    border: 1.5px solid #e5e7eb; border-radius: 10px;
    padding: 13px 20px; font-size: 14px; cursor: pointer;
    transition: border-color 0.15s;
}
.wpl-btn-back:hover { border-color: #9ca3af; }

/* ── Results top bar ── */
.wpl-results-topbar {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-wrap: wrap; gap: 10px;
}
.wpl-results-meta { font-size: 13px; font-weight: 600; color: #0d1f3c; }
.wpl-results-actions { display: flex; gap: 8px; }
.wpl-action-btn {
    background: #fff; color: #374151;
    border: 1.5px solid #e5e7eb; border-radius: 7px;
    padding: 7px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.wpl-action-btn:hover { border-color: #239e8a; background: #e8f7f5; }
.wpl-action-reset:hover { border-color: #0d1f3c; background: #f1f5fb; }

/* ── Packed progress ── */
.wpl-packed-progress {
    padding: 16px 28px;
    border-bottom: 1px solid #f3f4f6;
}
.wpl-packed-top {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 8px;
}
.wpl-packed-label { font-size: 12px; font-weight: 600; color: #6b7280; }
.wpl-packed-count { font-size: 12px; font-weight: 700; color: #0d1f3c; }
.wpl-packed-track {
    height: 8px; background: #e5e7eb;
    border-radius: 4px; overflow: hidden;
}
.wpl-packed-fill {
    height: 100%; background: #239e8a;
    border-radius: 4px; transition: width 0.35s ease;
}

/* ── List output ── */
.wpl-list-output { padding: 16px 28px 0; }

.wpl-category {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.wpl-cat-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer; user-select: none;
}
.wpl-cat-header-left {
    display: flex; align-items: center;
    gap: 10px; font-size: 14px;
    font-weight: 700; color: #0d1f3c;
}
.wpl-cat-icon  { font-size: 18px; line-height: 1; }
.wpl-cat-badge {
    font-size: 11px; background: #0d1f3c; color: #fff;
    border-radius: 20px; padding: 2px 9px; font-weight: 600;
}
.wpl-cat-badge.wpl-badge-done { background: #239e8a; }
.wpl-cat-toggle {
    font-size: 13px; color: #9ca3af;
    transition: transform 0.2s;
}
.wpl-cat-toggle.wpl-collapsed { transform: rotate(-90deg); }

.wpl-cat-items { padding: 4px 0; }
.wpl-cat-items.wpl-hidden { display: none; }

.wpl-item {
    display: flex; align-items: flex-start;
    gap: 12px; padding: 9px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer; transition: background 0.1s;
}
.wpl-item:last-child { border-bottom: none; }
.wpl-item:hover { background: #f9fafb; }
.wpl-item.wpl-item-checked { background: #f0fdf9; }

.wpl-checkbox {
    width: 18px; height: 18px; min-width: 18px;
    border: 2px solid #d1d5db; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    margin-top: 1px;
}
.wpl-item.wpl-item-checked .wpl-checkbox {
    border-color: #239e8a; background: #239e8a;
}
.wpl-checkbox-tick {
    display: none; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
}
.wpl-item.wpl-item-checked .wpl-checkbox-tick { display: block; }

.wpl-item-text { font-size: 13px; color: #374151; line-height: 1.45; flex: 1; }
.wpl-item.wpl-item-checked .wpl-item-text {
    color: #9ca3af; text-decoration: line-through;
}
.wpl-item-qty {
    font-size: 11px; color: #239e8a;
    font-weight: 600; white-space: nowrap;
    margin-top: 2px;
}
.wpl-item.wpl-item-checked .wpl-item-qty { color: #9ca3af; }

/* Bottom note */
.wpl-note {
    margin: 12px 28px 24px;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #f59e0b44;
    border-radius: 8px;
    font-size: 12px; color: #92400e; line-height: 1.6;
}

/* ── Completion message ── */
.wpl-complete-msg {
    text-align: center; padding: 16px;
    font-size: 14px; font-weight: 700; color: #239e8a;
    display: none;
}
.wpl-complete-msg.wpl-show { display: block; }

/* ── Print styles ── */
@media print {
    .wpl-wrap, .wpl-header, .wpl-step,
    .wpl-results-topbar, .wpl-packed-progress,
    .wpl-category, .wpl-cat-header, .wpl-cat-items,
    .wpl-item, .wpl-checkbox, .wpl-item-text { display: block !important; }
    .wpl-progress-bar, .wpl-results-actions,
    .wpl-action-btn, .wpl-note { display: none !important; }
    .wpl-header { background: #0d1f3c !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .wpl-wrap   { border: none; box-shadow: none; }
    .wpl-item   { break-inside: avoid; page-break-inside: avoid; }
    .wpl-category { break-inside: avoid; page-break-inside: avoid; margin-bottom: 14px; }
    .wpl-cat-header { background: #f9fafb !important; -webkit-print-color-adjust: exact; }
    body > *:not(.wpl-wrap) { display: none !important; }
}

/* ── Responsive ── */
@media (max-width: 580px) {
    .wpl-header, .wpl-step { padding-left: 16px; padding-right: 16px; }
    .wpl-type-grid   { grid-template-columns: 1fr 1fr; }
    .wpl-form-grid   { grid-template-columns: 1fr; }
    .wpl-who-grid    { flex-direction: column; }
    .wpl-who-card    { width: 100%; }
    .wpl-results-topbar { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .wpl-packed-progress { padding: 14px 16px; }
    .wpl-list-output { padding: 14px 16px 0; }
    .wpl-note        { margin: 10px 16px 20px; }
    .wpl-btn-row-2   { flex-direction: column-reverse; gap: 10px; }
    .wpl-btn-next, .wpl-btn-back { width: 100%; text-align: center; }
    .wpl-progress-bar { padding: 12px 16px; }
    .wpl-prog-step span { display: none; }
}
@media (max-width: 380px) {
    .wpl-type-grid { grid-template-columns: 1fr; }
}
