﻿/* --------- PÁGINA DE DETALLE: id único y estilos modernos/prerender-safe ---------- */
#tmProductoDetalle {
    --pd-border: 1px solid rgba(0, 0, 0, .06);
    --pd-soft: 10px;
}

/* Hero */
#tmProductoDetalle .pd-hero {
    position: relative;
    overflow: hidden;
    /* para no ver los bordes al escalar */
    --zoom: 2;
    /* factor por defecto: 2x */
    --ox: 50%;
    /* origen X de transform */
    --oy: 50%;
    /* origen Y de transform */
}

#tmProductoDetalle .pd-hero-img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: transform .18s ease-out;
    transform-origin: var(--ox) var(--oy);
    will-change: transform;
}

/* Estado de zoom activo */
.pd-hero.zooming .pd-hero-img {
    transform: scale(var(--zoom));
    cursor: zoom-in;
}

/* Evitar zoom en pantallas touch (opcional) */
@media (hover: none) and (pointer: coarse) {
    .pd-hero.zooming .pd-hero-img {
        transform: none !important;
    }
}

/* Thumbnails: grid fluido, accesible */
#tmProductoDetalle .pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

#tmProductoDetalle .pd-thumb {
    flex: 0 0 auto;
    width: 64px;
    /* ancho fijo */
    height: 64px;
    /* alto fijo */
    object-fit: contain;
    background: #fff;
    border: var(--pd-border);
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: box-shadow .2s, transform .1s;
}

#tmProductoDetalle .pd-thumb:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

#tmProductoDetalle .pd-thumb.active {
    outline: 2px solid #ff7b00;
    outline-offset: 2px;
}

/* Precio */
#tmProductoDetalle .pd-price {
    color: #ff7b00;
    font-weight: 800;
    font-size: 1.25rem;
}

#tmProductoDetalle .pd-meta .badge {
    --bs-badge-bg: #fff2e4;
    --bs-badge-color: #5b5b5b;
    border: 1px solid rgba(255, 123, 0, .25);
    font-weight: 600;
}

/* Secciones de texto */
#tmProductoDetalle .pd-section h5 {
    font-weight: 700;
    margin-bottom: .35rem;
}

#tmProductoDetalle .pd-section .text-body {
    color: #2b2b2b;
}

/* ---------- Lightbox/Viewer (overlay) aislado por id, sin fugas de estilo ---------- */
#tmProductoDetalle .pv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

#tmProductoDetalle .pv-toolbar {
    display: flex;
    gap: .25rem;
    padding: .5rem;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(4px);
}

#tmProductoDetalle .pv-btn {
    background: #ffffff;
    border: none;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#tmProductoDetalle .pv-btn:hover {
    filter: brightness(.96);
}

#tmProductoDetalle .pv-close {
    margin-left: auto;
}

#tmProductoDetalle .pv-stage {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
}

#tmProductoDetalle .pv-img {
    max-width: 100%;
    max-height: 100%;
    transition: transform .06s linear;
}

/* Accesibilidad de foco */
#tmProductoDetalle .pv-btn:focus-visible,
#tmProdImgFix .tm-card:focus-within .tm-thumb {
    outline: 3px solid rgba(255, 123, 0, .35);
    outline-offset: 2px;
}

/* Micro-ajuste de tipografía en detalle */
#tmProductoDetalle h1 {
    font-size: clamp(1.2rem, 1.4rem + 0.8vw, 1.7rem);
}


/* ==================== Producto Detalle: look blanco + naranja ==================== */
#tmProductoDetalle {
    --pd-border: 1px solid rgba(0, 0, 0, .06);
    --pd-soft: 12px;
    --pd-primary: #ff7b00;
    /* naranja marca */
    --pd-primary-2: #ff9d4a;
    /* naranja claro */
    --pd-text: #1f2937;
}

/* Header con botón "Editar" dentro (esquina superior derecha) */
#tmProductoDetalle .pd-header {
    position: relative;
}

#tmProductoDetalle .pd-edit-btn-static {
    position: relative;
    /* Ensure it is not absolute */
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border: none;
    border-radius: 999px;
    padding: .5rem .75rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--pd-primary) 0%, var(--pd-primary-2) 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(255, 123, 0, .22);
    transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
}

#tmProductoDetalle .pd-edit-btn-static i {
    font-size: 1rem;
}

#tmProductoDetalle .pd-edit-btn-static:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(255, 123, 0, .28);
}

@media (max-width: 575.98px) {
    #tmProductoDetalle .pd-edit-btn {
        padding: .5rem;
        border-radius: 12px;
    }
}

/* Imagen hero + thumbnails */
#tmProductoDetalle .pd-hero {
    border: var(--pd-border);
    border-radius: var(--pd-soft);
    background: #fff;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tmProductoDetalle .pd-hero-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

#tmProductoDetalle .pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#tmProductoDetalle .pd-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #fff;
    border: var(--pd-border);
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .06s ease;
}

#tmProductoDetalle .pd-thumb:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

#tmProductoDetalle .pd-thumb.active {
    outline: 2px solid var(--pd-primary);
    outline-offset: 2px;
}

/* Precio + metadatos */
#tmProductoDetalle .pd-price {
    color: var(--pd-primary);
    font-weight: 800;
    font-size: 1.25rem;
}

#tmProductoDetalle .pd-meta .badge {
    --bs-badge-bg: #fff2e4;
    --bs-badge-color: #5b5b5b;
    border: 1px solid rgba(255, 123, 0, .25);
    font-weight: 600;
}

/* Secciones */
#tmProductoDetalle .pd-section h5 {
    font-weight: 700;
    margin-bottom: .35rem;
}

#tmProductoDetalle .pd-section .text-body {
    color: #2b2b2b;
}

/* Lightbox/Viewer */
#tmProductoDetalle .pv-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .85);
    display: flex;
    flex-direction: column;
}

#tmProductoDetalle .pv-toolbar {
    display: flex;
    gap: .25rem;
    padding: .5rem;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(4px);
}

#tmProductoDetalle .pv-btn {
    background: #fff;
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#tmProductoDetalle .pv-btn:hover {
    filter: brightness(.96);
}

#tmProductoDetalle .pv-close {
    margin-left: auto;
}

#tmProductoDetalle .pv-stage {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
}

#tmProductoDetalle .pv-img {
    max-width: 100%;
    max-height: 100%;
    transition: transform .06s linear;
}

#tmProductoDetalle .pv-btn:focus-visible {
    outline: 3px solid rgba(255, 123, 0, .35);
    outline-offset: 2px;
}

/* Panel “dueño” completo */
#pdOwnerPanel .card {
    border-radius: 14px;
}

#pdOwnerPanel .card-header {
    background: linear-gradient(90deg, rgba(255, 123, 0, .08), rgba(255, 123, 0, 0));
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

#pdOwnerPanel .form-label {
    font-weight: 600;
}

#pdOwnerPanel .btn.btn-primary {
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-primary-2));
    border: none;
}

#pdOwnerPanel .btn.btn-primary:focus {
    box-shadow: 0 0 0 .25rem rgba(255, 123, 0, .25);
}


/* ===== Banderola / Breadcrumb + Acciones ===== */
#tmProductoDetalle .pd-banderola {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: .5rem 0 1rem 0;
}

#tmProductoDetalle .pd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    color: #6b7280
}

#tmProductoDetalle .pd-bc,
#tmProductoDetalle .pd-bc-current {
    font-weight: 600;
    text-decoration: none;
    color: #6b7280;
}

#tmProductoDetalle .pd-bc:hover {
    color: #111827
}

#tmProductoDetalle .pd-quick-actions {
    display: flex;
    gap: .4rem
}

/* ===== Buy Box ===== */
#tmProductoDetalle .pd-buybox {
    border: var(--pd-border);
    border-radius: 14px;
    overflow: hidden;
}

#tmProductoDetalle .pd-bb-price {
    font-weight: 900;
    font-size: clamp(1.25rem, 1.05rem + 1vw, 1.8rem);
    color: var(--pd-primary);
}

#tmProductoDetalle .pd-bb-qty .form-label {
    font-weight: 700;
    margin-bottom: .25rem
}

#tmProductoDetalle .pd-bb-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: linear-gradient(0deg, rgba(255, 123, 0, .06), rgba(255, 123, 0, 0));
    border: 1px dashed rgba(255, 123, 0, .25);
}

#tmProductoDetalle .pd-bb-perks {
    list-style: none;
    margin: .75rem 0 0 0;
    padding: 0;
    color: #4b5563;
    font-size: .9rem
}

#tmProductoDetalle .pd-bb-perks li {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin: .2rem 0
}

/* micro-animaciones sutiles */
#tmProductoDetalle .pd-buybox .btn.btn-warning {
    transition: transform .06s ease, box-shadow .15s ease;
    box-shadow: 0 10px 22px rgba(255, 123, 0, .18);
}

#tmProductoDetalle .pd-buybox .btn.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(255, 123, 0, .24);
}

/* ===== Sticky bar móvil ===== */
#tmProductoDetalle .pd-stickybar {
    position: sticky;
    bottom: 0;
    display: none;
    gap: .5rem;
    padding: .5rem .75rem;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .06);
    z-index: 1010;
}

#tmProductoDetalle .pd-sticky-price {
    font-weight: 800;
    color: var(--pd-primary);
    display: flex;
    align-items: baseline
}

/* Solo visible en pantallas chicas */
@media (max-width: 575.98px) {
    #tmProductoDetalle .pd-stickybar {
        display: flex;
    }
}

/* ===== Accesibilidad / motion ===== */
@media (prefers-reduced-motion: reduce) {
    #tmProductoDetalle * {
        transition: none !important;
        animation: none !important;
    }
}


/* Contenedor de cada miniatura con overlay */
.pd-thumb-wrap {
    position: relative;
    display: inline-block;
}

/* Tus miniaturas existentes (solo por si no lo tenías) */
.pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Activa conserva tu borde; ajusta si ya lo tienes */
.pd-thumb.active {
    outline: 2px solid #FF851B;
    /* Naranja IA */
    outline-offset: 1px;
    border-radius: 8px;
}

/* Botón flotante rojo arriba-derecha */
.pd-thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: #DC3545;
    /* rojo bootstrap */
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    cursor: pointer;
    opacity: .95;
    transition: transform .12s ease, opacity .12s ease;
}

.pd-thumb-del:hover {
    opacity: 1;
    transform: scale(1.06);
}

.pd-thumb-del:disabled {
    opacity: .6;
    cursor: default;
}

.pd-thumb-del .spinner-border {
    width: 14px;
    height: 14px;
}


#tmProductoDetalle .pv-img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    /* 👈 centra el origen */
    transition: transform .12s ease-out;
    will-change: transform;
}

/* ===== Modal EditAll: Apartado OFERTA ===== */
.pd-offer-card {
    border: 1px solid rgba(255,123,0,.18);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,123,0,.06), rgba(255,255,255,0));
}

.pd-offer-head {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255,123,0,.16);
    background: rgba(255,123,0,.06);
}

.pd-offer-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ff7b00, #ff9d4a);
    color: #fff;
    box-shadow: 0 8px 18px rgba(255,123,0,.22);
}

.pd-offer-pill {
    display: inline-flex;
    align-items: center;
    padding: .35rem .6rem;
    border-radius: 999px;
    font-weight: 800;
    background: #fff;
    border: 1px solid rgba(255,123,0,.25);
    color: #ff7b00;
    white-space: nowrap;
}

.pd-offer-body {
    padding: 12px 14px 14px;
}

.pd-offer-check .form-check-input:checked {
    background-color: #ff7b00;
    border-color: #ff7b00;
}

/* ===================================================================
   OFERTA — ProductoDetalle
   =================================================================== */

/* Contenedor de precios cuando hay oferta */
#tmProductoDetalle .pd-oferta-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .25rem;
}

/* Precio original tachado */
#tmProductoDetalle .pd-precio-original {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
}

/* Precio oferta grande y brillante */
#tmProductoDetalle .pd-precio-oferta {
    font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    font-weight: 900;
    background: linear-gradient(90deg, #e63000 0%, #ff7b00 50%, #e63000 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pd-price-shine 3s linear infinite;
    letter-spacing: .2px;
}

@keyframes pd-price-shine {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

/* Badge "En Oferta" inline */
#tmProductoDetalle .pd-oferta-badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: linear-gradient(135deg, #ff3c00, #ff7b00);
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 60, 0, .35);
    animation: pd-badge-pulse 2.8s ease-in-out infinite;
    align-self: center;
}

@keyframes pd-badge-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .82;
    }
}

/* En móvil el precio oferta un poco más pequeño */
@media (max-width: 575px) {
    #tmProductoDetalle .pd-precio-oferta {
        font-size: 1.4rem;
    }
}