/* ═══════════════════════════════════════════════════════════════
   PÁGINA TODOS LOS PRODUCTOS (tp = todos-productos)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --tp-bg: #f5f0e9;
    --tp-surface: #fbf8f2;
    --tp-ink: #2f231b;
    --tp-muted: #6c5b4f;
    --tp-brand: #936647;
    --tp-gold: #c39a5f;
    --tp-line: rgba(79, 57, 41, 0.2);
}

.tp-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    min-height: 100vh;
    background: var(--tp-bg);
}

.tp-header {
    text-align: center;
    margin-bottom: 32px;
}

.tp-header h1 {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: var(--tp-ink);
    margin: 0;
}

.tp-header h1 i {
    color: var(--tp-gold);
    margin-right: 8px;
}

.tp-header p {
    font-family: "Lato", sans-serif;
    color: var(--tp-muted);
    margin: 6px 0 0;
    font-size: 1rem;
}

.tp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Montserrat", sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tp-brand);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.tp-back:hover {
    color: var(--tp-ink);
}

/* ─── Toolbar ─── */
.tp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tp-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--tp-brand);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition:
        transform 0.2s,
        background 0.2s;
    white-space: nowrap;
}

.tp-toolbar-btn:hover {
    transform: translateY(-2px);
    background: #7a533a;
}

.tp-count {
    font-family: "Montserrat", sans-serif;
    font-size: 0.82rem;
    color: var(--tp-muted);
}

.tp-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.tp-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tp-muted);
    font-size: 0.85rem;
}

.tp-search input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--tp-line);
    border-radius: 999px;
    background: #fff;
    font-family: "Lato", sans-serif;
    font-size: 0.9rem;
    color: var(--tp-ink);
    outline: none;
    transition: border-color 0.25s;
}

.tp-search input:focus {
    border-color: var(--tp-gold);
}

/* ─── Grid ─── */
.tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tp-card {
    border: 1px solid var(--tp-line);
    border-radius: 16px;
    background: #fffdf9;
    box-shadow: 0 10px 24px rgba(34, 22, 12, 0.05);
    transition:
        transform 0.32s cubic-bezier(0.33, 1, 0.68, 1),
        box-shadow 0.32s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
}

.tp-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 18px 34px rgba(34, 22, 12, 0.12),
        0 0 0 1px rgba(147, 102, 71, 0.15);
    border-color: rgba(147, 102, 71, 0.3);
}

.tp-card__img {
    position: relative;
    overflow: hidden;
}

.tp-card__img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.tp-card:hover .tp-card__img img {
    transform: scale(1.08);
}

.tp-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-family: "Montserrat", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--tp-brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 22, 12, 0.18);
}

.tp-card__badge[data-type="discount"] {
    background: #c0392b;
}

.tp-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.tp-card__title {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--tp-ink);
    line-height: 1.2;
}

.tp-card__desc {
    margin: 0;
    font-family: "Lato", sans-serif;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--tp-muted);
    flex: 1;
}

.tp-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}

.tp-card__price {
    font-family: "Lato", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tp-brand);
}

.tp-card__price--old {
    text-decoration: line-through;
    color: #bba58a;
    font-weight: 600;
    margin-right: 0.2rem;
}

.tp-card__add {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 1px solid rgba(147, 102, 71, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: var(--tp-brand);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.tp-card__add:hover {
    background: var(--tp-brand);
    color: #fff;
    transform: scale(1.06);
}

/* ─── Status ─── */
.tp-status {
    margin: 0 0 16px;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px dashed #dcc8a3;
    background: #fbf3e5;
    color: #6c5223;
    font-size: 0.84rem;
    line-height: 1.5;
}

.tp-status.is-info {
    border-color: #c4dce0;
    background: #eaf6f8;
    color: #265f66;
}

.tp-status.is-danger {
    border-color: #efc8c3;
    background: #faece9;
    color: #8e3f35;
}

/* ─── Footer ─── */
.tp-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--tp-line);
}

.tp-btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--tp-brand);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition:
        transform 0.25s,
        box-shadow 0.25s,
        background 0.25s;
}

.tp-btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(147, 102, 71, 0.35);
    background: #7a533a;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL DE DETALLE (tpm = todos-productos-modal)
   ═══════════════════════════════════════════════════════════════ */

.tpm-modal[hidden] {
    display: none;
}

.tpm-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 0.5rem;
    animation: tpmFadeIn 0.22s ease;
}

.tpm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 16, 11, 0.65);
    backdrop-filter: blur(3px);
}

.tpm-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    border: 1px solid rgba(147, 102, 71, 0.32);
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 4% 8%,
            rgba(195, 154, 95, 0.1) 0%,
            transparent 42%
        ),
        radial-gradient(
            circle at 94% 6%,
            rgba(29, 111, 120, 0.08) 0%,
            transparent 44%
        ),
        #f5efe4;
    box-shadow: 0 24px 58px rgba(23, 16, 11, 0.45);
    display: flex;
    flex-direction: column;
}

.tpm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid rgba(147, 102, 71, 0.2);
    background: rgba(245, 237, 224, 0.9);
    backdrop-filter: blur(4px);
}

.tpm-crumb {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6a4d22;
    text-transform: uppercase;
}

.tpm-crumb i {
    color: var(--tp-gold);
    margin-right: 6px;
}

.tpm-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dfcba8;
    background: #f8f0df;
    color: #6c5223;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition:
        background 0.2s,
        transform 0.2s;
}

.tpm-close:hover {
    background: #efe1ca;
    transform: scale(1.05);
}

.tpm-body {
    flex: 1;
    overflow: auto;
    padding: 0.9rem;
}

.tpm-detail {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
    gap: 1rem;
}

.tpm-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tpm-main-img {
    position: relative;
    aspect-ratio: 4 / 5;
    max-height: 520px;
    border-radius: 16px;
    border: 1px solid #e0d2ba;
    overflow: hidden;
    background: #f0e8db;
    box-shadow: 0 12px 28px rgba(47, 35, 27, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpm-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.tpm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition:
        opacity 0.25s,
        background 0.2s;
    backdrop-filter: blur(3px);
}

.tpm-main-img:hover .tpm-nav {
    opacity: 1;
}

.tpm-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.08);
}

.tpm-nav--prev {
    left: 12px;
}
.tpm-nav--next {
    right: 12px;
}

.tpm-thumbs {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #bd9a7f transparent;
}

.tpm-thumbs::-webkit-scrollbar {
    height: 4px;
}
.tpm-thumbs::-webkit-scrollbar-track {
    background: transparent;
}
.tpm-thumbs::-webkit-scrollbar-thumb {
    background: #bd9a7f;
    border-radius: 4px;
}

.tpm-thumb {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 10px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #e8dccb;
    transition:
        border-color 0.2s,
        transform 0.2s;
}

.tpm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpm-thumb.is-active {
    border-color: var(--tp-gold);
    transform: scale(1.05);
}

.tpm-thumb:hover {
    border-color: rgba(195, 154, 95, 0.6);
    transform: scale(1.03);
}

/* ─── Info ─── */
.tpm-info {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.2rem 0;
}

.tpm-info__cat {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--tp-brand);
}

.tpm-info__title {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    color: #32281d;
    line-height: 1.15;
}

.tpm-info__price {
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #77582e;
    margin: 0;
}

.tpm-price--old {
    text-decoration: line-through;
    color: #bba58a;
    font-weight: 600;
    margin-right: 0.3rem;
}

.tpm-price--discount {
    color: #c0392b;
}

.tpm-info__desc {
    font-family: "Lato", sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #5c4a38;
    margin: 0;
}

.tpm-info__details {
    margin-top: 0.3rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e8dccb;
}

.tpm-info__details h6 {
    margin: 0 0 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9a7d5a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tpm-info__details h6 i {
    color: var(--tp-gold);
}

.tpm-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.8rem;
}

.tpm-dl {
    font-size: 0.67rem;
    font-weight: 600;
    color: #9a8470;
    display: block;
    margin-bottom: 2px;
}

.tpm-dv {
    font-size: 0.84rem;
    font-weight: 600;
    color: #473426;
}

.tpm-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
}

.tpm-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #5c4a38;
}

.tpm-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* ─── Otros productos ─── */
.tpm-others {
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e8dccb;
}

.tpm-others h6 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9a7d5a;
    margin: 0 0 0.55rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tpm-others h6 i {
    color: var(--tp-gold);
}

.tpm-others-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, 170px);
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #bd9a7f transparent;
}

.tpm-others-row::-webkit-scrollbar {
    height: 4px;
}
.tpm-others-row::-webkit-scrollbar-track {
    background: transparent;
}
.tpm-others-row::-webkit-scrollbar-thumb {
    background: #bd9a7f;
    border-radius: 4px;
}

.tpm-other-card {
    border: 1px solid #e2d3bb;
    border-radius: 14px;
    background: #fff;
    color: #33291d;
    cursor: pointer;
    text-align: left;
    padding: 0;
    overflow: hidden;
    transition:
        transform 0.22s,
        box-shadow 0.22s,
        border-color 0.22s;
}

.tpm-other-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(47, 35, 27, 0.12);
    border-color: var(--tp-gold);
}

.tpm-other-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.tpm-other-card__body {
    padding: 0.45rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tpm-other-card__body strong {
    display: block;
    font-size: 0.75rem;
    color: #2f231b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tpm-other-card__body small {
    font-size: 0.7rem;
    color: #8a6a3a;
    font-weight: 700;
}

/* ─── Estados ─── */
.tpm-status {
    margin: 0 0 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px dashed #dcc8a3;
    background: #fbf3e5;
    color: #6c5223;
    font-size: 0.84rem;
}

.tpm-status.is-info {
    border-color: #c4dce0;
    background: #eaf6f8;
    color: #265f66;
}

.tpm-status.is-danger {
    border-color: #efc8c3;
    background: #faece9;
    color: #8e3f35;
}

/* ─── Animaciones ─── */
@keyframes tpmFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Responsive ─── */
@media (max-width: 880px) {
    .tpm-detail {
        grid-template-columns: 1fr;
    }
    .tpm-main-img {
        max-width: 500px;
        margin: 0 auto;
    }
    .tpm-info__title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }
}

@media (max-width: 768px) {
    .tp-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .tp-card__img img {
        height: 140px;
    }
}

@media (max-width: 580px) {
    .tpm-dialog {
        border-radius: 16px;
        width: calc(100vw - 0.4rem);
        max-height: calc(100vh - 0.4rem);
    }
    .tpm-body {
        padding: 0.6rem;
    }
    .tpm-details-grid {
        grid-template-columns: 1fr;
    }
    .tpm-others-row {
        grid-auto-columns: minmax(100px, 130px);
    }
}

@media (max-width: 400px) {
    .tp-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
    .tp-card__img img {
        height: 120px;
    }
    .tp-page {
        padding: 20px 12px 40px;
    }
    .tp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .tp-search {
        max-width: 100%;
    }
}
