/* ============================================
   LAGRAVURE - Styles Panier & Modal
   ============================================ */

/* ============================================
   NOTIFICATION
   ============================================ */
.cart-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-darker, #1a1a2e);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--accent-gold, #c9a962);
}

.cart-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   BADGE PANIER
   ============================================ */
.cart-badge,
.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent-gold, #c9a962);
  color: var(--bg-darker, #1a1a2e);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ============================================
   MODAL PERSONNALISATION
   ============================================ */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow-y: auto;
}

.product-modal.show {
  opacity: 1;
  visibility: visible;
}

.product-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.product-modal-content {
  position: relative;
  background: var(--bg-card, #16213e);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(201, 169, 98, 0.2);
}

.product-modal-content::-webkit-scrollbar {
  width: 6px;
}

.product-modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.product-modal-content::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 98, 0.4);
  border-radius: 3px;
}

.product-modal.show .product-modal-content {
  transform: scale(1) translateY(0);
}

.product-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.product-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Header */
.product-modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem;
}

.product-modal-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-gold, #c9a962);
}

/* Body */
.product-modal-body {
  padding: 1.5rem 2rem;
}

/* Upload Area */
.product-modal-upload {
  margin-bottom: 1.5rem;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  border: 2px dashed rgba(201, 169, 98, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(201, 169, 98, 0.05);
}

.upload-area:hover {
  border-color: var(--accent-gold, #c9a962);
  background: rgba(201, 169, 98, 0.1);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.upload-text {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Upload Preview */
.upload-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: rgba(0, 0, 0, 0.3);
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.upload-preview-remove:hover {
  background: #dc3545;
  transform: scale(1.1);
}

/* Message */
.product-modal-message label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.product-modal-message textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1rem;
  resize: none;
  height: 80px;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.product-modal-message textarea:focus {
  outline: none;
  border-color: var(--accent-gold, #c9a962);
}

.product-modal-message textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.message-counter {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.25rem;
}

/* Footer */
.product-modal-footer {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.product-modal-footer .btn {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.product-modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.product-modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.product-modal-footer .btn-primary {
  background: var(--accent-gold, #c9a962);
  color: var(--bg-darker, #1a1a2e);
}

.product-modal-footer .btn-primary:hover:not(:disabled) {
  background: #d4b56a;
  transform: translateY(-2px);
}

.product-modal-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   PAGE PANIER
   ============================================ */
.cart-page {
  min-height: 60vh;
  padding: 2rem 0;
}

.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cart-empty h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.cart-empty p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

/* Cart Grid */
.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .cart-grid {
    grid-template-columns: 1fr;
  }
}

/* Cart Items */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card, #16213e);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-item-name {
  font-weight: 600;
  color: #fff;
  font-size: 1.1rem;
}

.cart-item-dimensions {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.cart-item-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-gold, #c9a962);
}

.cart-item-custom-preview {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(201, 169, 98, 0.3);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.cart-item-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-gold, #c9a962);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-item-quantity button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-item-quantity button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-gold, #c9a962);
}

.cart-item-quantity span {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.cart-item-remove:hover {
  color: #dc3545;
}

/* Cart Summary */
.cart-summary {
  background: var(--bg-card, #16213e);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 100px;
}

.cart-summary h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-summary-row:last-of-type {
  border-bottom: none;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px solid rgba(201, 169, 98, 0.3);
}

.cart-summary-row span:first-child {
  color: rgba(255, 255, 255, 0.7);
}

.cart-summary-row span:last-child {
  font-weight: 600;
  color: #fff;
}

.cart-summary-row.total span:last-child {
  font-size: 1.5rem;
  color: var(--accent-gold, #c9a962);
}

.cart-summary-free-shipping {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 1rem 0;
  text-align: center;
}

.cart-summary-progress {
  margin: 1rem 0;
}

.cart-summary-progress-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

.cart-summary-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.cart-summary-progress-fill {
  height: 100%;
  background: var(--accent-gold, #c9a962);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.cart-checkout-btn {
  width: 100%;
  padding: 1.25rem;
  background: var(--accent-gold, #c9a962);
  color: var(--bg-darker, #1a1a2e);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
}

.cart-checkout-btn:hover {
  background: #d4b56a;
  transform: translateY(-2px);
}

.cart-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile */
@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }
  
  .cart-item-image {
    width: 80px;
    height: 80px;
  }
  
  .cart-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .product-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .product-modal-header,
  .product-modal-body,
  .product-modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .product-modal-footer {
    flex-direction: column;
  }
}

