/* =========================================
   MINI CART / OFFCANVAS – BASE
   ========================================= */

.woocommerce-mini-cart__empty-message {
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed #333;
}

/* Offcanvas styling */
.offcanvas.text-bg-dark,
.tt-mini-cart-panel {
    background-color: #050505 !important;
    color: #f9fafb;
}

.offcanvas.text-bg-dark .offcanvas-header {
    background-color: #0b0b0b;
}

/* Header Title (Main) */
.tt-mini-cart-main-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

/* =========================================
   LAYOUT GLOBAL DU OFFCANVAS
   ========================================= */

#ttMiniCart .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 1.25rem;
}

/* Le contenu du mini-cart occupe toute la hauteur disponible
   pour pouvoir "coller" le résumé + les boutons en bas */
#ttMiniCart .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* =========================================
   LISTE DES ITEMS
   ========================================= */

.tt-mini-cart-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    flex: 1 1 auto;
    /* la liste prend tout l'espace restant */
    min-height: 0;
    overflow-y: auto;
    /* scroll si trop d'articles */
}

.tt-mini-cart-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.tt-mini-cart-item:last-child {
    border-bottom: none;
}

.tt-mini-cart-item-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1 1 auto;
}

.tt-mini-cart-thumb img {
    width: 56px !important;
    height: 56px !important;
    max-width: none;
    object-fit: cover;
    border-radius: 0.5rem;
    aspect-ratio: 1 / 1;
}

.tt-mini-cart-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tt-mini-cart-title a,
.tt-mini-cart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f9fafb;
    text-decoration: none;
}

.tt-mini-cart-title a:hover {
    text-decoration: underline;
}

/* Quantité + prix */
.tt-mini-cart-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tt-mini-cart-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #101116;
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
}

.tt-mini-cart-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #f9fafb;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tt-mini-cart-qty-btn:hover {
    background: rgba(148, 163, 184, 0.25);
}

.tt-mini-cart-qty-input {
    width: 36px;
    border: 0;
    background: transparent;
    color: #f9fafb;
    font-size: 0.8rem;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.tt-mini-cart-qty-input::-webkit-outer-spin-button,
.tt-mini-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tt-mini-cart-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    /* prix rouge */
}

/* bouton supprimer */
.tt-mini-cart-remove {
    display: flex;
    align-items: flex-start;
}

#ttMiniCart .tt-mini-cart-item .tt-mini-cart-remove-link {
    color: rgba(148, 163, 184, 0.8) !important;
    /* Force override of Woo default red */
    font-size: 1.5rem;
    text-decoration: none;
    font-family: system-ui, -apple-system, sans-serif;
    /* Restore standard cross look */
    font-weight: 400;
    line-height: 1;
}

#ttMiniCart .tt-mini-cart-item .tt-mini-cart-remove-link:hover {
    color: var(--accent-color) !important;
    background: transparent !important;
    /* Kill the red circle from Woo defaults */
}

/* =========================================
   RÉSUMÉ / TOTALS – collé en bas
   ========================================= */

.tt-mini-cart-summary {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-right: 0.75rem;
    /* prevent total from sticking to edge */
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.tt-mini-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tt-mini-cart-label {
    color: rgba(148, 163, 184, 0.9);
}

.tt-mini-cart-label--total {
    font-weight: 700;
    /* !important flags below: Required to override WooCommerce core cart styles */
    font-size: 1.1rem !important;
    /* Slightly smaller than Commander button */
    padding-left: 10px !important;
    /* Force spacing from edge */
    color: #fff !important;
    /* Make it stand out more */
}

.tt-mini-cart-value,
.tt-mini-cart-value .amount {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.4rem;
}

.tt-mini-cart-row--shipping .tt-mini-cart-note {
    color: rgba(148, 163, 184, 0.9);
}

/* =========================================
   ACTIONS – collées en bas
   ========================================= */

.tt-mini-cart-actions {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tt-mini-cart-btn-full,
.tt-mini-cart-btn-checkout {
    border-radius: 999px !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Harmonise le style avec le reste du thème */
.tt-mini-cart-btn-checkout {
    background: var(--accent-color);
    border-color: var(--accent-color);
    width: 80%;
    /* Reduced width */
}

.tt-mini-cart-btn-checkout:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* =========================================
   LIGHT MODE OVERRIDES
   ========================================= */
[data-theme="light"] .offcanvas.text-bg-dark,
[data-theme="light"] .tt-mini-cart-panel,
[data-theme="light"] .offcanvas.text-bg-dark .offcanvas-header {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

[data-theme="light"] .tt-mini-cart-main-title,
[data-theme="light"] .tt-mini-cart-title a,
[data-theme="light"] .tt-mini-cart-title {
    color: #111827 !important;
}

[data-theme="light"] .tt-mini-cart-item {
    border-bottom-color: #e5e7eb !important;
}

[data-theme="light"] .tt-mini-cart-qty {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
}

[data-theme="light"] .tt-mini-cart-qty-btn {
    color: #4b5563 !important;
}

[data-theme="light"] .tt-mini-cart-qty-btn:hover {
    background: #e5e7eb !important;
}

[data-theme="light"] .tt-mini-cart-qty-input {
    color: #1f2937 !important;
}

[data-theme="light"] .tt-mini-cart-summary {
    border-top-color: #e5e7eb !important;
}

[data-theme="light"] .tt-mini-cart-label {
    color: #6b7280 !important;
}

[data-theme="light"] .tt-mini-cart-label--total {
    color: #111827 !important;
}

[data-theme="light"] .tt-mini-cart-remove-link {
    color: #9ca3af !important;
}

[data-theme="light"] .tt-mini-cart-remove-link:hover {
    color: #ef4444 !important;
}

[data-theme="light"] .woocommerce-mini-cart__empty-message {
    border-color: #d1d5db !important;
    color: #6b7280 !important;
}