/* ===========================================
   PDF Page — La Fabrik Tools
   Charte colorimétrique appliquée
   =========================================== */

/* ---- Layout principal ---- */

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    border: 1.5px solid #C9B896;
    border-radius: 16px;
    padding: 32px 28px;
    background-color: #FFFFFF08;
}

main > hr {
    width: 100%;
    border: none;
    border-top: 1px solid #C9B89640;
    margin: 0;
}

/* ---- Navigation retour ---- */

main > a.button-secondary {
    align-self: flex-start;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---- Section formulaire ---- */

.pdf-formulaire {
    width: 100%;
}

.pdf-formulaire > hr {
    border: none;
    border-top: 1px solid #C9B89640;
    margin: 24px 0 0 0;
}

#form-object {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Rangées du formulaire */

#product-identifier,
#product-data {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

#product-identifier > *,
#product-data > .form-group {
    flex: 1 1 200px;
    min-width: 0;
}

/* Groupes label + input */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-family: Rubik, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #6C5240;
    letter-spacing: 0.02em;
}

/* Inputs & Select */

#form-object input[type="text"],
#form-object input[type="number"],
#form-object select {
    font-family: Rubik, sans-serif;
    font-size: 15px;
    color: #363537;
    background-color: #F8F6EE;
    border: 1.5px solid #C9B896;
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

#form-object input[type="text"]:focus,
#form-object input[type="number"]:focus,
#form-object select:focus {
    border-color: #6C5240;
    box-shadow: 0 0 0 3px #C9B89630;
}

#form-object input[type="text"]::placeholder,
#form-object input[type="number"]::placeholder {
    color: #A6A4A7;
}

/* Select spécifique */

#form-object select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236C5240' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

/* Checkbox promotion */

.form-group:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding-top: 22px;
}

#is_promoted {
    width: 18px;
    height: 18px;
    accent-color: #D34E24;
    cursor: pointer;
}

/* Bouton submit du formulaire */

#form-submit-button {
    align-self: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#form-submit-button:hover {
    background-color: #8B3121;
}

#form-submit-button:active {
    transform: scale(0.97);
}

/* ---- Section liste ---- */

#pdf-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Élément de liste */

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #EDE8D0;
    border: 1px solid #C9B896;
    border-radius: 10px;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.list-item:hover {
    box-shadow: 0 2px 8px #6C524015;
    transform: translateY(-1px);
}

.list-item p {
    margin: 0;
    font-family: Rubik, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type {
    flex: 0 0 90px;
    font-size: 12px;
    color: #6C5240;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #C9B89640;
    padding: 4px 10px;
    border-radius: 6px;
    text-align: center;
}

.item-name {
    flex: 1 1 180px;
    font-size: 14px;
    color: #6C5240;
    font-weight: 500;
}

.item-brand {
    flex: 0 1 120px;
    font-size: 13px;
    color: #A6A4A7;
}

.item-specs {
    flex: 1 1 150px;
    font-size: 13px;
    color: #6C5240;
}

.item-price {
    flex: 0 0 70px;
    font-size: 14px;
    color: #363537;
    text-align: right;
    font-weight: 600;
}

.item-price::after {
    content: " €";
}

/* Bouton supprimer */

.delete-button {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: #A6A4A7;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.delete-button:hover {
    background-color: #FAE9DA;
    color: #D34E24;
}

/* Bouton générer PDF */

#generate-pdf-button {
    align-self: center;
    margin-top: 12px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#generate-pdf-button:hover {
    background-color: #8B3121;
}

#generate-pdf-button:active {
    transform: scale(0.97);
}

/* ---- Liste vide : message discret ---- */

#pdf-liste:empty::before {
    content: "Aucun produit ajouté pour le moment";
    font-family: Rubik, sans-serif;
    font-size: 14px;
    color: #A6A4A7;
    text-align: center;
    padding: 32px 0;
    font-style: italic;
}

/* ---- Responsive ---- */

@media (max-width: 700px) {
    main {
        padding: 20px 16px;
    }

    #product-identifier,
    #product-data {
        flex-direction: column;
        gap: 12px;
    }

    .list-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .item-type {
        flex: 0 0 auto;
    }

    .item-name {
        flex: 1 1 100%;
        font-size: 15px;
    }
}