/* =========================================================
   Baby Shower Wishlist – Estilos frontend
   ========================================================= */

/* Variables (fallbacks si el usuario no personaliza) */
:root {
    --bsw-theme:  #e8a4c0;
    --bsw-accent: #f5d0e0;
    --bsw-font:   'Playfair Display', Georgia, serif;
    --bsw-text:   #3d3535;
    --bsw-white:  #ffffff;
    --bsw-radius: 12px;
    --bsw-shadow: 0 4px 24px rgba(200, 100, 140, .12);
}

/* ── Reset básico ─────────────────────────────────────────── */
.bsw-dashboard *,
.bsw-public-landing * {
    box-sizing: border-box;
}

/* ── Botones generales ────────────────────────────────────── */
.bsw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.bsw-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.bsw-btn:active { transform: translateY(0); }

.bsw-btn-primary {
    background: var(--bsw-theme);
    color: #fff;
}
.bsw-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--bsw-theme);
    color: var(--bsw-theme);
}
.bsw-btn-text {
    background: transparent;
    color: #999;
    font-weight: 400;
    padding: 6px 12px;
}
.bsw-btn-full { width: 100%; justify-content: center; }
.bsw-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background .15s;
}
.bsw-btn-icon:hover { background: rgba(0,0,0,.06); }

/* ── Inputs ───────────────────────────────────────────────── */
.bsw-input,
.bsw-textarea,
.bsw-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0cdd4;
    border-radius: 8px;
    font-size: 14px;
    color: var(--bsw-text);
    background: #fff;
    transition: border-color .2s;
    outline: none;
}
.bsw-input:focus,
.bsw-textarea:focus,
.bsw-select:focus {
    border-color: var(--bsw-theme);
    box-shadow: 0 0 0 3px rgba(232, 164, 192, .2);
}
.bsw-textarea {
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* ── Modal ────────────────────────────────────────────────── */
.bsw-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bsw-modal-inner {
    background: #fff;
    border-radius: var(--bsw-radius);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.bsw-modal-inner h3 { margin: 0 0 20px; font-size: 20px; }
.bsw-modal-inner label { display: block; margin-bottom: 6px; font-size: 13px; color: #888; }
.bsw-modal-inner .bsw-input { margin-bottom: 16px; }
.bsw-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.bsw-modal-close:hover { color: #333; }

/* =========================================================
   DASHBOARD
   ========================================================= */

.bsw-dashboard {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.bsw-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.bsw-dashboard-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--bsw-text);
}

.bsw-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #aaa;
    background: #fafafa;
    border-radius: var(--bsw-radius);
    border: 2px dashed #eee;
}

/* ── Tarjeta de lista ─────────────────────────────────────── */
.bsw-wishlist-card {
    background: #fff;
    border: 1px solid #f0e0e8;
    border-radius: var(--bsw-radius);
    margin-bottom: 24px;
    box-shadow: var(--bsw-shadow);
    overflow: hidden;
}
.bsw-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #fce8f0;
    background: linear-gradient(135deg, #fff9fc 0%, #fff 100%);
}
.bsw-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.bsw-card-name {
    margin: 0;
    font-size: 18px;
    color: var(--bsw-text);
}
.bsw-card-actions { display: flex; gap: 4px; }
.bsw-card-meta { margin: 8px 0 0; font-size: 13px; color: #999; }

.bsw-share-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.bsw-share-input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 12px;
    color: #999;
    background: #f9f9f9;
    outline: none;
}

/* ── Grid de ítems ────────────────────────────────────────── */
.bsw-items-list { padding: 20px 24px; }
.bsw-no-items { color: #bbb; font-size: 14px; margin: 0; }
.bsw-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.bsw-item {
    border: 1px solid #f0e0e8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s;
}
.bsw-item:hover { box-shadow: 0 4px 18px rgba(200, 100, 140, .14); }
.bsw-item--purchased { opacity: .7; }

.bsw-item-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}
.bsw-item-image--placeholder {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #fce8f0;
}
.bsw-item-info { padding: 10px 12px 12px; }
.bsw-item-name { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.bsw-item-name a { color: var(--bsw-text); text-decoration: none; }
.bsw-item-name a:hover { color: var(--bsw-theme); }
.bsw-item-price { margin: 0 0 8px; font-size: 13px; color: var(--bsw-theme); font-weight: 600; }
.bsw-purchased-tag {
    display: inline-block;
    background: #e8f5e9;
    color: #388e3c;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.bsw-purchased-date { font-size: 11px; color: #aaa; margin-top: 4px; }
.bsw-btn-remove-item {
    background: none;
    border: none;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    transition: color .15s;
}
.bsw-btn-remove-item:hover { color: #e57373; }

/* ── Panel de personalización ─────────────────────────────── */
.bsw-customize-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 420px;
    background: #fff;
    z-index: 99998;
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    overflow-y: auto;
    transition: transform .3s ease;
}
.bsw-customize-inner {
    padding: 32px 28px;
}
.bsw-customize-inner h3 { margin: 0 0 24px; font-size: 18px; }
.bsw-panel-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}
.bsw-panel-close:hover { color: #333; }

.bsw-form-group { margin-bottom: 18px; }
.bsw-form-group label { display: block; font-size: 13px; font-weight: 600; color: #666; margin-bottom: 6px; }
.bsw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.bsw-image-uploader { display: flex; flex-direction: column; gap: 10px; }
.bsw-cover-preview {
    width: 100%;
    height: 140px;
    border-radius: 10px;
    border: 2px dashed #eee;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}
.bsw-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.bsw-cover-placeholder { font-size: 13px; color: #ccc; }

.bsw-preview-bar {
    background: var(--bsw-accent);
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
    text-align: center;
}
.bsw-font-preview {
    font-family: var(--bsw-font);
    font-size: 18px;
    color: var(--bsw-text);
    transition: font-family .2s;
}

/* ── Badge en producto (página individual) ────────────────── */
.bsw-purchased-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ── Badge "ya comprado" en página de producto ── */
.bsw-purchased-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ── Botón wishlist en página de producto ── */
.bsw-single-wishlist-wrap {
    margin-top: 16px;
    margin-bottom: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,.07);
    clear: both;
}

/* Botón — ancho por contenido, rosado, bordes redondeados */
body .bsw-btn-add-wishlist,
body .bsw-btn-add-wishlist.bsw-has-dropdown {
    all: unset;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--bsw-btn-hover-bg, #f2c4d8) !important;
    color: #2a1520 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background .2s, transform .15s !important;
    text-decoration: none !important;
    font-family: inherit !important;
    line-height: 1 !important;
    white-space: nowrap;
}
body .bsw-btn-add-wishlist:hover {
    /* Un pelín más oscuro que el color base */
    background: color-mix(in srgb, var(--bsw-btn-hover-bg, #f2c4d8) 80%, #000 20%) !important;
    color: #1a0e16 !important;
    transform: translateY(-1px) !important;
}
/* Fallback para navegadores sin color-mix (Safari < 16.4) */
@supports not (background: color-mix(in srgb, red 80%, black 20%)) {
    body .bsw-btn-add-wishlist:hover {
        background: #d9a0bb !important;
    }
}
body .bsw-btn-add-wishlist:disabled,
body .bsw-btn-add-wishlist[disabled] {
    opacity: .6 !important;
    cursor: default !important;
    transform: none !important;
}

/* Selector de múltiples listas */
.bsw-wishlist-selector { position: relative; display: inline-block; }

/* Dropdown de listas */
.bsw-wishlist-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 6px;
    z-index: 999;
    min-width: 180px;
    display: none;
}
.bsw-wishlist-dropdown.open { display: block; }
.bsw-wishlist-dropdown li a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background .15s;
}
.bsw-wishlist-dropdown li a:hover {
    background: #fce8f0;
    color: #a0304c;
}

/* Botón de login (no logueado) */
body .bsw-login-to-wishlist {
    all: unset;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: #fdf0f5 !important;
    color: #aaa !important;
    border: 1.5px dashed #e0b8cc !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background .2s, color .2s !important;
    font-family: inherit !important;
    white-space: nowrap;
}
body .bsw-login-to-wishlist:hover {
    background: #fce8f0 !important;
    color: #a0304c !important;
    border-color: var(--bsw-theme, #e8a4c0) !important;
}

/* ═══════════════════════════════════════════════════════════
   BOTÓN WISHLIST EN EL LOOP
   Blindado contra estilos de WoodMart u otros temas:
   - all: unset  → elimina toda herencia del tema
   - prefijo body → especificidad más alta que las reglas del tema
   - Variables CSS → colores desde Admin → Ajustes del botón
   ─────────────────────────────────────────────────────────── */

body .bsw-loop-btn,
body a.bsw-loop-btn {
    /* Elimina TODA herencia del tema (color, font, padding, border, etc.) */
    all: unset;

    /* Restablecer lo que necesitamos explícitamente */
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 1px solid var(--bsw-btn-border, #e0e0e0) !important;
    background: var(--bsw-btn-bg, #ffffff) !important;
    background-image: none !important;
    color: var(--bsw-btn-icon, #555555) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
    transition: background .2s, border-color .2s, transform .15s, box-shadow .2s !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    position: relative !important;
    /* Asegura que el tema no añada outline, text-transform, letter-spacing */
    outline: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1 !important;
    font-size: 0 !important; /* Evita gaps de text nodes */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body .bsw-loop-btn svg,
body a.bsw-loop-btn svg {
    all: unset;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
    stroke: var(--bsw-btn-icon, #555555) !important;
    fill: none !important;
    transition: stroke .2s, fill .2s !important;
    pointer-events: none !important;
}

/* Tooltip */
body .bsw-loop-btn::after {
    all: unset;
    content: attr(data-tooltip) !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    transform: translateY(-4px) !important;
    background: var(--bsw-tooltip-bg, #333333) !important;
    color: var(--bsw-tooltip-text, #ffffff) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    white-space: nowrap !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity .2s, transform .2s !important;
    z-index: 99999 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.2) !important;
    line-height: 1.4 !important;
}
/* Flecha alineada a la derecha (donde está el botón) */
body .bsw-loop-btn::before {
    all: unset;
    content: '' !important;
    position: absolute !important;
    top: calc(100% + 3px) !important;
    right: 13px !important;
    left: auto !important;
    transform: translateY(-4px) !important;
    border: 5px solid transparent !important;
    border-bottom-color: var(--bsw-tooltip-bg, #333333) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity .2s, transform .2s !important;
    z-index: 99999 !important;
}
body .bsw-loop-btn:hover::after,
body .bsw-loop-btn:hover::before {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
body .bsw-loop-btn:disabled::after,
body .bsw-loop-btn:disabled::before,
body .bsw-loop-btn.bsw-added::after,
body .bsw-loop-btn.bsw-added::before { display: none !important; }

/* Hover */
body .bsw-loop-btn:hover,
body a.bsw-loop-btn:hover {
    background: var(--bsw-btn-hover-bg, #e8a4c0) !important;
    background-image: none !important;
    border-color: var(--bsw-btn-hover-border, #e8a4c0) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.18) !important;
    transform: scale(1.08) !important;
    color: var(--bsw-btn-hover-icon, #ffffff) !important;
    text-decoration: none !important;
    opacity: 1 !important;
}
body .bsw-loop-btn:hover svg,
body a.bsw-loop-btn:hover svg {
    stroke: var(--bsw-btn-hover-icon, #ffffff) !important;
}

/* Agregado (ya en la lista) */
body .bsw-loop-btn.bsw-added {
    background: var(--bsw-btn-hover-bg, #e8a4c0) !important;
    background-image: none !important;
    border-color: var(--bsw-btn-hover-border, #e8a4c0) !important;
    cursor: default !important;
    transform: none !important;
}
body .bsw-loop-btn.bsw-added svg {
    stroke: var(--bsw-btn-hover-icon, #ffffff) !important;
    fill: var(--bsw-btn-hover-icon, #ffffff) !important;
}
body .bsw-loop-btn.bsw-added:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
}

/* Deshabilitado */
body .bsw-loop-btn:disabled,
body .bsw-loop-btn[disabled] {
    cursor: default !important;
    transform: none !important;
    opacity: 1 !important;
}

/* Ya comprado */
body .bsw-loop-btn.bsw-loop-btn--purchased {
    background: #e8f5e9 !important;
    background-image: none !important;
    border-color: #c8e6c9 !important;
    cursor: default !important;
    pointer-events: none !important;
}
body .bsw-loop-btn.bsw-loop-btn--purchased svg {
    stroke: #388e3c !important;
    fill: #388e3c !important;
}

/* Login requerido */
body a.bsw-loop-btn.bsw-loop-btn--login:hover {
    background: var(--bsw-btn-hover-bg, #e8a4c0) !important;
    border-color: var(--bsw-btn-hover-border, #e8a4c0) !important;
}
body a.bsw-loop-btn.bsw-loop-btn--login:hover svg {
    stroke: var(--bsw-btn-hover-icon, #ffffff) !important;
}

/* ── Wrapper dropdown ── */
.bsw-loop-wrap {
    position: relative !important;
    display: inline-flex !important;
}

/* ── Dropdown del loop ── */
.bsw-wishlist-dropdown--loop {
    top: calc(100% + 6px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 160px !important;
}

/* ── Badge "ya comprado" en título ── */
.bsw-loop-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #388e3c;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 4px;
}


/* ── Botón ♡ en esquina superior derecha de la imagen ── */
.bsw-corner-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 20 !important;
    line-height: 0 !important;
    /* Siempre visible — no requiere hover */
}

/* Mantener compatibilidad con clases anteriores */
.bsw-btns-injected,
.bsw-loop-fallback {
    display: none !important;
}


.bsw-wishlist-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 999;
    min-width: 200px;
    display: none;
}
.bsw-has-dropdown.open + .bsw-wishlist-dropdown,
.bsw-wishlist-dropdown.open { display: block; }
.bsw-wishlist-dropdown li a {
    display: block;
    padding: 10px 16px;
    color: var(--bsw-text);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s;
}
.bsw-wishlist-dropdown li a:hover { background: #fce8f0; }

/* =========================================================
   LANDING PÚBLICA
   ========================================================= */

.bsw-public-landing {
    font-family: var(--bsw-font);
    color: var(--bsw-text);
    min-height: 100vh;
}

/* ── Hero ─────────────────────────────────────────────────── */
.bsw-hero {
    background: linear-gradient(135deg, var(--bsw-theme) 0%, var(--bsw-accent) 100%);
    background-size: cover;
    background-position: center;
    padding: 80px 40px 60px;
    text-align: center;
    position: relative;
    /* Siempre texto oscuro — el fondo suele ser claro (rosado, celeste, etc.)
       Si el usuario sube una foto de portada oscura, el overlay rgba en el template
       garantiza suficiente contraste */
    color: #1a1a1a;
}
/* Cuando hay imagen de portada (definida inline en el template), el texto va blanco
   porque el template añade un overlay oscuro sobre la foto */
.bsw-hero--has-cover {
    color: #ffffff;
}
.bsw-hero--has-cover .bsw-hero-title { text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.bsw-hero--has-cover .bsw-progress-bar { background: rgba(255,255,255,.3); }
.bsw-hero--has-cover .bsw-progress-fill { background: #fff; }

.bsw-hero-content { max-width: 640px; margin: 0 auto; }
.bsw-hero-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: .75;
    margin: 0 0 8px;
}
.bsw-hero-title {
    font-size: clamp(32px, 6vw, 60px);
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 1.1;
    /* Sin text-shadow en colores claros — se ve bien sobre rosa/celeste */
    text-shadow: none;
}
.bsw-hero-date,
.bsw-hero-owner {
    font-size: 15px;
    opacity: .75;
    margin: 4px 0;
}

.bsw-hero-progress {
    max-width: 360px;
    margin: 32px auto 0;
}
.bsw-progress-text { font-size: 13px; opacity: .75; display: block; margin-bottom: 8px; }
.bsw-progress-bar {
    height: 8px;
    background: rgba(0,0,0,.12);
    border-radius: 99px;
    overflow: hidden;
}
.bsw-progress-fill {
    height: 100%;
    background: rgba(0,0,0,.35);
    border-radius: 99px;
    transition: width .6s ease;
}

/* ── Bienvenida ───────────────────────────────────────────── */
.bsw-welcome-section {
    background: var(--bsw-accent);
    padding: 48px 40px;
}
.bsw-welcome-inner {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}
.bsw-welcome-icon { font-size: 32px; margin-bottom: 12px; }
.bsw-welcome-text {
    font-size: 16px;
    line-height: 1.8;
    margin: 0;
    color: #2a2a2a;
    /* Garantiza el salto de línea correcto */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;   /* respeta los saltos de línea del textarea */
    max-width: 100%;
    padding: 0 16px;         /* respira en móvil */
}

/* ── Filtros ──────────────────────────────────────────────── */
.bsw-filters {
    background: #fff;
    border-bottom: 1px solid #f0e0e8;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.bsw-filters-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.bsw-filter-btn {
    padding: 8px 18px;
    border-radius: 99px;
    border: 1.5px solid #eee;
    background: #fafafa;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.bsw-filter-btn:hover,
.bsw-filter-btn--active {
    background: var(--bsw-theme);
    border-color: var(--bsw-theme);
    color: #fff;
}
.bsw-filter-count { opacity: .75; font-size: 12px; }

/* ── Grid de productos ────────────────────────────────────── */
.bsw-products-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}
.bsw-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.bsw-product-card {
    background: #fff;
    border-radius: var(--bsw-radius);
    box-shadow: var(--bsw-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.bsw-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(200, 100, 140, .18);
}
.bsw-product-card--purchased { opacity: .75; }
.bsw-product-card--purchased:hover { transform: none; }

.bsw-product-image-wrap { position: relative; }
.bsw-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.bsw-product-image--placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #fce8f0;
}
.bsw-purchased-overlay {
    position: absolute;
    inset: 0;
    background: rgba(56, 142, 60, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bsw-purchased-seal {
    background: #388e3c;
    color: #fff;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 700;
    transform: rotate(-4deg);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.bsw-product-body { padding: 16px 18px; flex: 1; }
.bsw-product-name { margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.bsw-product-price { margin: 0 0 8px; color: var(--bsw-theme); font-size: 18px; font-weight: 700; }
.bsw-product-purchased-date { font-size: 12px; color: #aaa; margin: 0; }

.bsw-product-footer { padding: 0 18px 18px; }
.bsw-btn-buy {
    display: block;
    text-align: center;
    background: var(--bsw-theme);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all .2s;
}
.bsw-btn-buy:hover { filter: brightness(1.08); transform: scale(1.02); color: #fff; }
.bsw-btn-bought-out {
    display: block;
    text-align: center;
    background: #f1f1f1;
    color: #aaa;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    cursor: default;
}

/* ── Footer de la landing ─────────────────────────────────── */
.bsw-landing-footer {
    text-align: center;
    padding: 32px 24px;
    color: #ccc;
    font-size: 13px;
    border-top: 1px solid #f0e0e8;
}

/* ── Login notice ─────────────────────────────────────────── */
.bsw-login-notice {
    background: #fce8f0;
    border: 1px solid var(--bsw-accent);
    border-radius: 10px;
    padding: 20px 24px;
    text-align: center;
}
.bsw-login-notice a { color: var(--bsw-theme); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .bsw-hero { padding: 60px 16px 48px; }
    .bsw-products-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .bsw-customize-panel { max-width: 100%; }
    .bsw-form-row { grid-template-columns: 1fr; }
    .bsw-share-row { flex-direction: column; }
}
@media (max-width: 400px) {
    .bsw-products-grid { grid-template-columns: 1fr; }
}

/* ── Editor de URL/slug ─────────────────────────────────────── */
.bsw-slug-editor {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #f0e0e8;
    border-radius: 8px;
    font-size: 13px;
}
.bsw-slug-base {
    color: #aaa;
    white-space: nowrap;
    font-family: monospace;
    font-size: 12px;
}
.bsw-slug-input {
    flex: 1;
    min-width: 120px;
    padding: 5px 9px;
    border: 1.5px solid #e0cdd4;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    color: var(--bsw-text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.bsw-slug-input:focus {
    border-color: var(--bsw-theme, #e8a4c0);
    box-shadow: 0 0 0 2px rgba(232,164,192,.15);
}
.bsw-slug-input.bsw-slug-ok    { border-color: #4caf50; }
.bsw-slug-input.bsw-slug-error { border-color: #e53935; }

.bsw-btn-save-slug {
    padding: 5px 12px;
    background: var(--bsw-theme, #e8a4c0);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}
.bsw-btn-save-slug:disabled { opacity: .5; cursor: default; }

.bsw-slug-feedback {
    font-size: 12px;
    font-weight: 500;
    min-width: 0;
}
.bsw-slug-feedback.ok    { color: #388e3c; }
.bsw-slug-feedback.error { color: #c62828; }

.bsw-color-swatch-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e0cdd4;
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s;
    position: relative;
    cursor: pointer;
    min-height: 52px;
}
.bsw-color-swatch-wrap:focus-within { border-color: var(--bsw-theme, #e8a4c0); }

.bsw-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0,0,0,.08);
}

.bsw-color-hex,
.bsw-color-text {
    flex: 1;
    font-size: 13px;
    font-family: monospace;
    color: #888;
    letter-spacing: .04em;
    border: none !important;
    outline: none !important;
    background: transparent;
    padding: 0 !important;
    min-width: 0;
}

.bsw-color-palette-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
    display: none;
}

/* Paleta — fuera del flujo del card */
.bsw-color-palette {
    position: relative;
    margin-top: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid #f0e0e8;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    z-index: 100;
}
.bsw-palette-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.bsw-palette-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1.5px solid rgba(0,0,0,.08);
    cursor: pointer;
    padding: 0;
    transition: transform .15s, box-shadow .15s;
    min-height: 36px;
}
.bsw-palette-color:hover,
.bsw-palette-color:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.bsw-palette-color.selected {
    border: 2.5px solid #333;
    transform: scale(1.1);
}

/* Desktop: mostrar picker nativo, ocultar botón paleta */
@media (hover: hover) and (pointer: fine) {
    .bsw-color-palette-btn { display: none !important; }
    .bsw-color-native {
        position: absolute;
        opacity: 0;
        width: 40px;
        height: 40px;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        border: none;
        padding: 0;
        z-index: 2;
    }
}

/* Móvil: mostrar botón paleta, ocultar picker nativo */
@media (hover: none) and (pointer: coarse) {
    .bsw-color-palette-btn { display: inline-flex !important; }
    .bsw-color-native { display: none !important; }
    .bsw-palette-swatches { grid-template-columns: repeat(5, 1fr); }
    .bsw-palette-color { min-height: 15px; }
}

/* ════════════════════════════════════════════════════════════
   PANEL DE ANALYTICS
════════════════════════════════════════════════════════════ */
.bsw-analytics-wrap {
    border-top: 1px solid #f0e0e8;
    background: #fdfafb;
    border-radius: 0 0 var(--bsw-radius) var(--bsw-radius);
}
.bsw-analytics {
    padding: 20px 24px 24px;
}

/* Métricas */
.bsw-an-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.bsw-an-metric {
    background: #fff;
    border: 1px solid #f0e0e8;
    border-radius: 10px;
    padding: 12px 14px;
}
.bsw-an-metric-label { font-size: 11px; color: #999; margin-bottom: 4px; letter-spacing: .02em; }
.bsw-an-metric-value { font-size: 20px; font-weight: 600; color: var(--bsw-text); line-height: 1; }
.bsw-an-metric-sub   { font-size: 11px; color: #aaa; margin-top: 3px; }
.bsw-an-up           { color: #388e3c; }

/* Filas de dos columnas */
.bsw-an-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.bsw-an-card {
    background: #fff;
    border: 1px solid #f0e0e8;
    border-radius: 10px;
    padding: 14px 16px;
}
.bsw-an-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.bsw-an-empty { font-size: 13px; color: #ccc; }

/* Gráfico de barras vertical */
.bsw-an-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 80px;
    padding-top: 18px;
}
.bsw-an-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 3px;
}
.bsw-an-bar-count { font-size: 10px; color: #ccc; height: 14px; line-height: 14px; }
.bsw-an-bar-track {
    flex: 1;
    width: 100%;
    background: #f5edf1;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.bsw-an-bar-fill {
    width: 100%;
    background: var(--bsw-theme, #e8a4c0);
    border-radius: 3px 3px 0 0;
    transition: height .4s ease;
    min-height: 0;
}
.bsw-an-bar-today { background: #c07090; }
.bsw-an-bar-day   { font-size: 10px; color: #bbb; }
.bsw-an-today-label { color: #c07090; font-weight: 600; }

/* Productos más vistos */
.bsw-an-prod-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}
.bsw-an-prod-name {
    font-size: 12px;
    color: var(--bsw-text);
    width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
.bsw-an-prod-bar {
    flex: 1;
    height: 5px;
    background: #f5edf1;
    border-radius: 99px;
    overflow: hidden;
}
.bsw-an-prod-fill {
    height: 100%;
    background: var(--bsw-theme, #e8a4c0);
    border-radius: 99px;
}
.bsw-an-prod-num { font-size: 12px; color: #aaa; width: 22px; text-align: right; flex-shrink: 0; }

/* Regalos comprados */
.bsw-an-gift-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5edf1;
}
.bsw-an-gift-row:last-of-type { border-bottom: none; }
.bsw-an-gift-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: #f5edf1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bsw-theme, #e8a4c0);
    flex-shrink: 0;
}
.bsw-an-gift-info { flex: 1; }
.bsw-an-gift-name { font-size: 13px; font-weight: 500; color: var(--bsw-text); }
.bsw-an-gift-date { font-size: 11px; color: #bbb; }
.bsw-an-gift-buyer { text-align: right; flex-shrink: 0; }
.bsw-an-gift-buyer-name  { font-size: 12px; font-weight: 500; color: var(--bsw-text); }
.bsw-an-gift-buyer-email { font-size: 11px; color: #aaa; }
.bsw-an-gift-footer {
    font-size: 11px;
    color: #bbb;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #f5edf1;
}



/* Últimas visitas */
.bsw-an-visit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f5edf1;
}
.bsw-an-visit-row:last-child { border-bottom: none; }
.bsw-an-visit-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f5edf1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    flex-shrink: 0;
}
.bsw-an-avatar-known { background: #f5edf1; color: #c07090; }
.bsw-an-visit-info { flex: 1; }
.bsw-an-visit-name { font-size: 13px; color: var(--bsw-text); }
.bsw-an-visit-time { font-size: 11px; color: #bbb; }
.bsw-an-visit-tag  { font-size: 11px; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; }
.bsw-an-tag-bought { background: #e8f5e9; color: #2e7d32; }
.bsw-an-tag-viewed { background: #f5f5f5; color: #aaa; }

/* Botón analytics activo */
.bsw-btn-analytics.bsw-analytics-open { background: #f5edf1; }

@media (max-width: 700px) {
    .bsw-an-metrics { grid-template-columns: repeat(2, 1fr); }
    .bsw-an-row     { grid-template-columns: 1fr; }
    .bsw-an-prod-name { width: 80px; }
}

/* ── Date picker (flatpickr) ── */
.bsw-date-wrap { position: relative; }
.bsw-date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    opacity: .5;
}
/* Sobrescribir estilos de flatpickr para que combine con el panel */
.flatpickr-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.12) !important;
    border: 1px solid #f0e0e8 !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--bsw-theme, #e8a4c0) !important;
    border-color: var(--bsw-theme, #e8a4c0) !important;
}
.flatpickr-day:hover {
    background: #fce8f0 !important;
}
/* El altInput (campo visible) hereda estilos del bsw-input */
.bsw-date-picker + .flatpickr-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0cdd4;
    border-radius: 8px;
    font-size: 14px;
    color: var(--bsw-text);
    background: #fff;
    outline: none;
    cursor: pointer;
}

/* ── Forzar input date nativo visible aunque WoodMart lo interfiera ── */
#bsw-due-date,
#bsw-due-date::-webkit-calendar-picker-indicator {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
}
#bsw-due-date::-webkit-datetime-edit { color: var(--bsw-text, #333); }
#bsw-due-date::-webkit-inner-spin-button { display: none; }

/* ── Color picker visual (paleta) ── */
.bsw-color-swatch-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px solid #e0cdd4;
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s;
}
.bsw-color-swatch-wrap:focus-within { border-color: var(--bsw-theme, #e8a4c0); }

@media (min-width: 1024px) {.bsw-color-swatch-wrap {
    display: grid;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px solid #e0cdd4;
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s;
}}

.bsw-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0,0,0,.08);
}
.bsw-color-text {
    flex: 1;
    border: none !important;
    outline: none !important;
    font-size: 13px;
    font-family: monospace;
    color: #666;
    background: transparent;
    padding: 0 !important;
    min-width: 0;
}
.bsw-color-palette-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
}
.bsw-color-palette-btn:hover { background: #f5edf1; }

/* Paleta desplegable */
.bsw-color-palette {
    margin-top: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid #f0e0e8;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.bsw-palette-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}
.bsw-palette-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    border: 1.5px solid rgba(0,0,0,.1);
    cursor: pointer;
    padding: 0;
    transition: transform .15s, box-shadow .15s;
}
.bsw-palette-color:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    border-color: rgba(0,0,0,.3);
    z-index: 1;
    position: relative;
}
.bsw-palette-color.selected {
    border: 2px solid #333;
    transform: scale(1.15);
}

@media (max-width: 480px) {
    .bsw-palette-swatches { grid-template-columns: repeat(5, 1fr); }
}