/* DP Tienda Online - Conversión (Avisame, Vistos recientemente, Favoritos, cross-sell, envío gratis en drawer).
   Usa las variables del tema (--primary-color, --text-color, --border-color) con fallbacks. */

.dp-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- Avisame cuando vuelva ---------- */
.dp-stock-alert {
    margin: 12px 0;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
}
.dp-stock-alert[hidden] { display: none !important; }
.dp-stock-alert:empty { display: none; }
.dp-stock-alert__title { margin: 0 0 2px; font-size: 0.98rem; }
.dp-stock-alert__text,
.dp-stock-alert__variant { margin: 0 0 10px; font-size: 0.86rem; color: #475569; }
.dp-stock-alert__variant { font-weight: 600; color: #334155; }
.dp-stock-alert__form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.dp-stock-alert__form[hidden] { display: none; }
.dp-stock-alert__input {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px; /* evita zoom en iOS */
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
}
.dp-stock-alert__input:focus { outline: 2px solid var(--primary-color, #2563eb); outline-offset: 1px; }
.dp-stock-alert__btn { flex: 0 0 auto; min-height: 44px; padding: 10px 18px; white-space: nowrap; }
.dp-stock-alert__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.dp-stock-alert__msg { margin: 8px 0 0; font-size: 0.88rem; }
.dp-stock-alert__msg:empty { display: none; }
.dp-stock-alert__msg.is-success { color: #047857; font-weight: 600; margin-top: 4px; }
.dp-stock-alert__msg.is-error { color: #dc2626; }

/* ---------- Vistos recientemente ---------- */
.dp-rv { padding: 28px 0 32px; }
.dp-rv__title { margin: 0 0 14px; }
.dp-rv__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.dp-rv__card {
    flex: 0 0 150px;
    max-width: 150px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: var(--text-color, #1e293b);
}
@media (min-width: 768px) {
    .dp-rv__card { flex-basis: 180px; max-width: 180px; }
}
.dp-rv__card__img,
.dp-wl-row__link__img {
    display: block;
    aspect-ratio: var(--product-image-aspect, 1 / 1);
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}
.dp-rv__card__img img,
.dp-wl-row__link__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-rv__card__name,
.dp-wl-row__link__name {
    font-size: 0.88rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dp-rv__card__price,
.dp-wl-row__link__price { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 0.9rem; }
.dp-rv__card__price s,
.dp-wl-row__link__price s,
.dp-xsell__price s { color: #94a3b8; font-size: 0.8em; }

/* ---------- Favoritos ---------- */
.dp-wl-host { position: relative; }
.dp-wl-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    -webkit-tap-highlight-color: transparent;
}
.dp-wl-heart svg,
.dp-wl-detail svg,
.dp-wl-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.dp-wl-heart.is-active,
.dp-wl-detail.is-active { color: #e11d48; }
.dp-wl-heart.is-active svg,
.dp-wl-detail.is-active svg,
.dp-wl-fab svg { fill: currentColor; }
.dp-wl-heart:focus-visible,
.dp-wl-detail:focus-visible,
.dp-wl-fab:focus-visible { outline: 2px solid var(--primary-color, #2563eb); outline-offset: 2px; }
.dp-wl-pop { animation: dp-wl-pop 0.32s ease-out; }
@keyframes dp-wl-pop { 0% { transform: scale(1); } 50% { transform: scale(1.22); } 100% { transform: scale(1); } }

.dp-wl-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 10px;
    padding: 6px 12px;
    min-height: 36px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color, #334155);
    font-size: 0.85rem;
    cursor: pointer;
}

.dp-wl-fab {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: 16px;
    z-index: 998;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #e11d48;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: bottom 0.2s ease;
}
.dp-wl-fab[hidden] { display: none !important; }
.dp-wl-fab svg { width: 22px; height: 22px; }
.dp-wl-fab__count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-color, #0f172a);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.dp-wl-panel { position: fixed; inset: 0; z-index: 10050; display: none; }
.dp-wl-panel.is-open { display: block; }
.dp-wl-panel__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.dp-wl-panel__box {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(380px, 100vw);
    background: #fff;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 18px rgba(15, 23, 42, 0.18);
}
.dp-wl-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.dp-wl-panel__title { margin: 0; font-size: 1.1rem; color: #0f172a; }
.dp-wl-panel__close,
.dp-wl-row__remove {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #475569;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.dp-wl-panel__close:hover,
.dp-wl-row__remove:hover { background: #f1f5f9; }
.dp-wl-panel__body { flex: 1; overflow-y: auto; padding: 12px 18px 24px; }
.dp-wl-panel__empty { color: #64748b; font-size: 0.92rem; }
.dp-wl-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.dp-wl-row__link {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    align-items: center;
    text-decoration: none;
    color: #0f172a;
}
.dp-wl-row__link__img { grid-row: 1 / span 2; width: 64px; }
html.dp-wl-lock, html.dp-wl-lock body { overflow: hidden; }

/* ---------- Carrito: barra de envío gratis (drawer) ---------- */
.dp-cart-fs {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 20px 14px;
    background: #ecfdf5;
    border-bottom: 1px solid #a7f3d0;
    color: #065f46;
}
.dp-cart-fs[hidden] { display: none !important; }
.dp-cart-fs__text { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.35; color: #065f46; }
.dp-cart-fs__track { height: 8px; border-radius: 999px; background: #d1fae5; overflow: hidden; }
.dp-cart-fs__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: #10b981; transition: width 0.35s ease; }
.dp-cart-fs.is-done .dp-cart-fs__fill { background: #059669; }

/* ---------- Carrito: Completá tu compra ---------- */
.dp-xsell { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e2e8f0; color: #0f172a; }
.dp-xsell--page { max-width: 760px; margin: 24px auto 8px; padding: 16px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 12px; }
.dp-xsell__title { margin: 0 0 10px; font-weight: 700; font-size: 0.98rem; }
.dp-xsell__list { display: flex; flex-direction: column; gap: 10px; }
.dp-xsell__item { display: flex; align-items: center; gap: 10px; }
.dp-xsell__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0f172a; }
.dp-xsell__img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.dp-xsell__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-xsell__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dp-xsell__name { font-size: 0.86rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-xsell__price { display: flex; gap: 6px; align-items: baseline; font-size: 0.86rem; }
.dp-xsell__btn { flex: 0 0 auto; min-height: 36px; padding: 6px 12px !important; font-size: 0.82rem !important; width: auto !important; white-space: nowrap; }
.dp-xsell__btn[disabled] { opacity: 0.7; cursor: default; }
