/* ============================================================================
   shared-products-dimona.css
   Styling for the Dimona product grid/cards (see shared-products-dimona.js)
   ========================================================================== */

/* Google Fonts (Figtree) removed - using system fonts instead, per inicio.html CSP */

/* ─── Grid / strip layout ─────────────────────────────────────────────────── */

.dimona-products-grid,
.products-grid, .posts-grid,
[id="productsContainer"], [id="allPostsContainer"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 8px 0;
    container-type: inline-size;
}

@media (max-width: 1100px) {
    .dimona-products-grid,
    [id="productsContainer"],
    [id="allPostsContainer"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .dimona-products-grid,
    [id="productsContainer"],
    [id="allPostsContainer"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .dimona-products-grid,
    [id="productsContainer"],
    [id="allPostsContainer"] {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Horizontal strip scrollbar styling */
[id="artContainer"]::-webkit-scrollbar,
[id="candidatoArtsContainer"]::-webkit-scrollbar {
    height: 4px;
}

[id="artContainer"]::-webkit-scrollbar-track,
[id="candidatoArtsContainer"]::-webkit-scrollbar-track {
    background: transparent;
}

[id="artContainer"]::-webkit-scrollbar-thumb,
[id="candidatoArtsContainer"]::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ─── Product card ─────────────────────────────────────────────────────────── */

.dimona-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f4f3ef;
    border: none;
    border-radius: 32px;
    overflow: hidden;
    font-family: 'Figtree', sans-serif;
    font-weight: 400;
    padding: 12px;
}

/* ─── Image ────────────────────────────────────────────────────────────────── */

.dimona-product-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #e2e2e2;
    border-radius: 26px;
    overflow: hidden;
    cursor: pointer;
    /* Makes cqw/cqi units below relative to THIS card's own width,
       not the viewport — so the cart button scales with the product
       container regardless of grid columns or screen size. */
    container-type: inline-size;
}

.dimona-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Hover zoom */
.dimona-product-image-wrap:hover .dimona-product-image {
    transform: scale(1.05);
}

.dimona-product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #b5b5bb;
}

/* ─── Quick add-to-cart icon (overlay on product image) ───────────────────── */

.dimona-cart-icon-btn {
    position: absolute;
    right: 7cqw;
    bottom: 7cqw;
    width: 14cqw;
    height: 14cqw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #712bf5;
    border: none;
    border-radius: 4.2cqw 4.2cqw 0.84cqw 4.2cqw;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(113, 43, 245, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.dimona-cart-icon-btn:hover {
    background: #5f22d6;
    transform: scale(1.06);
}

.dimona-cart-icon-btn:active {
    transform: scale(0.96);
}

.dimona-cart-icon-img {
    width: 5.74cqw;
    height: 5.74cqw;
    object-fit: contain;
    /* Recolor the (black) source icon to white */
    filter: brightness(0) invert(1);
}

/* ─── Body / text content ─────────────────────────────────────────────────── */

.dimona-product-body {
    flex: 1;
    min-width: 0;
    padding: 12px 4px 4px;
}

/* Product Title: Figtree Medium (500) */
.dimona-product-title {
    margin: 0;
    font-size: 20.8px;
    font-weight: 500 !important;
    color: #151219;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price: Figtree Semi Bold */
.dimona-product-price {
    display: flex;
    align-items: baseline;
    margin-top: 2px;
    font-family: 'Figtree Semi Bold', 'Figtree', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #151219;
    line-height: normal;
}

.dimona-product-price strong {
    font-family: 'Figtree Semi Bold', 'Figtree', sans-serif;
    font-weight: 700 !important;
    color: #151219 !important;
    font-size: 26px;
    line-height: normal;
}

/* Remove freight note entirely */
.dimona-freight-note {
    display: none !important;
}

/* ─── Variant preview (color dots) ────────────────────────────────────────── */

.dimona-variant-preview {
    margin-top: 10px;
    margin-bottom: 10px;
}

.dimona-variant-preview-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dimona-color-dots {
    display: flex;
    align-items: center;
}

.dimona-color-dot {
    display: inline-block;
    width: 21.6px;
    height: 21.6px;
    border-radius: 50%;
    border: none;
    flex-shrink: 0;
    margin-left: -8px;
}

.dimona-color-dot:first-child {
    margin-left: 0;
}

.dimona-color-count {
    font-size: 15px;
    font-weight: 500;
    color: #4a4a4f;
}

.dimona-no-variants {
    font-size: 0.72rem;
    font-weight: 400 !important;
    color: #9a9aa1;
}

/* ─── Artist row ───────────────────────────────────────────────────────────── */

.dimona-artist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    position: relative;
}

.dimona-artist-avatar {
    width: 38.4px;
    height: 38.4px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    background: #1c1c1f;
}

/* Artist Name: Figtree Medium (500) */
.dimona-artist-name {
    font-size: 22.4px;
    font-weight: 500 !important;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.dimona-artist-name:hover,
.dimona-artist-avatar:hover {
    opacity: 0.75;
}

/* ─── Manage menu (vincular arte / excluir) — three-dot menu, same row as
   the artist profile picture, opens upward ─────────────────────────────── */

.dimona-manage-menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.dimona-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9a9aa1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease, color 0.15s ease;
}

.dimona-menu-trigger:hover,
.dimona-manage-menu.open .dimona-menu-trigger {
    background: #f1f1f3;
    color: #1c1c1f;
}

/* Drops UPWARD, anchored above the trigger */
.dimona-menu-dropdown {
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.dimona-manage-menu.open .dimona-menu-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Same square ratio/shape as .dimona-artist-avatar (38.4px, radius 10px) */
.dimona-menu-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38.4px;
    height: 38.4px;
    border-radius: 10px;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.dimona-menu-item:hover { filter: brightness(1.08); }
.dimona-menu-item:active { transform: scale(0.94); }

.dimona-menu-item-accent { background: #5b4bff; }
.dimona-menu-item-danger { background: #e0475a; }

/* ─── Product Modal Styles ───────────────────────────────────────────────── */
/* Recolored/restyled to match the outer card's visual identity:
   #f4f3ef surfaces, deep rounding, Figtree type, #151219 text, #712bf5 accent. */

#productModal .modal-dialog {
    margin: 0.5rem auto;
    max-width: 1100px;
}

#productModal .modal-content {
    border-radius: 28px;
    font-family: 'Figtree', sans-serif;
    background: #fff;
    overflow: hidden;
    min-height: 660px;
}

#productModal .btn-close {
    background-color: #fff;
    opacity: 1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

#productModal .pm-share-btn {
    position: absolute;
    top: 8px;                 /* sits right beside the close button */
    right: 48px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #151219;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.15s ease, transform 0.15s ease;
}

#productModal .pm-share-btn:hover {
    background: #f1f1f3;
    transform: scale(1.05);
}

#productModal .pm-title {
    padding: 0 56px 0 0;
    margin: 8px 0 0;
    font-size: 1.72rem;
    font-weight: 500;
    line-height: 1.2;
    color: #151219;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#productModal .pm-wrap {
    display: flex;
    gap: 0;
    min-height: 500px;
}

#productModal .pm-left {
    flex: 1 1 58%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    background: #f7f4f0;
    border-radius: 20px 0 0 20px;
    padding: 0 0 16px;
    position: relative;
}

#productModal #thumbnail-container {
    width: calc(100% - 18px);
    max-width: none;
    aspect-ratio: 1 / 1.2;
    display: block;
    margin: 10px auto 0;
    padding: 0;
}

#productModal #thumbnail-container > div {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #f4f3ef;
    box-shadow: inset 0 0 0 1px rgba(21, 18, 25, 0.04);
}

#productModal .pm-left img.pm-main-img,
#productModal #modal-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    border-radius: 18px;
    display: block;
    transform: scale(1.08);
    transform-origin: center;
}

#productModal .pm-left .pm-product-label {
    font-size: 0.75rem;
    color: #9a9aa1;
    margin-top: 10px;
}

#productModal .pm-art-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid rgba(113, 43, 245, 0.12);
    border-radius: 16px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(20, 18, 25, 0.05);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

#productModal .pm-art-strip:hover {
    background: #f7f3ff;
    border-color: rgba(113, 43, 245, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(113, 43, 245, 0.08);
}

#productModal .pm-art-strip img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(113, 43, 245, 0.12);
    background: #fafafa;
    flex-shrink: 0;
}

#productModal .pm-art-strip .pm-art-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

#productModal .pm-art-strip .pm-art-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a9aa1;
    font-weight: 400;
}

#productModal .pm-art-strip .pm-art-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #151219;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#productModal .pm-art-strip .pm-art-price {
    font-size: 0.75rem;
    color: #712bf5;
    font-weight: 600;
}

#vinculatedArtModalContainer {
    margin-top: 12px;
    padding: 12px;
    background: #f4f3ef;
    border-radius: 16px;
    border: 1px solid #eceae4;
    display: none;
}

#vinculatedArtModalContainer.show {
    display: block;
}

#vinculatedArtModalContainer .art-card {
    box-shadow: none;
    border: 1px solid #eceae4;
}

#productModal .pm-right {
    flex: 1 1 42%;
    display: flex;
    flex-direction: column;
    padding: 28px 24px 20px;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

/* Price: same Figtree Semi Bold styling as the card price */
#productModal .pm-price {
    margin-top: 6px;
    font-family: 'Figtree Semi Bold', 'Figtree', sans-serif;
}

#productModal .pm-price strong {
    font-family: 'Figtree Semi Bold', 'Figtree', sans-serif;
    font-weight: 700 !important;
    color: #151219 !important;
    font-size: 24px;
    line-height: normal;
}

#productModal .pm-price .pm-freight-row {
    font-size: 0.85rem;
    font-weight: 400;
    color: #9a9aa1;
    margin-top: 4px;
}

#productModal .pm-price .pm-total-row {
    font-size: 0.9rem;
    font-weight: 500;
    color: #712bf5;
    margin-top: 4px;
}

#productModal .pm-trust-copy {
    display: none !important;
}

#productModal .pm-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#productModal .color-option-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    border: 2px solid #e2e2e2;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

#productModal .color-option-btn:hover {
    transform: scale(1.08);
}

#productModal .color-option-btn.selected {
    border-color: #712bf5;
}

#productModal #selected-color-name {
    color: #9a9aa1;
    font-size: 0.82rem;
}

#productModal .pm-thumbnail-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-bottom: 4px;
}

#productModal .pm-thumb-dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: rgba(21, 18, 25, 0.22);
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

#productModal .pm-thumb-dot.active {
    width: 18px;
    border-radius: 999px;
    background: #712bf5;
}

#productModal .pm-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

#productModal .pm-art-strip {
    margin-top: 0;
    width: 100%;
}

/* ── Buttons (replace bootstrap btn-* look) ─────────────────────────────── */

#productModal .pm-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 13px 14px;
    min-height: 52px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

#productModal .pm-btn:active {
    transform: scale(0.97);
}

#productModal .pm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#productModal .pm-btn-primary {
    background: #712bf5;
    color: #fff;
}

#productModal .pm-btn-primary:hover:not(:disabled) {
    background: #5f22d6;
}

#productModal .pm-btn-outline {
    background: #fff;
    color: #151219;
    border: 1.5px solid #e2e2e2;
}

#productModal .pm-btn-outline:hover {
    border-color: #712bf5;
    color: #712bf5;
}

#productModal .pm-btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

#productModal .pm-btn-outline .pm-btn-icon {
    filter: none;
}

/* ── Size panel ──────────────────────────────────────────────────────────── */

#productModal .pm-size-panel {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 0 20px 20px 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    z-index: 10;
    overflow-y: auto;
}

#productModal .pm-size-panel.open {
    transform: translateX(0);
}

#productModal .pm-size-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

#productModal .pm-size-panel h6 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #151219;
    margin: 0;
}

#productModal .pm-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: #f4f3ef;
    color: #151219;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

#productModal .size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

#productModal .size-chip {
    border: 1.5px solid #e2e2e2;
    border-radius: 12px;
    background: #fff;
    color: #151219;
    padding: 10px 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

#productModal .size-chip-label {
    font-weight: 700;
}

#productModal .size-chip:hover:not(:disabled) {
    border-color: #712bf5;
    color: #712bf5;
}

#productModal .size-chip.selected {
    background: #712bf5;
    color: #fff;
    border-color: #712bf5;
}

#productModal .size-chip--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f3f1;
    color: #8a8791;
}

#productModal .pm-size-confirm {
    margin-top: auto;
    min-height: 52px;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (max-width: 767px) {
    /* Bottom sheet: dialog fills the screen and pins the card to the bottom */
    #productModal .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: 100% !important;
        display: flex;
        align-items: flex-end;
        transform: none !important;
    }
    /* Card = flex column: handle on top, body scrolls inside. The close/share
       buttons live on the card (not inside the scroller) so they never scroll away. */
    #productModal .modal-content {
        display: flex;
        flex-direction: column;
        min-height: 0;                 /* desktop has min-height:660px — must be reset */
        max-height: 92vh;
        max-height: 92dvh;
        border: none;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    }
    #productModal .modal-content::before {
        content: '';
        display: block;
        flex: none;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto 0;
    }
    #productModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    #productModal .pm-wrap {
        flex-direction: column;
        min-height: 0;
    }

    /* ── Image: square, centered, with room for the close/share buttons ── */
    #productModal .pm-left {
        flex: none;
        width: 100%;
        min-height: 0;
        max-height: none;
        border-radius: 0;
        padding: 34px 16px 12px;       /* top space = close/share buttons */
        align-items: center;
        justify-content: flex-start;
    }
    #productModal #thumbnail-container {
        width: min(100%, 46vh);
        max-width: 100%;
        aspect-ratio: 1 / 1;
        margin: 0 auto;
    }
    /* dots sit over the bottom of the photo instead of stacking on top of it */
    #productModal .pm-thumbnail-nav {
        position: absolute;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%);
        margin: 0;
        padding: 5px 8px;
        background: rgba(255,255,255,0.78);
        border-radius: 999px;
        z-index: 2;
    }
    /* the linked art already has its own strip below — don't overlay it on the photo */
    #productModal #thumbnail-container .d-flex { display: none !important; }

    /* ── Info column ── */
    #productModal .pm-right {
        flex: none;
        width: 100%;
        padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        gap: 12px;
        overflow: visible;
    }
    #productModal .pm-title {
        padding: 0;
        margin: 0;
        font-size: 1.2rem;
        font-weight: 600;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    #productModal .pm-price { margin-top: 0; }
    #productModal .pm-price strong { font-size: 22px; }
    #productModal .pm-colors { justify-content: flex-start; gap: 10px; }
    #productModal #selected-color-name { display: block; text-align: left; margin-top: -4px; }
    #productModal .color-option-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
        min-height: 36px;
    }
    #productModal .pm-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 4px;
    }
    #productModal .pm-btn {
        flex: none;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        font-size: 1rem;
    }
    #productModal .pm-art-strip { margin-top: 0; padding: 8px; }
    #productModal .pm-art-strip img { width: 40px; height: 40px; }
    #vinculatedArtModalContainer { margin-top: 0; padding: 8px; }

    /* ── Size picker: second bottom sheet above the product sheet ── */
    #productModal .pm-size-panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 22px 22px 0 0;
        z-index: 1060;
        padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        max-height: 80vh;
        max-height: 80dvh;
        overflow-y: auto;
        transform: translateY(105%);
        visibility: hidden;            /* keeps the off-screen panel out of tab order */
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    }
    #productModal .pm-size-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 12px;
    }
    #productModal .pm-size-panel.open {
        transform: translateY(0);
        visibility: visible;
        transition-delay: 0s;
    }
    #productModal .size-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    #productModal .pm-size-confirm {
        width: 100%;
        min-height: 48px;
        margin-top: 12px;
    }
}

/* ─── Comments inside #productModal ───────────────────────────────────────────
   Same as #artModal .am-comments: always open, bottom of the right column, title
   + scrolling list + input. The panel is absolutely filled so a long comment
   list scrolls inside it instead of stretching the whole modal. ──────────── */

#productModal .pm-comments {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;
    margin-top: 4px;
    border-top: 1.5px solid #ecebe7;
}

#productModal .pm-comments-panel {
    position: absolute;
    top: 16px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Comments panel (list + input) rendered by SharedCommentsManager.mountCommentsPanel */
#productModal .pm-comments-panel .cm-panel-title {
    flex-shrink: 0;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #151219;
}

#productModal .pm-comments-panel .cm-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;             /* shared-comments.js sets 300px inline */
    padding-right: 4px;
    overflow-y: auto !important;
    font-size: 0.9rem;
}

#productModal .pm-comments-panel .cm-list::-webkit-scrollbar { width: 4px; }
#productModal .pm-comments-panel .cm-list::-webkit-scrollbar-track { background: transparent; }
#productModal .pm-comments-panel .cm-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* "No comments yet." / error */
#productModal .pm-comments-panel .cm-list > p {
    margin: 0;
    font-size: 14px;
    color: #9a9aa1 !important;
}

#productModal .pm-comments-panel .cm-list img.user-profile-link {
    width: 34px !important;
    height: 34px !important;
    object-fit: cover;
    background: #1c1c1f;
    border-radius: 10px !important;
}

#productModal .pm-comments-panel .cm-list strong {
    font-size: 14px;
    font-weight: 500;
}

#productModal .pm-comments-panel .cm-list .text-break {
    font-size: 14px;
    line-height: 1.4;
}

#productModal .pm-comments-panel .cm-list .text-muted {
    font-size: 12px;
    color: #9a9aa1 !important;
}

#productModal .pm-comments-panel .cm-list .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    color: #151219;
    background: #fff;
    border: 1.5px solid #e2e2e2;
    border-radius: 10px;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#productModal .pm-comments-panel .cm-list .btn:hover {
    color: #712bf5;
    background: #fff;
    border-color: #712bf5;
}

/* Liked comment (the like manager toggles btn-primary / btn-outline-primary) */
#productModal .pm-comments-panel .cm-list .comment-like-button.btn-primary {
    color: #fff;
    background: #712bf5;
    border-color: #712bf5;
}

#productModal .pm-comments-panel .cm-list .btn-link {
    border: none;
    background: transparent;
}

#productModal .pm-comments-panel .cm-list .alert {
    margin: 8px 0 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
}

/* Input row */
#productModal .pm-comments-panel .cm-input {
    flex-shrink: 0;
    margin-top: 12px;
}

#productModal .pm-comments-panel .cm-input .input-group {
    flex-wrap: nowrap;
    gap: 6px;
}

#productModal .pm-comments-panel .cm-input .input-group > * {
    margin-left: 0 !important;
    border-radius: 12px !important;
}

#productModal .pm-comments-panel .cm-input .form-control {
    font-family: inherit;
    background: #fff;
    border: 1.5px solid #e2e2e2;
    padding: 8px 12px;
    box-shadow: none;
    transition: border-color 0.15s ease;
}

#productModal .pm-comments-panel .cm-input .form-control:focus {
    outline: none;
    border-color: #712bf5;
    box-shadow: 0 0 0 3px rgba(113, 43, 245, 0.15);
}

#productModal .pm-comments-panel .cm-input .btn {
    font-family: inherit;
    font-weight: 600;
    color: #151219;
    background: #fff;
    border: 1.5px solid #e2e2e2;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#productModal .pm-comments-panel .cm-input .btn:hover {
    color: #712bf5;
    background: #fff;
    border-color: #712bf5;
}

#productModal .pm-comments-panel .cm-input .comment-submit {
    color: #fff;
    background: #712bf5;
    border-color: #712bf5;
}

#productModal .pm-comments-panel .cm-input .comment-submit:hover {
    color: #fff;
    background: #5f22d6;
    border-color: #5f22d6;
}

@media (max-width: 767px) {
    /* phone: modal is one scrolling column, so comments flow normally */
    #productModal .pm-comments {
        flex: none;
        min-height: 0;
        padding-top: 16px;
    }
    #productModal .pm-comments-panel {
        position: static;
    }
    #productModal .pm-comments-panel .cm-list { max-height: 240px !important; }
}

html.kv-dbg-dark #productModal .pm-comments-panel .cm-list .btn,
html.kv-dbg-dark #productModal .pm-comments-panel .cm-input .form-control,
html.kv-dbg-dark #productModal .pm-comments-panel .cm-input .btn:not(.comment-submit) {
    background: #222124 !important;
    border-color: #e1dfe6 !important;
}

html.kv-dbg-dark #productModal .pm-comments-panel .cm-input .comment-submit {
    background: #712bf5 !important;
}

/* ── Debug-only dark mode (console toggle, not exposed in UI) ──
   Mirrors the html.kv-dbg-dark toggle in inicio.css exactly: same single
   flat background (#222124) and same text/border color (#e1dfe6) — no
   extra shades invented here. inicio.css already forces color:#e1dfe6
   on every element via `html.kv-dbg-dark *`; we only need to swap the
   light backgrounds hardcoded in this file so cards/modal don't stay
   white, using that identical #222124. ── */

html.kv-dbg-dark .dimona-product-card,
html.kv-dbg-dark .dimona-product-image-wrap,
html.kv-dbg-dark .dimona-menu-trigger:hover,
html.kv-dbg-dark .dimona-manage-menu.open .dimona-menu-trigger,
html.kv-dbg-dark #productModal .modal-content,
html.kv-dbg-dark #productModal .pm-left,
html.kv-dbg-dark #productModal .pm-art-strip,
html.kv-dbg-dark #vinculatedArtModalContainer,
html.kv-dbg-dark #productModal .size-chip,
html.kv-dbg-dark #productModal .pm-btn-outline,
html.kv-dbg-dark #productModal .pm-back-btn,
html.kv-dbg-dark #productModal .btn-close,
html.kv-dbg-dark #productModal .pm-share-btn,
html.kv-dbg-dark #productModal .pm-size-panel {
    background: #222124 !important;
    border-color: #e1dfe6 !important;
}

html.kv-dbg-dark #productModal .color-option-btn { border-color: #e1dfe6 !important; }

/* These specific rules use !important + higher specificity than inicio.css's
   blanket `html.kv-dbg-dark * { color: #e1dfe6 !important }`, so they'd
   otherwise win and stay on their light hex. Force the same #e1dfe6. */
html.kv-dbg-dark .dimona-product-price strong,
html.kv-dbg-dark #productModal .pm-price strong {
    color: #e1dfe6 !important;
}

@media (max-width: 480px) {
    .dimona-product-card { padding: 4px; border-radius: 14px; }
    .dimona-product-image-wrap { aspect-ratio: 3 / 4; border-radius: 12px; }
    .dimona-product-body { padding: 8px 2px 2px; }
    .dimona-product-title { font-size: 16px; line-height: 1.3; }
    .dimona-product-price,
    .dimona-product-price strong { font-size: 14px; }
    .dimona-variant-preview { margin-top: 6px; margin-bottom: 6px; }
    .dimona-variant-preview-inner { gap: 6px; }
    .dimona-color-dot { width: 18px; height: 18px; }
    .dimona-color-count { font-size: 13px; }
    .dimona-artist-row { gap: 7px; }
    .dimona-artist-avatar { width: 30px; height: 30px; border-radius: 8px; }
    .dimona-artist-name { font-size: 14px; }
}

/* ─── Profile pages only: hide artist avatar + name ───────────────────────────
   (profile.html / public-profile.html use <body class="profile-page-shell">).
   The manage menu stays; a row left empty (viewer is not the owner) is dropped. */

body.profile-page-shell .dimona-artist-avatar,
body.profile-page-shell .dimona-artist-name {
  display: none !important;
}

body.profile-page-shell .dimona-artist-row:not(:has(.dimona-manage-menu)) {
  display: none;
}