@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
    --lavender: #ABA8E6;
    --purple:   #CAA8E6;
    --pink:     #E6A8E3;
    --yellow:   #E3E6A8;
    --green:    #A8E6AB;
    --white:    #FFFFFF;
    --dark:     #3a3a5c;
    --gray:     #f7f6ff;
    --border:   #ede9ff;
    --shadow:   rgba(171,168,230,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--gray);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══ HEADER ══ */
header {
    background: linear-gradient(135deg, #c5c2f0 0%, var(--purple) 50%, var(--pink) 100%);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
    letter-spacing: 1px;
    position: relative;
}
header h1 i { margin-right: 0.5rem; }
header p.tagline {
    color: rgba(255,255,255,0.88);
    margin-top: 0.4rem;
    font-style: italic;
    font-size: 1rem;
    position: relative;
}

/* ══ NAV ══ */
nav {
    background: var(--dark);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0;
}
nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.75rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}
nav a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--yellow);
    border-bottom-color: var(--yellow);
}

/* ══ TAGS FILTER ══ */
.tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1.5rem 1rem 0.5rem;
}
.tag-btn {
    background: white;
    color: var(--dark);
    border: 2px solid var(--border);
    border-radius: 25px;
    padding: 0.35rem 1.1rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}
.tag-btn:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-2px); }
.tag-btn.active { background: var(--purple); color: white; border-color: var(--purple); }

/* ══ SECTION TITRE ══ */
.section-title {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
}
.section-title span {
    background: linear-gradient(135deg, var(--lavender), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══ GRILLE PRODUITS ══ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    padding: 1.5rem 2rem 3rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* ══ CARTE PRODUIT ══ */
.card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), box-shadow 0.22s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}
.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--lavender);
}
.card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: var(--gray);
    overflow: hidden;
}
.card-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.card:hover .card-img-wrap img { transform: scale(1.06); }
.card-img-wrap .no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--lavender);
}

.badge-reduction {
    position: absolute;
    top: 10px; right: 10px;
    background: linear-gradient(135deg, var(--pink), #d46bd1);
    color: white;
    font-weight: 800;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.badge-rupture {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #b02a37;
    backdrop-filter: blur(2px);
    z-index: 3;
}

.card-body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.card-body h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.3;
}
.price-wrap { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1rem; color: var(--dark); }
.price-old { text-decoration: line-through; color: #bbb; font-size: 0.85rem; }
.price-new { color: #c044bc; font-weight: 800; font-size: 1rem; }

.card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.4rem; }
.card-tag {
    background: var(--yellow);
    color: var(--dark);
    border-radius: 10px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
}
.card-out-of-stock { opacity: 0.75; }

/* ══ PAGE DETAIL ══ */
.detail-wrap {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}
.gallery-main {
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: 0 4px 24px var(--shadow);
}
.gallery-main img { width: 100%; display: block; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.gallery-thumbs img {
    width: 68px; height: 68px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s, transform 0.15s;
}
.gallery-thumbs img:hover { transform: scale(1.08); }
.gallery-thumbs img.active { border-color: var(--purple); }

.detail-info h2 { font-size: 1.9rem; font-weight: 900; margin-bottom: 0.7rem; }
.detail-info .price { font-size: 1.6rem; }
.detail-desc { line-height: 1.75; color: #555; margin: 1rem 0; }

/* ══ BOUTONS ══ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--lavender), var(--purple));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.65rem 1.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.85rem; font-size: 0.8rem; border-radius: 20px; }
.btn-danger { background: linear-gradient(135deg, #f0a0a0, #e05555); }
.btn-green  { background: linear-gradient(135deg, var(--green), #5ec462); color: var(--dark); }
.btn-yellow { background: linear-gradient(135deg, var(--yellow), #c8cb60); color: var(--dark); }

/* ══ ADMIN — GRILLE CARTES ══ */
.admin-wrap {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.admin-wrap > h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark);
    border-left: 5px solid var(--purple);
    padding-left: 0.8rem;
    margin-bottom: 1.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.admin-card {
    background: white;
    border-radius: 18px;
    border: 2px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}
.admin-card:hover {
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateY(-3px);
    border-color: var(--lavender);
}
.admin-card-img {
    width: 100%;
    padding-top: 80%;
    position: relative;
    background: var(--gray);
    overflow: hidden;
}
.admin-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-card-img .no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--lavender);
}
.admin-card-body {
    padding: 0.9rem 1rem 0.7rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.admin-card-body h3 { font-size: 0.95rem; font-weight: 800; }
.admin-card-body .meta { font-size: 0.8rem; color: #888; display: flex; align-items: center; gap: 0.3rem; }
.admin-card-actions {
    padding: 0.6rem 0.8rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    background: var(--gray);
}

/* ══ BADGES STOCK ══ */
.badge-stock-ok {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #d4f5d6; color: #2d7a30;
    padding: 0.2rem 0.7rem; border-radius: 12px;
    font-size: 0.78rem; font-weight: 700;
}
.badge-stock-ko {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #fde8e8; color: #b02a37;
    padding: 0.2rem 0.7rem; border-radius: 12px;
    font-size: 0.78rem; font-weight: 700;
}

/* ══ TABLE (tags) ══ */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px var(--shadow); border: 2px solid var(--border); }
th { background: linear-gradient(135deg, var(--lavender), var(--purple)); color: white; padding: 0.85rem 1rem; text-align: left; font-weight: 800; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border: none; }
tr:hover td { background: var(--gray); }
table img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); }

/* ══ FORMULAIRE ══ */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 2rem 2.2rem;
    box-shadow: 0 4px 24px var(--shadow);
    border: 2px solid var(--border);
    max-width: 700px;
    margin: 2rem auto;
}
.form-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }

.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block; font-weight: 700;
    margin-bottom: 0.35rem; color: var(--dark);
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.35rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.95rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--dark);
    background: white;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px rgba(202,168,230,0.2); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input[type="checkbox"] { width: auto; margin-right: 0.4rem; }

.alert { padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.alert-success { background: #d4f5d6; color: #2d7a30; border: 1px solid #a8e6ab; }
.alert-error   { background: #fde8e8; color: #b02a37; border: 1px solid #f5c0c0; }

/* ══ EMPTY STATE ══ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--lavender), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    box-shadow: 0 8px 24px var(--shadow);
    animation: float 3s ease-in-out infinite;
}
.empty-state-icon i { font-size: 2.5rem; color: white; }

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
}
.empty-state p {
    color: #aaa;
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.6;
    margin: 0;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-discover {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.85rem 2.2rem;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 20px rgba(202,168,230,0.45);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn-discover:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 28px rgba(202,168,230,0.55);
    opacity: 0.95;
}
.btn-discover i { font-size: 1.1rem; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ══ FOOTER ══ */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    flex-shrink: 0;
}

/* ══ PANIER BADGE NAV ══ */
.cart-badge {
    background: var(--pink);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    margin-left: 0.2rem;
    vertical-align: middle;
}

/* ══ CARTE PRODUIT — bouton panier ══ */
.card-footer {
    padding: 0.6rem 1rem 0.9rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.card-footer form { flex: 1; }
.card-footer .btn-cart {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--lavender), var(--purple));
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 20px;
}
.card-footer .btn-cart:hover { opacity: 0.85; transform: translateY(-1px); }
.card-footer .btn-cart-disabled {
    width: 100%;
    justify-content: center;
    background: #eee;
    color: #aaa;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 20px;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ══ SÉLECTEUR QUANTITÉ (detail) ══ */
.qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    width: fit-content;
}
.qty-selector button {
    background: var(--gray);
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--dark);
    font-family: 'Nunito', sans-serif;
    transition: background 0.15s;
    flex-shrink: 0;
}
.qty-selector button:hover { background: var(--lavender); color: white; }
.qty-selector input[type="number"] {
    width: 52px;
    border: none;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    color: var(--dark);
    padding: 0;
    height: 40px;
    -moz-appearance: textfield;
}
.qty-selector input[type="number"]::-webkit-inner-spin-button,
.qty-selector input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-selector input:focus { outline: none; background: #faf9ff; }

.add-to-cart-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    padding: 1.2rem;
    background: var(--gray);
    border-radius: 16px;
    border: 2px solid var(--border);
}

/* ══ PAGE PANIER ══ */
.cart-wrap {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1 0 auto;
}
.cart-wrap > h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--purple);
    padding-left: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-list { display: flex; flex-direction: column; gap: 0.8rem; }

.cart-row {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
}
.cart-row-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lavender);
    font-size: 1.5rem;
    flex-shrink: 0;
}
.cart-row-thumb img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border);
}
.cart-row-info { min-width: 0; }
.cart-item-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--dark);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-name:hover { color: var(--purple); }
.cart-row-subtotal {
    font-weight: 800;
    font-size: 1rem;
    color: var(--dark);
    white-space: nowrap;
    min-width: 75px;
    text-align: right;
}

.cart-summary {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.3rem 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark);
    border-top: 2px solid var(--border);
    padding-top: 0.7rem;
    margin-top: 0.3rem;
}
.cart-summary-total span:last-child { color: var(--purple); }

.cart-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    justify-content: flex-end;
}

.qty-input {
    width: 56px;
    padding: 0.35rem 0.4rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-align: center;
    color: var(--dark);
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input:focus { border-color: var(--purple); outline: none; }

/* ══ CART CARDS GRID ══ */
.cart-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.cart-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.cart-card:hover { box-shadow: 0 6px 20px var(--shadow); }
.cart-card-img-link img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.cart-card-no-img {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--lavender);
    background: var(--gray);
}
.cart-card-body { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.cart-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.6rem;
    flex-wrap: wrap;
}
.cart-card-subtotal { font-weight: 800; font-size: 0.95rem; margin-left: auto; }

/* qty selector small */
.qty-selector-sm button { width: 30px; height: 30px; font-size: 0.9rem; }
.qty-selector-sm input  { width: 38px; height: 30px; font-size: 0.85rem; }

/* ══ MODAL ══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58,58,92,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}
.modal-box {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    border: 2px solid var(--border);
}
.modal-box h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--gray);
    border: none;
    border-radius: 50%;
    width: 34px; height: 34px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--dark);
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--lavender); color: white; }

/* ══ CHAT PAGE ══ */
.chat-page-wrap {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 700px) { .chat-page-wrap { grid-template-columns: 1fr; } }

.chat-cart-recap {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    position: sticky;
    top: 1rem;
}
.chat-cart-recap h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.4rem; }
.chat-cart-items { display: flex; flex-direction: column; gap: 0.4rem; }
.chat-cart-item { display: flex; justify-content: space-between; font-size: 0.88rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.chat-cart-total-row { border-bottom: none !important; border-top: 2px solid var(--border); padding-top: 0.5rem; margin-top: 0.3rem; font-size: 0.95rem; }
.chat-status { margin-top: 0.8rem; font-size: 0.85rem; font-weight: 600; }

.chat-box-wrap {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.chat-messages {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 420px;
    background: var(--gray);
}
.chat-msg { max-width: 75%; display: flex; flex-direction: column; gap: 0.2rem; }
.chat-msg p {
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}
.chat-msg time { font-size: 0.72rem; color: #aaa; }
.chat-msg-sender { font-size: 0.72rem; font-weight: 700; color: #888; }

.chat-msg-client { align-self: flex-start; }
.chat-msg-client p { background: white; border: 2px solid var(--border); color: var(--dark); }

.chat-msg-admin { align-self: flex-end; }
.chat-msg-admin .chat-msg-sender { text-align: right; }
.chat-msg-admin time { text-align: right; }
.chat-msg-admin p { background: linear-gradient(135deg, var(--lavender), var(--purple)); color: white; }

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    border-top: 2px solid var(--border);
    background: white;
}
.chat-input-row input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.chat-input-row input:focus { border-color: var(--purple); outline: none; }
.chat-input-row .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; justify-content: center; flex-shrink: 0; }

/* ══ STATUTS ══ */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 800;
}
.status-en_attente { background: var(--yellow); color: var(--dark); }
.status-en_cours   { background: var(--lavender); color: white; }
.status-terminée   { background: var(--green); color: var(--dark); }
.status-annulée    { background: #fde8e8; color: #b02a37; }

/* ══ ORDERS GRID (admin) ══ */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}
.order-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.status-border-en_attente { border-left: 5px solid #c8cb60; }
.status-border-en_cours   { border-left: 5px solid var(--lavender); }
.status-border-terminée   { border-left: 5px solid var(--green); }
.status-border-annulée    { border-left: 5px solid #f5c0c0; }

.order-card-head { display: flex; justify-content: space-between; align-items: center; }
.order-id { font-size: 0.8rem; color: #aaa; font-weight: 700; margin-right: 0.4rem; }
.order-items-list { display: flex; flex-direction: column; gap: 0.3rem; }
.order-item-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.order-total-row { border-bottom: none; border-top: 2px solid var(--border); padding-top: 0.4rem; }
.order-card-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: #888; flex-wrap: wrap; }
.order-status-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

@media (max-width: 640px) {
    header h1 { font-size: 1.6rem; }
    .detail-wrap { grid-template-columns: 1fr; }
    .products-grid { padding: 1rem; gap: 0.8rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}
@media (max-width: 600px) {
    .cart-row { grid-template-columns: auto 1fr auto; }
    .cart-row-subtotal { display: none; }
}
