/* ==========================================================================
   A4W Lists — front
   Couleurs synchronisées avec les variables CSS du thème (gumuchev2 / fallback bs)
   ========================================================================== */
:root {
    --primary-color: var(--primary-color, var(--bs-primary, #593322));
    --button-hover-color: var(--button-hover-color, #382015);
    --secondary-color: var(--secondary-color, var(--bs-secondary, #FFE4ED));
    --primary-color: var(--text-color, var(--bs-body-color, #333));
    --background-color: var(--background-color, var(--bs-body-bg, #fff));
    --border-color-light: var(--border-color-light, #E8E8E8);
    --medium-gray: var(--medium-gray, #666);
    --light-gray: var(--light-gray, #F5F5F5);
    --background-color: var(--button-text-color, #fff);
    --box-shadow: var(--box-shadow, 0 4px 10px rgba(0, 0, 0, 0.1));
}

/* ==========================================================================
   Bouton « ajouter à une liste »
   ========================================================================== */
.a4w-lists-button {
    position: relative;
    display: inline-block;
}

/* Sur la fiche produit on étend pour que le dropdown puisse pousser le contenu */
.a4w-lists-button--page {
    display: block;
    width: 100%;
    max-width: 360px;
}

.a4w-lists-button--card {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.a4w-lists-trigger {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-round, 4px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.a4w-lists-trigger:hover {
    background: var(--primary-color);
    color: var(--background-color);
}

.a4w-lists-trigger--active {
    background: var(--primary-color);
    color: var(--background-color);
}

.a4w-lists-button--card .a4w-lists-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--box-shadow);
}

.a4w-lists-trigger .material-icons {
    font-size: 20px;
}

/* ==========================================================================
   Dropdown — pousse le contenu sur la fiche produit, overlay sur les vignettes
   ========================================================================== */
.a4w-lists-dropdown {
    background: var(--background-color);
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    padding: 12px;
    color: var(--primary-color);
}

.a4w-lists-dropdown[hidden] {
    display: none;
}

/* Sur la fiche produit : en flux normal, sous le bouton */
.a4w-lists-button--page .a4w-lists-dropdown {
    position: relative;
    margin-top: 10px;
    width: 100%;
    max-width: 360px;
}

/* Sur les vignettes catalogue : overlay flottant */
.a4w-lists-button--card .a4w-lists-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 260px;
}

.a4w-lists-dropdown__header {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color-light);
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--primary-color);
}

.a4w-lists-dropdown__items {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.a4w-lists-dropdown__items li {
    padding: 4px 0;
}

.a4w-lists-dropdown__items label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    color: var(--primary-color);
}

.a4w-lists-dropdown__items input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.a4w-lists-dropdown__empty {
    color: var(--medium-gray);
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

.a4w-lists-dropdown__create {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color-light);
    display: flex;
    gap: 6px;
}

.a4w-lists-dropdown__create input {
    flex: 1;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    background: var(--background-color);
    color: var(--primary-color);
}

.a4w-lists-dropdown__create input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.a4w-lists-dropdown__create .a4w-lists-create {
    background: var(--primary-color);
    color: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.a4w-lists-dropdown__create .a4w-lists-create:hover {
    background: var(--button-hover-color);
    border-color: var(--button-hover-color);
}

/* ==========================================================================
   Page « Mes listes »
   ========================================================================== */
.a4w-mylists {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .a4w-mylists { grid-template-columns: 1fr; }
}

.a4w-mylists__sidebar {
    background: var(--light-gray);
    border-radius: 6px;
    padding: 16px;
}

.a4w-mylists__sidebar h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--primary-color);
}

.a4w-mylists__list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.a4w-mylists__list li { margin-bottom: 4px; }

.a4w-mylists__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
    transition: background 0.15s;
}

.a4w-mylists__list a:hover,
.a4w-mylists__list li.is-active a {
    background: var(--background-color);
    color: var(--primary-color);
}

.a4w-mylists__list .badge {
    background: var(--primary-color);
    color: var(--background-color);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.a4w-mylists__list .badge-default {
    background: var(--secondary-color);
    color: var(--primary-color);
    margin-left: 6px;
}

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

.a4w-mylists__create-form input {
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 8px 10px;
    background: var(--background-color);
    color: var(--primary-color);
}

.a4w-mylists__create-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.a4w-mylists__create-form .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--background-color);
}

.a4w-mylists__create-form .btn-primary:hover {
    background: var(--button-hover-color);
    border-color: var(--button-hover-color);
}

.a4w-mylists__limit {
    font-size: 12px;
    margin: 0;
    color: var(--medium-gray);
}

.a4w-mylists__detail {
    min-height: 200px;
}

.a4w-mylists__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.a4w-mylists__name {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
}

.a4w-mylists__rename {
    padding: 0;
    color: var(--medium-gray);
}

.a4w-mylists__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.a4w-mylists__table { width: 100%; }

.a4w-mylists__cell-image img {
    width: 64px;
    height: auto;
    border-radius: 4px;
}

/* Quantité */
.a4w-mylists__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    overflow: hidden;
    background: var(--background-color);
}

.a4w-mylists__qty .btn-qty {
    background: var(--light-gray);
    border: 0;
    width: 30px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    color: var(--primary-color);
    transition: background 0.15s;
}

.a4w-mylists__qty .btn-qty:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.a4w-mylists__qty-input {
    width: 50px;
    height: 32px;
    border: 0;
    text-align: center;
    background: var(--background-color);
    color: var(--primary-color);
    -moz-appearance: textfield;
}

.a4w-mylists__qty-input::-webkit-outer-spin-button,
.a4w-mylists__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.a4w-mylists__remove {
    color: #c0392b;
}

.a4w-mylists__cart-actions {
    text-align: right;
    margin-top: 16px;
}

.a4w-mylists__cart-actions .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--background-color);
}

.a4w-mylists__cart-actions .btn-primary:hover {
    background: var(--button-hover-color);
    border-color: var(--button-hover-color);
}

.a4w-mylists__cart-actions .material-icons {
    vertical-align: middle;
    margin-right: 4px;
}

/* ==========================================================================
   Lien « Mes listes » dans le bloc compte client
   ========================================================================== */
.a4w-lists-account-link {
    color: var(--primary-color);
}

.a4w-lists-account-link:hover {
    color: var(--primary-color);
}
