/* =============================================
   Lou Wishlist Creator — Frontend
   ============================================= */

:root {
    --lwc-primary: #6366f1;
    --lwc-primary-hover: #4f46e5;
    --lwc-danger: #ef4444;
    --lwc-success: #22c55e;
    --lwc-gray-50: #f9fafb;
    --lwc-gray-100: #f3f4f6;
    --lwc-gray-200: #e5e7eb;
    --lwc-gray-300: #d1d5db;
    --lwc-gray-400: #9ca3af;
    --lwc-gray-500: #6b7280;
    --lwc-gray-600: #4b5563;
    --lwc-gray-700: #374151;
    --lwc-gray-800: #1f2937;
    --lwc-gray-900: #111827;
    --lwc-radius: 8px;
    --lwc-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --lwc-shadow-lg: 0 10px 25px -5px rgba(0,0,0,.15), 0 8px 10px -6px rgba(0,0,0,.1);
    --lwc-transition: .2s ease;
}

/* ─── ADD BUTTON ─── */

.lwc-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--lwc-primary);
    background: transparent;
    border: 2px solid var(--lwc-primary);
    border-radius: var(--lwc-radius);
    cursor: pointer;
    transition: all var(--lwc-transition);
    font-family: inherit;
}
.lwc-add-btn:hover { background: var(--lwc-primary); color: #fff; }
.lwc-add-btn:hover .lwc-icon-heart { stroke: #fff; }
.lwc-add-btn:active { transform: scale(.97); }

.lwc-add-btn.lwc-in-list { background: var(--lwc-primary); color: #fff; border-color: var(--lwc-primary); }
.lwc-add-btn.lwc-in-list .lwc-icon-heart { display: none; }
.lwc-add-btn.lwc-in-list .lwc-icon-check { display: inline-block !important; stroke: #fff; }

.lwc-btn-style-icon .lwc-btn-text { display: none; }
.lwc-btn-style-icon { padding: 10px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; }

.lwc-btn-style-icon-text { background: transparent; border: none; padding: 6px 12px; font-weight: 500; font-size: 14px; color: var(--lwc-gray-600); }
.lwc-btn-style-icon-text:hover { color: var(--lwc-primary); background: var(--lwc-gray-50); }
.lwc-btn-style-icon-text.lwc-in-list { color: var(--lwc-primary); background: rgba(99,102,241,.08); border: none; }

@keyframes lwc-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.lwc-add-btn.lwc-just-added { animation: lwc-pulse .4s ease; }

/* ─── TOAST ─── */

.lwc-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--lwc-gray-900); color: #fff; padding: 14px 24px; border-radius: 10px;
    font-size: 14px; font-weight: 500; z-index: 99999; opacity: 0;
    transition: all .3s ease; pointer-events: none; display: flex; align-items: center;
    gap: 10px; box-shadow: var(--lwc-shadow-lg); max-width: 90vw;
}
.lwc-toast.lwc-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.lwc-toast a { color: #a5b4fc; text-decoration: underline; font-weight: 600; white-space: nowrap; }

/* ─── COUNTER ─── */

.lwc-counter-link {
    display: inline-flex; align-items: center; gap: 6px; position: relative;
    text-decoration: none; color: inherit; padding: 4px; transition: color var(--lwc-transition);
}
.lwc-counter-link:hover { color: var(--lwc-primary); }

.lwc-counter-badge {
    position: absolute; top: -4px; right: -8px; background: var(--lwc-danger); color: #fff;
    font-size: 11px; font-weight: 700; width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}

.lwc-counter-text { font-size: 14px; font-weight: 500; }

/* ─── FLOATING BUTTON ─── */

.lwc-floating-btn {
    position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px;
    background: var(--lwc-primary); color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,.4); z-index: 9998;
    transition: all var(--lwc-transition); text-decoration: none;
}
.lwc-floating-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(99,102,241,.5); color: #fff; }
.lwc-floating-btn svg { stroke: #fff; fill: rgba(255,255,255,.15); }
.lwc-floating-badge {
    position: absolute; top: -2px; right: -2px; background: var(--lwc-danger); color: #fff;
    font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #fff;
}

/* ═══════════════════════════════════════════════
   DROPDOWN WISHLIST (mini-panier)
   ═══════════════════════════════════════════════ */

.lwc-dropdown-wrapper {
    position: relative;
    display: inline-flex;
}

/* Trigger button */
.lwc-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lwc-gray-700);
    background: #fff;
    border: 1px solid var(--lwc-gray-200);
    border-radius: var(--lwc-radius);
    cursor: pointer;
    transition: all var(--lwc-transition);
    font-family: inherit;
    position: relative;
}
.lwc-dropdown-trigger:hover {
    border-color: var(--lwc-primary);
    color: var(--lwc-primary);
}
.lwc-dropdown-trigger.lwc-dropdown-open {
    border-color: var(--lwc-primary);
    color: var(--lwc-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.lwc-dropdown-icon { flex-shrink: 0; }
.lwc-dropdown-text { white-space: nowrap; }

.lwc-dropdown-badge {
    background: var(--lwc-danger); color: #fff; font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; padding: 0 5px; line-height: 1;
}

.lwc-dropdown-chevron {
    transition: transform .2s ease; flex-shrink: 0; opacity: .5;
}
.lwc-dropdown-trigger.lwc-dropdown-open .lwc-dropdown-chevron {
    transform: rotate(180deg);
}

/* Panel */
.lwc-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: #fff;
    border: 1px solid var(--lwc-gray-200);
    border-radius: 12px;
    box-shadow: var(--lwc-shadow-lg);
    z-index: 99990;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.lwc-dropdown-panel.lwc-dropdown-panel-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel header */
.lwc-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--lwc-gray-100);
}
.lwc-dropdown-header h4 {
    margin: 0; font-size: 15px; font-weight: 700; color: var(--lwc-gray-800);
}
.lwc-dropdown-count-text {
    font-size: 13px; color: var(--lwc-gray-400); font-weight: 500;
}

/* Loading */
.lwc-dropdown-loading {
    display: flex; align-items: center; justify-content: center; padding: 30px;
}
.lwc-spinner-small-dark {
    width: 22px; height: 22px; border: 2px solid var(--lwc-gray-200);
    border-top-color: var(--lwc-primary); border-radius: 50%;
    animation: lwc-spin .7s linear infinite;
}

/* Empty state */
.lwc-dropdown-empty {
    padding: 30px 18px; text-align: center;
}
.lwc-dropdown-empty p {
    margin: 0; color: var(--lwc-gray-400); font-size: 14px;
}

/* Items list */
.lwc-dropdown-items {
    list-style: none; margin: 0; padding: 0;
    overflow-y: auto; max-height: 300px; flex: 1;
}
.lwc-dropdown-items::-webkit-scrollbar { width: 5px; }
.lwc-dropdown-items::-webkit-scrollbar-track { background: transparent; }
.lwc-dropdown-items::-webkit-scrollbar-thumb { background: var(--lwc-gray-200); border-radius: 3px; }

.lwc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--lwc-gray-50);
    transition: background var(--lwc-transition);
}
.lwc-dropdown-item:hover {
    background: var(--lwc-gray-50);
}
.lwc-dropdown-item:last-child {
    border-bottom: none;
}

.lwc-dropdown-item-thumb {
    width: 48px; height: 48px; border-radius: 6px; overflow: hidden;
    background: var(--lwc-gray-100); flex-shrink: 0;
}
.lwc-dropdown-item-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

.lwc-dropdown-item-info { flex: 1; min-width: 0; }
.lwc-dropdown-item-title {
    font-size: 14px; font-weight: 600; color: var(--lwc-gray-800);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin: 0 0 2px; line-height: 1.3;
}
.lwc-dropdown-item-title a { color: inherit; text-decoration: none; }
.lwc-dropdown-item-title a:hover { color: var(--lwc-primary); }

.lwc-dropdown-item-meta {
    font-size: 12px; color: var(--lwc-gray-400);
}

.lwc-dropdown-item-remove {
    flex-shrink: 0; width: 28px; height: 28px; display: flex;
    align-items: center; justify-content: center; background: transparent;
    border: none; border-radius: 6px; cursor: pointer; color: var(--lwc-gray-400);
    transition: all var(--lwc-transition); padding: 0;
}
.lwc-dropdown-item-remove:hover {
    background: rgba(239,68,68,.1); color: var(--lwc-danger);
}

/* Footer */
.lwc-dropdown-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--lwc-gray-100);
}

.lwc-dropdown-view-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 12px 16px; font-size: 14px; font-weight: 700;
    color: #fff !important; background: var(--lwc-primary); border: none;
    border-radius: var(--lwc-radius); text-decoration: none !important;
    transition: background var(--lwc-transition); cursor: pointer;
}
.lwc-dropdown-view-btn:hover { background: var(--lwc-primary-hover); }
.lwc-dropdown-view-btn svg { stroke: #fff; }

/* Responsive dropdown */
@media (max-width: 480px) {
    .lwc-dropdown-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    .lwc-dropdown-panel.lwc-dropdown-panel-open {
        transform: translateY(0);
    }
}

/* Overlay for mobile */
.lwc-dropdown-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 99989;
}
.lwc-dropdown-overlay.lwc-dropdown-overlay-visible { display: block; }

/* ─── WISHLIST PAGE ─── */

.lwc-wishlist-page { max-width: 900px; margin: 0 auto; padding: 20px 0; }

.lwc-loading { text-align: center; padding: 60px 20px; color: var(--lwc-gray-400); }
.lwc-spinner {
    width: 40px; height: 40px; border: 3px solid var(--lwc-gray-200);
    border-top-color: var(--lwc-primary); border-radius: 50%;
    animation: lwc-spin .7s linear infinite; margin: 0 auto 16px;
}
@keyframes lwc-spin { to { transform: rotate(360deg); } }

.lwc-empty-state { text-align: center; padding: 60px 20px; }
.lwc-empty-icon { margin-bottom: 16px; color: var(--lwc-gray-300); }
.lwc-empty-state h3 { font-size: 22px; font-weight: 600; color: var(--lwc-gray-700); margin: 0 0 8px; }
.lwc-empty-state p { color: var(--lwc-gray-500); font-size: 15px; max-width: 400px; margin: 0 auto 24px; }

.lwc-btn-back {
    display: inline-block; padding: 12px 28px; background: var(--lwc-primary);
    color: #fff !important; text-decoration: none !important; border-radius: var(--lwc-radius);
    font-weight: 600; font-size: 15px; transition: background var(--lwc-transition);
}
.lwc-btn-back:hover { background: var(--lwc-primary-hover); }

.lwc-products-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.lwc-products-header h2 { font-size: 22px; font-weight: 700; color: var(--lwc-gray-800); margin: 0; }
.lwc-products-actions { display: flex; align-items: center; gap: 16px; }
.lwc-product-count-text { font-size: 14px; color: var(--lwc-gray-500); }

.lwc-btn-clear {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    font-size: 13px; font-weight: 500; color: var(--lwc-gray-500);
    background: transparent; border: 1px solid var(--lwc-gray-200); border-radius: 6px;
    cursor: pointer; transition: all var(--lwc-transition); font-family: inherit;
}
.lwc-btn-clear:hover { color: var(--lwc-danger); border-color: var(--lwc-danger); background: rgba(239,68,68,.05); }

.lwc-products-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }

.lwc-product-card {
    display: flex; align-items: flex-start; gap: 16px; padding: 16px;
    background: #fff; border: 1px solid var(--lwc-gray-200); border-radius: var(--lwc-radius);
    transition: box-shadow var(--lwc-transition), border-color var(--lwc-transition);
}
.lwc-product-card:hover { border-color: var(--lwc-gray-300); box-shadow: var(--lwc-shadow); }

.lwc-product-thumb { flex-shrink: 0; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--lwc-gray-100); }
.lwc-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lwc-product-info { flex: 1; min-width: 0; }
.lwc-product-title { font-size: 16px; font-weight: 600; color: var(--lwc-gray-800); margin: 0 0 4px; }
.lwc-product-title a { color: inherit; text-decoration: none; }
.lwc-product-title a:hover { color: var(--lwc-primary); }
.lwc-product-ref { font-size: 13px; color: var(--lwc-gray-400); margin-bottom: 8px; }
.lwc-product-excerpt { font-size: 13px; color: var(--lwc-gray-500); line-height: 1.5; margin-bottom: 8px; }

.lwc-product-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lwc-qty-wrapper { display: flex; align-items: center; gap: 6px; }
.lwc-qty-wrapper label { font-size: 13px; color: var(--lwc-gray-500); font-weight: 500; }
.lwc-qty-input { width: 60px; padding: 6px 8px; border: 1px solid var(--lwc-gray-200); border-radius: 6px; font-size: 14px; text-align: center; font-family: inherit; }
.lwc-qty-input:focus { outline: none; border-color: var(--lwc-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.lwc-note-wrapper { flex: 1; min-width: 200px; }
.lwc-note-input { width: 100%; padding: 6px 10px; border: 1px solid var(--lwc-gray-200); border-radius: 6px; font-size: 13px; font-family: inherit; color: var(--lwc-gray-700); }
.lwc-note-input::placeholder { color: var(--lwc-gray-400); }
.lwc-note-input:focus { outline: none; border-color: var(--lwc-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

.lwc-product-remove {
    flex-shrink: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 6px; cursor: pointer;
    color: var(--lwc-gray-400); transition: all var(--lwc-transition); padding: 0;
}
.lwc-product-remove:hover { background: rgba(239,68,68,.1); color: var(--lwc-danger); }

.lwc-product-card.lwc-removing { animation: lwc-slide-out .3s ease forwards; }
@keyframes lwc-slide-out { to { opacity: 0; transform: translateX(30px); max-height: 0; padding: 0; margin: 0; overflow: hidden; } }

/* ─── QUOTE FORM ─── */

.lwc-form-section { background: var(--lwc-gray-50); padding: 32px; border-radius: 12px; border: 1px solid var(--lwc-gray-200); }
.lwc-form-section h2 { font-size: 22px; font-weight: 700; color: var(--lwc-gray-800); margin: 0 0 6px; }
.lwc-form-subtitle { color: var(--lwc-gray-500); font-size: 14px; margin: 0 0 24px; }
.lwc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lwc-field-half { grid-column: span 1; }
.lwc-field-full { grid-column: span 2; }
.lwc-field label { display: block; font-size: 14px; font-weight: 600; color: var(--lwc-gray-700); margin-bottom: 6px; }
.lwc-required { color: var(--lwc-danger); }
.lwc-field input, .lwc-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--lwc-gray-300); border-radius: var(--lwc-radius);
    font-size: 15px; font-family: inherit; color: var(--lwc-gray-800); background: #fff;
    transition: border-color var(--lwc-transition), box-shadow var(--lwc-transition); box-sizing: border-box;
}
.lwc-field input:focus, .lwc-field textarea:focus { outline: none; border-color: var(--lwc-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.lwc-field input.lwc-invalid, .lwc-field textarea.lwc-invalid { border-color: var(--lwc-danger); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }

.lwc-form-footer { margin-top: 24px; text-align: right; }
.lwc-submit-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px;
    font-size: 16px; font-weight: 700; color: #fff; background: var(--lwc-primary);
    border: none; border-radius: var(--lwc-radius); cursor: pointer;
    transition: background var(--lwc-transition), transform .1s; font-family: inherit;
}
.lwc-submit-btn:hover { background: var(--lwc-primary-hover); }
.lwc-submit-btn:active { transform: scale(.98); }
.lwc-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.lwc-spinner-small {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: lwc-spin .6s linear infinite;
}

.lwc-form-message { margin-top: 16px; padding: 14px 18px; border-radius: var(--lwc-radius); font-size: 14px; font-weight: 500; }
.lwc-form-message.lwc-msg-error { background: rgba(239,68,68,.08); color: var(--lwc-danger); border: 1px solid rgba(239,68,68,.2); }
.lwc-form-message.lwc-msg-success { background: rgba(34,197,94,.08); color: #16a34a; border: 1px solid rgba(34,197,94,.2); }

.lwc-success-state { text-align: center; padding: 60px 20px; }
.lwc-success-icon { color: var(--lwc-success); margin-bottom: 16px; }
.lwc-success-icon svg { stroke: var(--lwc-success); }
.lwc-success-text { font-size: 18px; color: var(--lwc-gray-700); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .lwc-form-grid { grid-template-columns: 1fr; }
    .lwc-field-half, .lwc-field-full { grid-column: span 1; }
    .lwc-form-section { padding: 20px; }
    .lwc-product-card { flex-wrap: wrap; }
    .lwc-product-thumb { width: 60px; height: 60px; }
    .lwc-products-header { flex-direction: column; align-items: flex-start; }
    .lwc-form-footer { text-align: center; }
    .lwc-submit-btn { width: 100%; justify-content: center; }
    .lwc-note-wrapper { min-width: 100%; }
}

@media (max-width: 480px) {
    .lwc-wishlist-page { padding: 10px 0; }
    .lwc-product-controls { flex-direction: column; align-items: flex-start; }
}
