:root {
    --width-base: 1440;
    --color: #957657;
    --color-hover: #83674C;
    --color-text: #000;
    --color-input: 214.3 31.8% 91.4%;
    --color-disabled: rgb(229 231 235 / .5);
    --color-muted: rgb(124 124 124);
    --ff-title: "Didot";
    --ff-text: Source Sans Pro, sans-serif;
    --ff-open-sans: "Open Sans";
    --border: 214.3 31.8% 91.4%;
    --muted-foreground: 215.4 16.3% 46.9%;
}

.cbwp_complaints-book-section {
    padding: 0;
    background-color: #fff;
    color: var(--color-text);

    @media (min-width: 768px) {

    }

    @media (min-width: 1024px) {
        padding: 70px 0;
    }

    h1 {
        margin: 0;
        padding: 0;
    }
}

.cbwp_container {
    width: 100%;
    max-width: 1240px;
    padding: 0 20px 20px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;

    @media (min-width: 1024px) {
        padding: 0 20px;
    }
}

.cbwp_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;

    @media (min-width: 1024px) {
        flex-direction: row;
    }

    h1 {
        font-family: var(--ff-title);
        font-size: 30px;
        color: var(--color);
        text-transform: uppercase;
        text-align: center;

        @media (min-width: 1024px) {
            text-align: left;
            font-size: 45px;
        }
    }

    span {
        margin: 0 0 15px;
        font-size: 16px;

        @media (min-width: 1024px) {
            margin: 0;
            font-size: calc(22 * clamp(0px, 100vw, 1440px) / var(--width-base));
        }
    }
}

.cbwp-company-info {
    margin-top: calc(20 * clamp(0px, 100vw, 1440px) / var(--width-base));
    font-size: 12px;

    @media (min-width: 1024px) {
        font-size: 16px;
    }

    p {
        margin: 0;
    }
}

.cbwp-form .cbwp-form-section {
    margin-top: 40px;

    h2 {
        font-size: 16px;
        font-weight: 600;
        color: var(--color);
        margin: 0;
        line-height: 26px;

        @media (min-width: 1024px) {
            font-size: calc(26 * clamp(0px, 100vw, 1440px) / var(--width-base));
            line-height: calc(26 * clamp(0px, 100vw, 1440px) / var(--width-base));
        }
    }

    &.cbwp-form-section-buttons {
        margin: 15px auto auto;
        display: flex;
        justify-content: center;
        align-items: center;

        @media (min-width: 1024px) {
            margin: 40px auto auto;
        }

        button {
            width: 100%;
            padding: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base)) calc(24 * clamp(0px, 100vw, 1440px) / var(--width-base));
            height: 45px;
            background-color: var(--color);
            color: #fff;
            outline: none;
            border: 0 solid transparent;
            font-size: 17px;
            letter-spacing: 0.2px;
            text-transform: uppercase;
            text-align: center;
            transition: all .4s ease-out;
            font-weight: 700;

            @media (min-width: 1024px) {
                width: calc(402 * clamp(0px, 100vw, 1440px) / var(--width-base));
                height: calc(46 * clamp(0px, 100vw, 1440px) / var(--width-base));
            }

            &:hover,
            &:active {
                background-color: var(--color-hover);
            }
        }
    }
}

.cbwp-form-inputs {
    display: grid;
    column-gap: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base));
    row-gap: calc(30 * clamp(0px, 100vw, 1440px) / var(--width-base));
    margin-top: calc(40 * clamp(0px, 100vw, 1440px) / var(--width-base));

    @media (min-width: 1024px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    &.cbwp-form-inputs-columns-2 {
        @media (min-width: 1024px) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }
    &.cbwp-form-inputs-columns-3 {
        @media (min-width: 1024px) {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }
}

.cbwp-form-field {
    width: 100%;
    position: relative;

    label {
        font-size: 12px;
        line-height: 1;
        font-weight: 600;
        @media (min-width: 1024px) {
            font-size: 16px;
        }
    }

    p {
        margin: 0;
        font-size: 12px;

        @media (min-width: 1024px) {
            font-size: 14px;
        }
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="number"],
    textarea,
    select {
        font-family: var(--ff-open-sans);
        color: var(--color-text);
        width: 100%;
        font-size: 12px;
        background-color: transparent;
        border: 1px solid var(--color) !important;
        padding: 12px;

        @media (min-width: 1024px) {
            font-size: 16px;
            padding: 18px;
        }

        &.disabled {
            background-color: var(--color-disabled);
        }
    }

    select {
        appearance: none;
        padding-right: 30px !important;
    }

    &:has(> select):after {
        width: 10px;
        height: 10px;
        position: absolute;
        right: 15px;
        content: " ";
        border-right: solid 1px #957657;
        border-bottom: solid 1px #957657;
        top: 60%;
        transform: translateY(-50%) rotate(45deg);
        -webkit-transition: all 0.2s ease-in-out;
        transition: all 0.2s ease-in-out;
        pointer-events: none;

        @media (min-width: 1024px) {
            top: 50%;
        }
    }

    .cbwp-form-counter {
        font-size: 12px;
        text-align: right;
    }
    .cbwp-form-disclaimer {
        font-size: 12px;
    }

    &.cbwp-form-field-colspan-2 {
        @media (min-width: 1024px) {
            grid-column: span 2 / span 2;
        }
    }
}

.cbwp-form-field-file {
    display: flex;
    gap: calc(2 * clamp(0px, 100vw, 1440px) / var(--width-base));
    flex-direction: column;
    position: relative;
    color: var(--color);

    .cbwp-form-field-file-drag-drop {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        border-style: dotted;
        padding: calc(6 * clamp(0px, 100vw, 1440px) / var(--width-base));
        gap: calc(2 * clamp(0px, 100vw, 1440px) / var(--width-base));
        border-width: calc(2 * clamp(0px, 100vw, 1440px) / var(--width-base));
        transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
        transition-timing-function: cubic-bezier(.4,0,.2,1);
        transition-duration: .15s;
        outline: 2px solid transparent;
        outline-offset: 2px;
        user-select: none;
        position: relative;
        border-color: hsl(var(--border));
        font-size: 11.5px;

        @media (min-width: 1024px) {
            font-size: 16px;
        }
    }

    .size-20 {
        width: 15px;
        height: 15px;

        @media (min-width: 1024px) {
            width: calc(20 * clamp(0px, 100vw, 1440px) / var(--width-base));
            height: calc(20 * clamp(0px, 100vw, 1440px) / var(--width-base));
        }
    }

    button {
        -webkit-appearance: button;
        background-color: transparent;
        background-image: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        padding: 14px 0;
        gap: 2px;
        font-weight: 600;
        margin: 0;
        line-height: inherit;
        letter-spacing: inherit;
        border-width: 0;
        color: inherit;

        @media (min-width: 1024px) {
            padding: calc(5 * clamp(0px, 100vw, 1440px) / var(--width-base));
            height: calc(46 * clamp(0px, 100vw, 1440px) / var(--width-base));
            gap: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base));
        }

        &:hover {
            text-decoration-line: underline;
        }
    }

    input[type="file"] {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    .cbwp-file-list {
        --tw-enter-translate-y: -0.5rem;
        --tw-enter-opacity: 0;
        --ring: 222.2 84% 4.9%;

        display: none;
        flex-direction: column;
        gap: calc(2 * clamp(0px, 100vw, 1440px) / var(--width-base));
        animation-name: enter;
        animation-duration: .15s;
        border-color: hsl(var(--border));
        outline-color: hsl(var(--ring) / .5);
    }

    .cbwp-file-list-item {
        --radius: 0rem;

        position: relative;
        display: flex;
        align-items: center;
        gap: .625rem;
        border-radius: calc(var(--radius) - 2px);
        border: 1px solid hsl(var(--border));
        padding: calc(3 * clamp(0px, 100vw, 1440px) / var(--width-base));
    }

    .cbwp-file-list-item-content {
        display: flex;
        gap: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base));
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        width: 100%;

        .cbwp-file-preview {
            width: calc(50 * clamp(0px, 100vw, 1440px) / var(--width-base));
            height: calc(50 * clamp(0px, 100vw, 1440px) / var(--width-base));
            object-fit: cover;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;

            img {
                width: 100%;
                height: 100%;
                border-radius: .25rem;
                object-fit: cover;
                display: block;
                vertical-align: middle;
            }
        }

        .cbwp-file-name {
            display: flex;
            min-width: calc(0 * clamp(0px, 100vw, 1440px) / var(--width-base));
            flex-direction: column;
            flex: 1 1 0;

            span {
                margin: 0;
            }

            span:first-of-type {
                font-weight: 500;
                font-size: calc(14 * clamp(0px, 100vw, 1440px) / var(--width-base));
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
            }

            span:last-of-type {
                font-size: .75rem;
                line-height: 1rem;
                color: hsl(var(--muted-foreground));
                font-weight: 400;
            }
        }

        .cbwp-file-button-close {}
    }
}

.cbwp-form-regulation {
    display: grid;
    gap: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base));
    color: var(--color-muted);

    p {
        font-size: 12px;
        margin: 0;
        text-align: justify;

        @media (min-width: 1024px) {
            font-size: 14px;
        }
    }
}

.cbwp-form-input-radio {
    display: flex;
    justify-content: flex-start;
    align-items: center;

    label {
        margin: 0 0 0 3px;
    }

    input[type="radio"] {
        border: 2px solid var(--color);
        appearance: none;
        -webkit-appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        position: relative;
        box-sizing: border-box;
        cursor: pointer;

        &:checked::before {
            background: var(--color);
            content: "";
            position: absolute;
            width: 50%;
            height: 50%;
            border-radius: 50%;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(1);
            transition: transform 150ms ease-in-out;
        }

        &:last-of-type {
            margin-left: 40px;
        }
    }
}

/*@media (min-width: 768px) {*/
/*    .cbwp-form-inputs {*/
/*        grid-template-columns: repeat(3, minmax(0, 1fr));*/
/*    }*/
/*}*/

/**
Modal
 */

.cbwp-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 10px;

    @media (min-width: 1024px) {
        padding: 20px;
    }
}

/* Contenido */
.cbwp-modal-content {
    background: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    overflow-y: auto;
    padding: 15px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(4px);

    @media (min-width: 1024px) {
        max-height: 90vh;
        padding: 30px;
    }

    h2 {
        font-family: var(--ff-title);
        font-size: 27px;
        color: var(--color);
        text-transform: uppercase;
    }
}

/* Header */
.cbwp-modal-header {
    text-align: center;
    margin-bottom: 20px;

    img {
        width: 200px;
        margin-bottom: 20px;
    }
}
.cbwp-modal-date {
    color: rgb(30 32 40/.5);
    font-size: 16px;
}

.cbwp-modal-body {
    h3 {
        font-size: 16px;
        color: var(--color-text);
        font-weight: 700;
    }

    .cbwp-box {
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 10px;
        background: #fff;
        display: table;
        width: 100%;
    }

    .cbwp-row {
        display: table-row;
    }

    .cbwp-col {
        display: table-cell;
        border-bottom: 1px solid #eee;
        vertical-align: top;
        padding: 3px;
        font-size: 12px;

        @media (min-width: 1024px) {
            font-size: 14px;
        }
    }

    .cbwp-col-30 {
        width: 40%;
        font-weight: bold;
        color: #333;

        @media (min-width: 1024px) {
            width: 30%;
        }
    }

    .cbwp-col-70 {
        width: 60%;
        color: #555;

        @media (min-width: 1024px) {
            width: 70%;
        }
    }

    /* Última fila sin borde */
    .cbwp-row:last-child .cbwp-col {
        border-bottom: none;
    }

    .modal-policies {
        font-size: 12px;
        color: rgb(30 32 40/.5);
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 10px;

        p {
            padding: 0;
            margin: 0;
            text-align: justify;
        }
    }

    hr {
        margin: 20px 0;
    }

    .modal-buttons {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-top: 20px;

        @media (min-width: 1024px) {
            margin-top: unset;
        }

        a {
            text-transform: uppercase;
            color: #FFF;
            background-color: var(--color);
            border: 0 solid transparent;
            font-size: 17px;
            letter-spacing: 0.2px;
            text-align: center;
            transition: all .4s ease-out;
            padding: calc(10 * clamp(0px, 100vw, 1440px) / var(--width-base)) calc(24 * clamp(0px, 100vw, 1440px) / var(--width-base));
            width: 100%;

            @media (min-width: 1024px) {
                width: auto;
            }

            &:hover {
                background-color: var(--color-hover);
            }
        }
    }
}

/* Botón cerrar */
.cbwp-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Animación */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}