/* doc-project | commande/v1/assets/css/components/cards.css | Définit les styles des cartes produit et leurs adaptations responsives. | Expose: aucun | Dépend de: commande/v1/assets/css variables globales, composants .btn/.btnGhost | Impacte: UI cartes, lisibilité, comportement responsive | Tables: aucune */
.card{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  border: 1px solid rgba(0,0,0,.08);
}

/* UX: la card du menu est cliquable (sauf la photo) pour ouvrir la modal */
.card[data-item]{
  cursor: pointer;
}
.card[data-item] .itemCard__img,
.card[data-item] [data-add]{
  cursor: pointer;
}

/* =========================================================
 * FIX CONTRASTE (panier): boutons "Personnaliser" illisibles
 * Le bouton "Personnaliser" est un .btnGhost rendu dans une .card
 * (fond clair). On force un ghost lisible UNIQUEMENT dans les cards
 * pour ne pas impacter les usages potentiels sur fonds sombres ailleurs.
 * ========================================================= */
.card .btn.btnGhost{
  color: var(--text);
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.14);
}
.card .btn.btnGhost:hover{
  background: rgba(0,0,0,.10);
}
.card__body{
  padding: 14px;
}
.card__title{
  margin:0 0 6px;
  font-size: 18px;
  font-weight: 900;
}
.card__muted{
  color: var(--muted);
  font-size: 14px;
}
.card__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.card__pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(0,0,0,.06);
}
.pillOk{ background: rgba(27,127,42,.12); color: #0c5318; }
.pillNo{ background: rgba(178,34,34,.12); color: #7a0f0f; }

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px){
  .grid2{ grid-template-columns: 1fr 1fr; }
}

.itemCard{
  /* Grid = beaucoup plus robuste que flex ici (évite les superpositions) */
  display:grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-auto-rows: minmax(0, auto);
  column-gap: 12px;
  row-gap: 10px;
  align-items: start;
}
.itemCard__img{
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
  grid-column: 1;
  grid-row: 1;
  background: rgba(0,0,0,.06);
  cursor: pointer;
}
.itemCard__img:focus{
  outline: 3px solid rgba(178,34,34,.35);
  outline-offset: 2px;
}
.itemCard__main{
  grid-column: 2;
  grid-row: 1;
  min-width: 0; /* autorise ellipsis / évite overflow */
}
.itemCard__actionsWrap{
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}
.itemCard__name{
  margin: 0 0 4px;
  font-weight: 950;
  letter-spacing: .1px;
  font-size: 17px;
  line-height: 1.15;
}
.itemCard__meta{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  min-width: 0;
}
.itemCard__ingredients{
  margin-top: 8px;
  color: rgba(17,17,17,.95);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: .01em;
  min-width: 0;
}
.itemCard__actions{
  min-width: 0;
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11,42,91,.04), rgba(11,42,91,.07));
  border: 1px solid rgba(11,42,91,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 10px 22px rgba(12,24,48,.08);
}
.price{
  font-weight: 950;
  font-size: 14px;
  text-align: left;
  white-space: normal;
  overflow: visible;
  word-break: keep-all;
}
.price span{
  /* Toujours 1 ligne par info prix (XXL / XL / prix unique) */
  display: block;
}
.price .card__muted{
  margin-top: 2px;
}

.itemCard__actions .btnInline{
  min-width: 132px;
  width: auto;
  max-width: none;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
}

/* Responsive : sur petits écrans, on passe les actions sous le texte */
@media (max-width: 520px){
  .itemCard{
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
  }
  .itemCard__img{
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }
  .itemCard__actionsWrap{
    gap: 10px;
  }
  .itemCard__actions{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
  }
  .itemCard__ingredients{
    font-size: 14.5px;
    line-height: 1.5;
  }
  .price{
    text-align: left;
    white-space: normal; /* autorise 2 lignes (XXL/XL) sans casser */
  }
  .itemCard__actions .btnInline{
    min-width: 116px;
  }
}

/* Très petits écrans : bouton pleine largeur pour éviter tout chevauchement */
@media (max-width: 360px){
  .itemCard__actions{
    flex-direction: column;
    align-items: stretch;
  }
  .itemCard__actions .btnInline{
    max-width: none;
    width: 100%;
  }
  .price{
    align-self: stretch;
    text-align: left;
  }
}

