/* Mon Atelier - feuille de style principale */

:root {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #292722;
    background: #f8f7f4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

/* Structure générale */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    background: #fff;
    border-bottom: 1px solid #e7e2da;
    padding: 18px;
}

header > div {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Badge encadrement */

.artwork-photo-wrapper {
    position: relative;
}

.artwork-frame-badge {
    position: absolute;
    right: 8px;
    bottom: -8px;
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    pointer-events: none;
}


/* Liens et titres */
a {
    color: #4e483d;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1 {
    font-family: Georgia, serif;
    font-weight: normal;
    font-size: 2.3rem;
}

h2 {
    font-family: Georgia, serif;
    font-weight: normal;
}

/* Identité visuelle : titre + signature */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 85px;
    height: auto;
    max-height: 45px;
    object-fit: contain;
}

/* À utiliser si le titre de connexion porte class="login-brand" */
.login-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.login-logo {
    display: block;
    width: 125px;
    height: auto;
    max-height: 75px;
    object-fit: contain;
}

/* Cartes et boutons */
.card {
    background: white;
    border: 1px solid #e7e2da;
    border-radius: 12px;
    padding: 20px;
    margin: 14px 0;
}

.card > h2:first-of-type{
    margin-top:0;
}

.btn,
button {
    display: inline-block;
    background: #292722;
    color: #fff;
    border: 0;
    border-radius: 7px;
    padding: 11px 17px;
    cursor: pointer;
    font: inherit;
}

.btn:hover {
    color: white;
}

.small {
    font-size: 0.8rem;
    padding: 7px 9px;
}

.danger {
    background: #963c35;
}

.linkbutton {
    background: none;
    color: #4e483d;
    padding: 0;
}

.inline {
    display: inline;
}

.muted {
    color: #777;
    font-size: 0.9rem;
}

.error {
    background: #f9e8e5;
    color: #812f28;
    padding: 12px;
    border-radius: 8px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Formulaires */
input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 11px;
    border: 1px solid #cfc9bf;
    border-radius: 7px;
    margin: 7px 0 16px;
    font: inherit;
}

input[type="file"] {
    background: #faf9f7;
}

label {
    font-size: 0.9rem;
}

.label-active {
    color:#008000;
}

.label-desactive {
    color:#d90000;
}

fieldset {
    border: 1px solid #e7e2da;
    border-radius: 9px;
    padding: 16px;
}

fieldset legend {
    font-weight: 600;
}

/* Grilles et galerie */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 15px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.thumb {
    width: 100%;
    height: 190px;
    object-fit: contain;
    background: #f0eeea;
    border-radius: 7px;
}

.empty {
    display: grid;
    place-items: center;
    color: #777;
}

.artwork h3 {
    font-size: 1rem;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Photographies */
.photo-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.photo-actions form {
    margin: 0;
}

/* Tableaux */
.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

/* ========================================
   IDENTITÉ VISUELLE - SIGNATURE ESCORIZA
   ======================================== */

header a.brand {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    width: auto;
    text-decoration: none;
}

header a.brand strong {
    display: inline-block;
    white-space: nowrap;
}

header a.brand img.brand-logo {
    display: block;
    width: 85px;
    height: auto;
    max-height: 45px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Adaptation smartphone */

@media (max-width: 600px) {

    header a.brand {
        gap: 8px;
    }

    header a.brand img.brand-logo {
        width: 65px;
        max-height: 35px;
    }

}


/* =========================================================
   NAVIGATION RESPONSIVE - MON ATELIER
   ========================================================= */

.site-header .header-inner {
    position: relative;
}

.desktop-navigation {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}

.primary-nav a {
    white-space: nowrap;
}

/* Menu du compte sur ordinateur */
.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-menu > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    cursor: pointer;
    border-radius: 8px;
    list-style: none;
    white-space: nowrap;
}

.user-menu > summary::-webkit-details-marker,
.mobile-menu > summary::-webkit-details-marker {
    display: none;
}

.user-menu > summary:hover,
.user-menu[open] > summary {
    background: #f3f1ed;
}

.user-avatar {
    font-size: 1.15rem;
    line-height: 1;
}

.menu-chevron {
    font-size: 1.3rem;
    line-height: 1;
    transform: translateY(-2px);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 30;
    min-width: 190px;
    padding: 7px;
    background: #fff;
    border: 1px solid #e7e2da;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.user-menu-panel a,
.user-menu-panel .linkbutton {
    display: block;
    width: 100%;
    padding: 12px;
    color: #4e483d;
    text-align: left;
    font-size: 1rem;
    border-radius: 7px;
}

.user-menu-panel a:hover,
.user-menu-panel .linkbutton:hover {
    background: #f3f1ed;
    text-decoration: none;
}

.user-menu-panel form {
    margin: 5px 0 0;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

/* Menu mobile : masqué sur ordinateur */
.mobile-menu {
    display: none;
}

@media (max-width: 800px) {
    .site-header {
        padding: 12px 16px;
    }

    .site-header .header-inner {
        gap: 12px;
    }

    .desktop-navigation {
        display: none;
    }

    .site-header a.brand {
        min-width: 0;
        gap: 8px;
    }

    .site-header a.brand strong {
        font-size: clamp(0.95rem, 3.7vw, 1.2rem);
    }

    .site-header a.brand img.brand-logo {
        width: clamp(52px, 15vw, 75px);
        max-height: 38px;
    }

    .mobile-menu {
        display: block;
        margin-left: auto;
        flex-shrink: 0;
    }

    .mobile-menu > summary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        cursor: pointer;
        list-style: none;
        border: 1px solid #e7e2da;
        border-radius: 8px;
    }

    .hamburger-icon {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .hamburger-icon span {
        display: block;
        width: 20px;
        height: 2px;
        background: #292722;
        border-radius: 2px;
    }

    .menu-close-icon {
        display: none;
        font-size: 1.7rem;
        line-height: 1;
    }

    .mobile-menu[open] .hamburger-icon {
        display: none;
    }

    .mobile-menu[open] .menu-close-icon {
        display: block;
    }

    .mobile-menu-panel {
        position: absolute;
        top: calc(100% + 12px);
        left: -16px;
        right: -16px;
        z-index: 30;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 8px 16px 16px;
        background: #fff;
        border-bottom: 1px solid #e7e2da;
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
    }

    .mobile-menu-panel a,
    .mobile-menu-panel .linkbutton {
        display: block;
        width: 100%;
        padding: 13px 12px;
        font-size: 1rem;
        text-align: left;
        color: #4e483d;
        border-radius: 7px;
    }

    .mobile-menu-panel a:hover,
    .mobile-menu-panel .linkbutton:hover {
        background: #f3f1ed;
        text-decoration: none;
    }

    .mobile-user-label {
        margin-top: 9px;
        padding: 13px 12px 5px;
        border-top: 1px solid #e7e2da;
        color: #777;
        font-size: 0.85rem;
    }

    .mobile-logout {
        margin: 0;
    }
}

/* Paramètres et historique des prix */
.parameter-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.parameter-tabs a{padding:9px 12px;border:1px solid #e7e2da;border-radius:8px}.parameter-tabs a.active{background:#292722;color:#fff}.parameter-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #eee;padding:12px 0;flex-wrap:wrap}.parameter-edit,.parameter-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.parameter-edit{flex:1}.parameter-edit input{min-width:180px;flex:1}.parameter-actions form{margin:0}.history-table{width:100%;border-collapse:collapse}.history-table th,.history-table td{padding:10px 8px;border-bottom:1px solid #eee;text-align:left}@media(max-width:650px){.history-table{font-size:.8rem}.history-table th,.history-table td{padding:7px 4px}}


/* Correctif affichage Paramètres */
input[type="hidden"] { display: none; }
.parameter-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; }
.parameter-row .parameter-edit { display: flex; flex: 1 1 320px; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
.parameter-row .parameter-edit input[name="libelle"] { flex: 1 1 auto; min-width: 0; width: auto; margin: 0; }
.parameter-row .parameter-edit button { flex: 0 0 auto; white-space: nowrap; }
.parameter-row .parameter-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 6px; }
.parameter-row .parameter-actions form { display: inline-flex; flex: 0 0 auto; width: auto; margin: 0; }
.parameter-row .parameter-actions button { white-space: nowrap; }
.parameter-row .parameter-actions .muted { font-size: .85rem; margin-right: 6px; }
@media (max-width: 850px) {
  .parameter-row { flex-wrap: wrap; }
  .parameter-row .parameter-edit { flex: 1 1 100%; }
  .parameter-row .parameter-actions { flex-wrap: wrap; }
}
