/* ==========================
   PAGE PANIER
   ========================== */

.panier-page {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.page-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title i {
  color: var(--secondary-color);
}

/* Layout du panier */
.panier-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

/* Liste des articles */
.panier-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panier-item {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 120px 2.5fr 140px 100px auto;
  gap: 1.5rem;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.panier-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.item-image {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-details {
  min-width: 0;
}

.item-title {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.item-title a {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.item-title a:hover {
  color: var(--secondary-color);
}

.item-category {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.item-specs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  align-items: center;
}

.spec {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-light);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-dark);
  white-space: nowrap;
  line-height: 1.3;
  height: 22px;
}

.spec i {
  color: var(--secondary-color);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.stock-warning {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

/* Quantité */
.item-quantity {
  text-align: center;
}

.item-quantity label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-light);
  border-radius: 6px;
  padding: 0.2rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: white;
  color: var(--secondary-color);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.qty-btn:hover {
  background: var(--secondary-color);
  color: white;
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}

/* Prix */
.item-price {
  text-align: right;
  min-width: 90px;
}

.price-unit {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.price-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary-color);
}

/* Actions */
.item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-remove {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.btn-remove:hover {
  background: #ffe5e5;
  transform: scale(1.1);
}

/* Résumé du panier */
.panier-summary {
  position: sticky;
  top: 100px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.summary-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.summary-price {
  font-weight: 600;
  color: var(--text-dark);
}

.summary-divider {
  height: 2px;
  background: var(--bg-light);
  margin: 1.5rem 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.total-price {
  color: var(--secondary-color);
  font-size: 1.8rem;
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Conteneur des boutons PayPal */
#paypal-button-container {
  width: 100%;
  margin-bottom: 1rem;
  min-height: 45px;
}

/* Style pour les boutons PayPal */
#paypal-button-container > div {
  width: 100% !important;
}

/* Si PayPal n'est pas chargé, on cache le conteneur vide */
#paypal-button-container:empty {
  display: none;
}

.btn-continue-shopping {
  width: 100%;
  padding: 0.8rem;
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.btn-continue-shopping:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.btn-clear-cart {
  width: 100%;
  padding: 0.8rem;
  background: transparent;
  border: 2px solid #e74c3c;
  color: #e74c3c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-clear-cart:hover {
  background: #e74c3c;
  color: white;
}

/* Panier vide */
.panier-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.panier-empty i {
  color: var(--accent-color);
  margin-bottom: 2rem;
  opacity: 0.5;
}

.panier-empty h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.panier-empty p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 1rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.3s ease;
  z-index: 10000;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #27ae60;
}

.toast-error {
  background: #e74c3c;
}

.toast-warning {
  background: #f39c12;
}

/* ==========================
   RESPONSIVE - PANIER PAGE
   ========================== */

/* Mobile - Téléphone (jusqu'à 767px) */
@media (max-width: 767px) {
  .panier-page {
    padding: 1rem 0;
  }

  .page-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    text-align: center;
  }

  .panier-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .panier-items {
    gap: 1rem;
  }

  .panier-item {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    padding: 1rem;
    position: relative;
  }

  .item-image {
    width: 80px;
    height: 80px;
    grid-row: 1 / 3;
  }

  .item-details {
    grid-column: 2;
    grid-row: 1;
  }

  .item-title {
    font-size: 1rem;
  }

  .item-category,
  .item-specs {
    font-size: 0.8rem;
  }

  .item-quantity {
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .item-quantity label {
    font-size: 0.85rem;
  }

  .quantity-controls {
    justify-content: flex-start;
    width: fit-content;
    min-width: 120px;
  }

  .qty-btn {
    width: 35px;
    height: 35px;
  }

  .qty-input {
    width: 50px;
    font-size: 0.95rem;
  }

  .item-price {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
    justify-self: end;
    align-self: start;
  }

  .item-price-label {
    display: none;
  }

  .item-price-value {
    font-size: 1.1rem;
  }

  .item-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .btn-delete {
    padding: 0.4rem;
    font-size: 0.9rem;
  }

  /* Résumé du panier */
  .panier-summary {
    position: static;
    margin-top: 1rem;
  }

  .summary-card {
    padding: 1.25rem;
  }

  .summary-card h2 {
    font-size: 1.3rem;
  }

  .summary-row {
    font-size: 0.95rem;
  }

  .summary-total {
    font-size: 1.25rem;
  }

  .btn-checkout {
    padding: 0.9rem;
    font-size: 1rem;
  }

  /* Panier vide */
  .empty-cart {
    padding: 2rem 1rem;
  }

  .empty-cart i {
    font-size: 3rem;
  }

  .empty-cart h2 {
    font-size: 1.5rem;
  }

  .empty-cart p {
    font-size: 0.95rem;
  }

  /* Checkout page */
  .checkout-content {
    grid-template-columns: 1fr;
  }

  .checkout-form {
    padding: 1.25rem;
  }

  .checkout-form h2 {
    font-size: 1.4rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Tablette (768px à 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .page-title {
    font-size: 2.25rem;
  }

  .panier-content {
    grid-template-columns: 1fr 350px;
    gap: 1.75rem;
  }

  .panier-item {
    grid-template-columns: 100px 2fr 130px 90px auto;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .item-image {
    width: 100px;
    height: 100px;
  }

  .item-title {
    font-size: 1.05rem;
  }

  .panier-summary {
    position: static;
  }

  .summary-card {
    padding: 1.5rem;
  }

  /* Checkout page */
  .checkout-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Desktop / PC (1025px et plus) */
@media (min-width: 1025px) {
  .panier-content {
    grid-template-columns: 1fr 400px;
    gap: 2rem;
  }

  .panier-item {
    grid-template-columns: 120px 2.5fr 140px 100px auto;
  }

  .panier-item:hover {
    transform: translateY(-2px);
  }

  .panier-summary {
    position: sticky;
    top: 100px;
  }

  .btn-checkout:hover {
    transform: translateY(-2px);
  }

  .btn-delete:hover {
    transform: scale(1.1);
  }

  /* Checkout page */
  .checkout-content {
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
  }
}
