/* ============================================================
   TANTI GUSTI II — STYLES PANIER
   Fichier : commande.css
   ============================================================ */

.commande-container {
    padding-bottom: 100px;
}

.cart-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

/* Items du panier */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 164, 92, 0.1);
    border-radius: 8px;
    transition: all 0.3s var(--ease);
}

.cart-item:hover {
    border-color: rgba(201, 164, 92, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.item-info {
    flex: 1;
}

.item-name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blanc);
    margin-bottom: 4px;
}

.item-price {
    color: var(--or);
    font-weight: 500;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    padding: 4px;
    border: 1px solid rgba(201, 164, 92, 0.2);
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--or);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: rgba(201, 164, 92, 0.1);
}

.qty-val {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.remove-btn {
    background: transparent;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
}

/* Résumé */
.summary-box {
    background: rgba(201, 164, 92, 0.05);
    border: 1px solid rgba(201, 164, 92, 0.2);
    padding: 32px;
    border-radius: 12px;
    position: sticky;
    top: 120px;
}

.cart-left {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Formulaire */
.checkout-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(201, 164, 92, 0.1);
    padding: 32px;
    border-radius: 12px;
}

.checkout-form h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: var(--or-clair);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--or);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 164, 92, 0.2);
    color: var(--blanc);
    padding: 14px 18px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.3s var(--ease);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--or);
    background: rgba(201, 164, 92, 0.05);
}

.form-group textarea {
    height: 100px;
    resize: none;
}

/* Success Message Overlay */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 13, 11, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.success-content {
    max-width: 400px;
    padding: 40px;
}

.success-icon {
    font-size: 4rem;
    color: var(--or);
    margin-bottom: 24px;
    display: block;
}

.success-content h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--blanc);
    margin-bottom: 16px;
}

.success-content p {
    color: var(--creme);
    opacity: 0.8;
    margin-bottom: 32px;
}

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

.summary-box h3 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.summary-divider {
    height: 1px;
    background: rgba(201, 164, 92, 0.1);
    margin: 24px 0;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blanc);
    opacity: 1;
    margin-bottom: 32px;
}

.w-100 {
    width: 100%;
    justify-content: center;
}

.summary-note {
    margin-top: 20px;
    font-size: 0.75rem;
    text-align: center;
    opacity: 0.5;
}

.empty-cart-msg {
    text-align: center;
    padding: 60px;
    font-size: 1.2rem;
    color: var(--creme);
    opacity: 0.7;
}

/* Mobile */
@media (max-width: 900px) {
    .cart-wrapper {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .item-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   GLOBAL RESPONSIVE FIXES (commande.css)
   ========================================================================== */
* {
  box-sizing: border-box;
}

input, select, textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 900px) {
  .cart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
  }
  .cart-left, .cart-summary {
    width: 100%;
    margin: 0;
  }
  .cart-summary {
    position: static;
    margin-bottom: 30px;
  }
  .checkout-form {
    padding: 15px;
  }
  #btn-order {
    width: 100%;
    white-space: normal;
    padding: 15px 10px;
    font-size: 1.1rem;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }
  .cart-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
    padding: 15px !important;
  }
  .item-info {
    width: 100%;
  }
  .item-controls {
    width: 100% !important;
    justify-content: space-between !important;
    margin-top: 10px;
  }
  .quantity-selector {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .checkout-form h3 {
    font-size: 1.2rem;
  }
  .cart-item h4 {
    font-size: 1rem;
  }
  .cart-item .item-price {
    font-size: 1.1rem;
  }
}

