﻿.product-modal-card {

    width: min(1020px, 100%);

    max-height: 85vh;

    overflow: auto;

    background: var(--panel);

    color: var(--text);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    border: 1px solid var(--border);

}

.modal-body {

    padding: 16px 18px;

    display: flex;

    flex-direction: column;

    gap: 14px;

}

.pm-layout {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 16px;

    min-height: 460px;

}

.pm-image {

    width: 100%;

    height: 100%;

    max-height: 460px;

    object-fit: cover;

    border-radius: calc(var(--radius) - 4px);

    display: block;

}

.pm-options {

    min-height: 360px;

    max-height: 460px; /* controla alto del scroll */

    overflow: auto;

    padding-right: 6px; /* espacio para scrollbar */

    display: flex;

    flex-direction: column;

    gap: 10px;

}

.group {

    padding: 14px;

    border-radius: var(--radius);

    background: var(--bg);

    border: 1px solid var(--border);

}

.group-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 12px;

}

.group-title {

    font-weight: 700;

    font-size: 15px;

}

.group-rules {

    font-size: 12px;

    color: var(--muted);

    text-align: right;

    white-space: nowrap;

}

/* Grupo con error */
.group.has-error {

    border: 1px solid #fecaca;

    background: #fee2e2;

}

.group.has-error .group-title,

.group.has-error .group-rules {

    color: #b91c1c;

}

.items {

    margin-top: 10px;

    display: flex;

    flex-direction: column;

    gap: 8px;

}

.item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 10px 12px;

    border-radius: var(--radius);

    background: var(--panel);

    border: 1px solid var(--border);

    transition: background .15s ease, border-color .15s ease;

}

.item:hover {

    background: #f9fafb;

    border-color: #d1d5db;

}

.item label {

    display: flex;

    align-items: center;

    gap: 10px;

    cursor: pointer;

    width: 100%;

    font-size: 14px;

}

.item input {

    accent-color: #111827; /* se ve sobrio en light */

    cursor: pointer;

}

.item .right {

    font-size: 13px;

    color: var(--muted);

    white-space: nowrap;

}

.pm-obs {

    width: 100%;

    display: grid;

    gap: 6px;

}

.pm-obs-label {

    font-size: 12px;

    color: var(--muted);

}

.pm-obs-input {

    width: 100%;

    resize: vertical;

    min-height: 80px;

    padding: 10px 12px;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: var(--panel);

    color: var(--text);

    outline: none;

}

.pm-obs-input:focus {

    border-color: rgba(17,24,39,.35);

    box-shadow: 0 0 0 3px rgba(17,24,39,.08);

}

.pm-errors {

    font-size: 13px;

    line-height: 1.35;

    color: #b91c1c; /* rojo sobrio */

    background: #fee2e2;

    border: 1px solid #fecaca;

    padding: 10px 12px;

    border-radius: var(--radius);

}

.pm-errors.ok {

    color: #065f46;

    background: #d1fae5;

    border-color: #a7f3d0;

}

.pm-actions {

    display: flex;

    gap: 12px;

    align-items: center;

}

.qty {

    display: flex;

    align-items: center;

    border: 1px solid var(--border);

    background: var(--panel);

    border-radius: 999px;

    box-shadow: var(--shadow);

    overflow: hidden;

    height: 55px; /* similar a botón */

}

.qty-btn {

    padding: 0px;

    width: 85px;

    height: 55px;

    display: grid;

    place-items: center;

    border: 0;

    background: transparent;

    cursor: pointer;

    font-size: 18px;

    color: var(--text);

}

.qty-btn:hover {

    background: rgba(17,24,39,.04);

}

.qty-btn:active {

    transform: scale(.98);

}

.qty-value {

    min-width: 33px;

    text-align: center;

    font-weight: 700;

    color: var(--text);

    user-select: none;

}

/* Responsive: en móviles apila y el scroll queda igual */
@media (max-width: 720px) {

    .pm-layout {

        grid-template-columns: 1fr;

    }

    .pm-image {

        max-height: 240px;

        position: relative; /* no sticky en mobile */

    }

    .pm-options {

        max-height: 360px;

    }

}