.magazzino-module .header-actions > [data-ddm-foto-prodotto] {
    color: #334155;
    cursor: pointer;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
}

.ddm-foto-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.ddm-foto-modal {
    width: min(720px, 100%);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 16px 16px 18px;
}

.ddm-foto-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ddm-foto-head h2 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.ddm-foto-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.ddm-foto-close {
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
}

.ddm-foto-video-wrap {
    position: relative;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    min-height: 180px;
}

.ddm-foto-video-wrap video,
.ddm-foto-video-wrap img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: #0f172a;
}

.ddm-foto-barcode-live {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
}

.ddm-foto-actions,
.ddm-foto-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ddm-foto-actions button,
.ddm-foto-footer button,
.ddm-foto-alt button {
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 650;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
}

.ddm-foto-actions button.primary,
.ddm-foto-footer button.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.ddm-foto-actions button:disabled,
.ddm-foto-footer button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ddm-foto-file {
    display: inline-flex;
    align-items: center;
}

.ddm-foto-file input {
    display: none;
}

.ddm-foto-manual {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ddm-foto-manual input,
.ddm-foto-grid input,
.ddm-foto-grid select,
.ddm-foto-grid textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
}

.ddm-foto-status {
    margin: 10px 0 0;
    font-size: 13px;
    color: #1d4ed8;
}

.ddm-foto-status.error {
    color: #b91c1c;
}

.ddm-foto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ddm-foto-grid label,
.ddm-foto-manual label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.ddm-foto-grid .wide {
    grid-column: 1 / -1;
}

.ddm-foto-note,
.ddm-foto-esistente {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.ddm-foto-note {
    background: #eff6ff;
    color: #1e3a8a;
}

.ddm-foto-esistente {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.ddm-foto-alt {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.ddm-foto-alt button {
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

@media (min-width: 720px) {
    .ddm-foto-overlay {
        align-items: center;
    }
}

@media (max-width: 640px) {
    .ddm-foto-grid {
        grid-template-columns: 1fr;
    }
}
