/* ==========================================================================
   Diva Pizza — améliorations de la carte (novembre 2026)
   Fichier chargé après tous les autres styles (functions.php, bloc
   « 18. CSS AMELIORATIONS »). Pour revenir en arrière, vider ce fichier.
   ========================================================================== */

/* ---- Fiche produit : nom en entier, prix et bouton à droite ---------------
     [photo] Nom du produit ............ 8,90 €
     [photo] description           [ Ajouter ]
   ------------------------------------------------------------------------- */
.woofood-products .woofood-product-loop {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  grid-template-areas:
    "image name  price"
    "image descr button";
  grid-template-rows: auto 1fr;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
  padding: 12px 6px;
  border-bottom: 1px solid #eee;
}

/* Produit sans photo : le texte prend toute la largeur */
.woofood-products .woofood-product-loop:not(:has(.product-image img)) {
  grid-template-columns: 0 minmax(0, 1fr) auto;
  column-gap: 0;
}
.woofood-products .woofood-product-loop:not(:has(.product-image img)) :is(.product-price, .product-button) {
  margin-left: 12px;
}

.woofood-product-loop .product-image {
  grid-area: image;
  align-self: center;
  width: 90px !important;
  max-width: none !important;
}
.woofood-product-loop .product-image img {
  display: block;
  width: 90px !important;
  max-width: none !important;
  height: 90px !important;
  object-fit: cover;
  border-radius: 12px;
}

.woofood-product-loop .product-title {
  display: contents;
}
.woofood-product-loop .product-title > span:first-child {
  grid-area: name;
  align-self: center;
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a1a;
}
.woofood-product-loop .product-title .product-short-descr {
  grid-area: descr;
  margin: 0;
}
.woofood-product-loop .product-title .product-short-descr,
.woofood-product-loop .product-title .product-short-descr * {
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  color: #666 !important;
}
.woofood-product-loop .product-title .product-short-descr p {
  margin: 0;
}
.woofood-product-loop .product-title .product-short-descr img.emoji {
  width: 1em !important;
  height: 1em !important;
}

.woofood-product-loop .product-price {
  grid-area: price;
  align-self: center;
  justify-self: end;
  width: auto !important;
  min-width: max-content;
  max-width: none !important;
  flex: none;
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: #cc0000;
  white-space: nowrap;
}

.woofood-product-loop .product-button {
  grid-area: button;
  align-self: end;
  justify-self: end;
  width: auto;
}
.woofood-product-loop .product-button .button {
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

/* ---- Bandeaux de catégories : moins hauts, coins arrondis ---------------- */
.woofood-accordion .panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  height: auto;
  padding: 6px 14px;
  border-radius: 10px;
}
.woofood-accordion .panel-heading img {
  flex: none;
  width: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 2px !important;
  object-fit: contain;
}
.woofood-accordion .panel-heading .panel-title {
  flex: 1;
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}
.woofood-accordion .panel-heading .accordion-plus-icon {
  position: static;
  flex: none;
  width: auto !important;
  height: auto !important;
  margin: 0;
  padding: 0 !important;
  line-height: 1 !important;
}
.woofood-accordion .panel-heading .accordion-plus-icon i {
  line-height: 1 !important;
}

/* ---- Fenêtre de choix du produit (« Ajouter ») --------------------------- */
/* Supprime le grand espace blanc au-dessus de la photo */
#product_view .modal__content {
  margin-top: 0 !important;
}
#product_view .image-column {
  border-radius: 14px;
  overflow: hidden;
}
#product_view .image-column img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
}
#product_view .column-50-wf > .price {
  display: inline-block;
  margin: 12px 0 6px !important;
  padding: 6px 14px !important;
  border: 0 !important;
  border-radius: 20px !important;
  font-size: 16px !important;
  font-weight: 700;
}
#product_view .woocommerce-product-details__short-description {
  padding: 4px 0 0 !important;
}
#product_view .woocommerce-product-details__short-description p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: #555;
}

/* Groupes de choix : cartes arrondies, titre en pastille gris foncé */
#product_view .extra-options-accordion {
  margin-top: 8px;
  padding: 0;
}
#product_view .woofood_flat_category {
  margin: 30px 0 10px !important;
  padding: 22px 14px 6px !important;
  border: 1px solid #e6e6e6 !important;
  border-radius: 14px !important;
  background: #fff;
}
#product_view .wf-flat-style-title {
  left: 12px;
  padding: 5px 12px !important;
  border-radius: 20px;
  background: #333333 !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 700;
  letter-spacing: .02em;
}
#product_view .woofood_flat_category > ul {
  margin: 0;
  padding: 0;
}

/* Une ligne par choix : nom à gauche, case à droite, toute la ligne cliquable */
#product_view .extra_options_checkbox {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  float: none !important;
  width: 100% !important;
  min-height: 46px;
  padding: 0 4px;
  border-bottom: 1px solid #f1f1f1;
}
#product_view .woofood_flat_category > ul > .extra_options_checkbox:last-of-type {
  border-bottom: 0;
}
#product_view .extra_options_label {
  flex: 1;
  float: none !important;
  width: auto !important;
  padding: 0 !important;
  text-align: left !important;
}
#product_view .extra_options_label label {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #222;
}
#product_view .extra_options_value {
  flex: none;
  float: none !important;
  width: auto !important;
  padding: 0 !important;
  color: #cc0000;
  font-weight: 600;
}
#product_view .woofood-cbx::after {
  content: "";
  position: absolute;
  inset: 0;
  cursor: pointer;
}
#product_view .extra_options_checkbox:has(input:checked) {
  background: #fff6f6;
}
#product_view .extra_options_checkbox:has(input:checked) .extra_options_label label {
  color: #cc0000;
  font-weight: 700;
}

/* Choix de taille / seul ou en menu (pizzas, sandwichs…).
   Le tableau est transformé en blocs : sur iPhone (Safari), une cellule
   de tableau en position absolue se retrouvait écrasée en colonne. */
#product_view table.variations,
#product_view table.variations tbody,
#product_view table.variations tr,
#product_view table.variations th,
#product_view table.variations td {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
}
#product_view table.variations tr {
  position: relative !important;
  margin: 30px 0 10px !important;
  padding: 24px 14px 12px !important;
  border: 1px solid #e6e6e6 !important;
  border-radius: 14px !important;
}
#product_view table.variations td.value {
  float: none !important;
  padding: 0 !important;
}
#product_view table.variations td.value select {
  width: 100% !important;
  max-width: none !important;
}
#product_view table.variations th.label {
  position: absolute !important;
  top: -13px !important;
  left: 12px !important;
  right: auto !important;
  width: auto !important;
  max-width: calc(100% - 24px);
  height: auto !important;
  margin: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 5px 12px !important;
  border-radius: 20px;
  background: #333333 !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 700;
  line-height: 1.2 !important;
}
#product_view table.variations th.label label {
  margin: 0;
  color: #fff !important;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
}

/* ---- Carte : description limitée à 2 lignes (texte complet dans la fenêtre « Ajouter ») */
.woofood-product-loop .product-title .product-short-descr {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.woofood-product-loop .product-title .product-short-descr * {
  display: inline !important;
}
.woofood-product-loop .product-title .product-short-descr img.emoji {
  display: inline-block !important;
}

/* ==========================================================================
   Page panier
   ========================================================================== */
/* Options du produit sur quelques lignes : « Tortillas · Salade · Ketchup » */
.woocommerce-cart-form dl.variation {
  margin: 4px 0 0;
  color: #666;
}
.woocommerce-cart-form dl.variation dt,
.woocommerce-cart-form dl.variation dd,
.woocommerce-cart-form dl.variation dd p {
  display: inline !important;
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: 13px !important;
  font-weight: 400;
  line-height: 1.45 !important;
}
.woocommerce-cart-form dl.variation dt {
  margin-right: 3px !important;
  color: #888;
}
.woocommerce-cart-form dl.variation dt:empty {
  display: none !important;
}
.woocommerce-cart-form dl.variation dd::after {
  content: " · ";
  color: #bbb;
}
.woocommerce-cart-form dl.variation dd:last-of-type::after {
  content: "";
}
.woocommerce-cart-form dl.variation img.emoji {
  width: 1em !important;
  height: 1em !important;
}

.woocommerce-cart-form .product-name a {
  color: inherit;
  text-decoration: none;
}
.woocommerce-cart-form .woofood-cart-product-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.woocommerce-cart-form td.product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fdecec;
  color: #cc0000 !important;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}
.woocommerce-cart-form .product-subtotal {
  font-weight: 700;
  color: #cc0000;
  white-space: nowrap;
}
.woocommerce-cart-form .quantity {
  display: flex;
  align-items: center;
  gap: 4px;
}
.woocommerce-cart-form .quantity .qty-change-button {
  border-radius: 8px;
}
.woocommerce-cart-form .quantity input.qty {
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* Téléphone : une carte par produit
     Nom du produit ............ 8,45 €
     options · options · options
     [- 1 +]                         (x)          */
@media (max-width: 768px) {
  .woocommerce-cart h1.entry-title,
  .woocommerce-cart .page-title {
    margin-bottom: 10px;
    font-size: 30px;
  }
  .woocommerce-cart-form table.shop_table thead {
    display: none !important;
  }
  .woocommerce-cart-form table.shop_table,
  .woocommerce-cart-form table.shop_table tbody {
    display: block;
    width: 100%;
    border: 0;
  }
  .woocommerce-cart-form tr.cart_item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "name sub"
      "qty  remove" !important;
    gap: 10px 12px;
    align-items: center;
    padding: 14px 4px;
    border-bottom: 1px solid #eee;
  }
  .woocommerce-cart-form tr.cart_item td {
    display: block;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
  }
  .woocommerce-cart-form tr.cart_item td::before {
    display: none !important;
  }
  .woocommerce-cart-form td.product-name     { grid-area: name; align-self: start; }
  .woocommerce-cart-form td.product-subtotal { grid-area: sub; align-self: start; font-size: 16px; }
  .woocommerce-cart-form td.product-quantity { grid-area: qty; }
  .woocommerce-cart-form td.product-remove   { grid-area: remove; justify-self: end; }
  .woocommerce-cart-form td.product-price,
  .woocommerce-cart-form td.product-thumbnail {
    display: none !important;
  }

  /* Code promo et mise à jour */
  .woocommerce-cart-form tr:not(.cart_item) {
    display: block;
  }
  .woocommerce-cart-form td.actions {
    display: block;
    padding: 14px 0 0 !important;
    border: 0;
  }
  .woocommerce-cart-form .coupon {
    display: flex;
    gap: 8px;
    float: none !important;
    width: 100%;
  }
  .woocommerce-cart-form .coupon input#coupon_code {
    flex: 1;
    width: auto !important;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 15px;
  }
  .woocommerce-cart-form .coupon button {
    flex: none;
    width: auto !important;
    height: 44px;
    margin: 0 !important;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
  }
  .woocommerce-cart-form button[name="update_cart"] {
    display: block;
    width: 100%;
    height: 40px;
    margin: 10px 0 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 10px;
    background: #fff !important;
    color: #555 !important;
    font-size: 14px;
    box-shadow: none;
  }

  /* Total panier */
  .cart-collaterals .cart_totals {
    padding: 16px !important;
    border-radius: 14px;
  }
  .cart-collaterals .cart_totals h2 {
    margin: 0 0 8px;
    font-size: 20px;
    text-align: left;
  }
  .cart-collaterals .cart_totals table tr {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border: 0;
  }
  .cart-collaterals .cart_totals table th,
  .cart-collaterals .cart_totals table td {
    display: block;
    width: auto !important;
    padding: 6px 0 !important;
    border: 0 !important;
    text-align: left;
  }
  .cart-collaterals .cart_totals table td {
    text-align: right !important;
  }
  .cart-collaterals .cart_totals table td::before {
    display: none !important;
  }
  .cart-collaterals .cart_totals .order-total td strong {
    font-size: 20px;
    color: #cc0000;
  }
  .cart-collaterals .cart_totals .includes_tax {
    display: block;
    font-size: 12px;
    color: #888;
  }
}

/* Titres des groupes de choix : toujours en gris foncé, quel que soit l'état */
#product_view .extra-options-accordion a.wf-flat-style-title,
#product_view .extra-options-accordion a.wf-flat-style-title:hover,
#product_view .extra-options-accordion a.wf-flat-style-title:focus,
#product_view .extra-options-accordion a.wf-flat-style-title:active,
#product_view .extra-options-accordion a.wf-flat-style-title:visited {
  background: #333333 !important;
  background-color: #333333 !important;
  color: #fff !important;
  opacity: 1 !important;
  filter: none !important;
  text-decoration: none !important;
}
