*, ::after, ::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}


header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 71.4286%;
    margin: 0 auto;
    padding: 2rem 0;
    background-color: #ffffff;
}

.logo {
    width: clamp(120px, 17vw, 220px);
    height: auto;
}

.nav-list {
    list-style-type: none;
    display: flex;
    gap: 2rem;
}

.nav-list li a {
    text-decoration: none;
    font-family: "Nunito", sans-serif;
    font-size: 90%;
    font-weight: 700;
    font-style: normal;
    color: hsl(0, 0%, 35%);
}

.abrir-menu,
.cerrar-menu {
    display: none;
}

@media screen and (max-width: 550px) {
    .abrir-menu,
    .cerrar-menu {
        display: block;
        border: 0;
        font-size: 2rem;
        background-color: transparent;
        cursor: pointer;
    }

    .abrir-menu {
        color: #FD6A02;
    }

    .cerrar-menu {
        color: #ececec;
    }

    .nav {
        opacity: 0;
        visibility: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        position: absolute;
        top: 12%;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: #FD6A02;
        padding: 2rem;
        box-shadow: 0 0 0 100vmax rgba(19, 19, 19, 0.5);
    }

    .nav.visible {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
    }

    .nav-list li a {
        color: #ecececec;
    }
}

.catalogo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard {
    width: 90%;
}

.container {
    width: 71.4286%;
    margin: 0 auto;
    padding: 20px 0 40px;
    background: #ffffff;

    /* 7 partes: las imagenes ocupan las 5 columnas centrales */
    column-count: 5;
    column-gap: 16px;
}

.box {
    width: 100%;
    display: block;
    margin-bottom: 16px;
    border-radius: 16px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

@media screen and (max-width: 1100px) {
    header {
        width: 85%;
    }

    .container {
        width: 85%;
        column-count: 4;
    }
}

@media screen and (max-width: 700px) {
    header {
        width: 100%;
        padding: 1rem 1.25rem;
    }

    .container {
        width: 100%;
        padding: 16px 12px 40px;
        column-count: 2;
        column-gap: 10px;
    }

    .box {
        margin-bottom: 10px;
        border-radius: 12px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        column-count: 1;
        padding: 16px 16px 40px;
    }

    .box {
        border-radius: 14px;
    }
}

/* ---- Modal de trabajo ---- */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 16px;
    overflow: auto;
    display: flex;
    flex-direction: row;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.modal-close:hover {
    background: #FD6A02;
}

.modal-main-image {
    position: relative;
    flex: 1 1 55%;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    touch-action: none;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s ease;
}

.modal-nav:hover {
    background: #FD6A02;
}

.modal-nav.oculto {
    display: none;
}

.modal-nav-prev {
    left: 12px;
}

.modal-nav-next {
    right: 12px;
}

.modal-main-image.zoom-activo {
    cursor: grab;
}

.modal-main-image.arrastrando {
    cursor: grabbing;
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
    touch-action: none;
    user-select: none;
}

.modal-main-image.arrastrando img {
    transition: none;
}

.modal-info {
    flex: 1 1 45%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.modal-cliente-bar {
    background: #e05b49;
    color: #ffffff;
    padding: 3.5rem 2rem 2.25rem;
    margin: -2rem -2rem 1.5rem -2rem;
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
}

.modal-cliente-label {
    font-weight: 700;
    margin-right: 0.4rem;
}

#modalCliente {
    font-weight: 700;
}

.modal-titulo-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-titulo-row + .modal-titulo-row {
    margin-top: 1rem;
}

.modal-titulo-label {
    flex: 0 0 auto;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    color: hsl(0, 0%, 35%);
    font-size: 0.9rem;
}

.modal-titulo-row p {
    margin: 0;
    font-family: "Nunito", sans-serif;
    color: hsl(0, 0%, 45%);
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-angles-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.modal-angles-header.visible {
    display: flex;
}

.modal-angles-title {
    font-family: "Nunito", sans-serif;
    color: hsl(0, 0%, 25%);
    font-size: 1rem;
    margin: 0;
}

.btn-volver-principal {
    display: none;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background: none;
    color: #FD6A02;
    font-family: "Nunito", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.btn-volver-principal.visible {
    display: inline-flex;
}

.btn-volver-principal:hover {
    text-decoration: underline;
}

.modal-angles {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.modal-angles.visible {
    display: grid;
}

.modal-angle-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.modal-angle-image:hover {
    transform: translateY(-2px);
}

.modal-angle-image.activa {
    border-color: #FD6A02;
}

@media screen and (max-width: 700px) {
    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-main-image {
        flex: 0 0 45vh;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .modal-cliente-bar {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: 1.75rem 1.5rem;
    }

    .modal-angles {
        gap: 0.6rem;
        padding-bottom: 1rem;
    }
}