/**
 * Cart Chapitre Elementor WooCommerce Widget Styles
 * High specificity & forced rules to override theme defaults
 */

/* Container & Scope Reset */
.cart-chapitre-widget-container,
.cart-chapitre-widget-container * {
    box-sizing: border-box !important;
}

.cart-chapitre-widget-container {
    width: 100% !important;
    font-family: inherit !important;
}

.cart-chapitre-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 40px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.cart-chapitre-items-col {
    flex: 1 1 58% !important;
    min-width: 320px !important;
}

.cart-chapitre-totals-col {
    flex: 1 1 35% !important;
    min-width: 300px !important;
}

/* Header Table (Left) */
.cart-chapitre-table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 12px !important;
    margin-bottom: 20px !important;
    border: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #2d3748 !important;
}

.col-header-product {
    text-align: left !important;
}

.col-header-total {
    text-align: right !important;
}

/* Product Rows */
.cart-chapitre-products-list {
    display: flex !important;
    flex-direction: column !important;
}

.cart-chapitre-product-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 0 !important;
    border: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    background: transparent !important;
}

.cart-chapitre-product-info {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex: 1 !important;
}

.cart-chapitre-product-thumb {
    width: 80px !important;
    height: 90px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 4px !important;
    background-color: #f7fafc !important;
}

.cart-chapitre-product-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cart-chapitre-product-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.cart-chapitre-product-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    line-height: 1.4 !important;
}

.cart-chapitre-product-title a {
    color: #2d3748 !important;
    text-decoration: none !important;
    background: none !important;
    box-shadow: none !important;
}

.cart-chapitre-product-title a:hover {
    color: #4a5568 !important;
}

/* Quantity Control Row */
.cart-chapitre-qty-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Quantity Box Container */
.cart-chapitre-widget-container .cart-chapitre-qty-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    background-color: #ffffff !important;
    overflow: hidden !important;
    height: 36px !important;
    width: 110px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Quantity Buttons (- and +) */
.cart-chapitre-widget-container button.cart-chapitre-qty-btn,
.cart-chapitre-widget-container .cart-chapitre-qty-btn {
    width: 34px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #718096 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

.cart-chapitre-widget-container button.cart-chapitre-qty-btn:hover,
.cart-chapitre-widget-container .cart-chapitre-qty-btn:hover {
    background-color: #edf2f7 !important;
    color: #2d3748 !important;
}

/* Quantity Input Number */
.cart-chapitre-widget-container input[type="number"].cart-chapitre-qty-input,
.cart-chapitre-widget-container input.cart-chapitre-qty-input,
.cart-chapitre-widget-container .cart-chapitre-qty-input {
    width: 42px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    display: block !important;
}

.cart-chapitre-widget-container input.cart-chapitre-qty-input::-webkit-outer-spin-button,
.cart-chapitre-widget-container input.cart-chapitre-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Remove Item Trash Button */
.cart-chapitre-widget-container button.cart-chapitre-remove-btn,
.cart-chapitre-widget-container .cart-chapitre-remove-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #e53e3e !important;
    cursor: pointer !important;
    padding: 4px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    transition: color 0.2s ease, transform 0.1s ease !important;
}

.cart-chapitre-widget-container button.cart-chapitre-remove-btn svg,
.cart-chapitre-widget-container .cart-chapitre-remove-btn svg {
    stroke: #e53e3e !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

.cart-chapitre-widget-container button.cart-chapitre-remove-btn:hover,
.cart-chapitre-widget-container .cart-chapitre-remove-btn:hover {
    background: transparent !important;
    background-color: transparent !important;
    color: #c53030 !important;
    transform: scale(1.1) !important;
}

.cart-chapitre-widget-container button.cart-chapitre-remove-btn:hover svg,
.cart-chapitre-widget-container .cart-chapitre-remove-btn:hover svg {
    stroke: #c53030 !important;
}

/* Line Total */
.cart-chapitre-product-total {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/* Cart Totals Card (Right Column) */
.cart-chapitre-totals-card {
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 !important;
    border: none !important;
}

.cart-chapitre-totals-title {
    margin: 0 !important;
    padding-bottom: 12px !important;
    border: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #2d3748 !important;
}

/* Coupon Section */
.cart-chapitre-coupon-section {
    display: flex !important;
    flex-direction: column !important;
}

.cart-chapitre-widget-container button.cart-chapitre-coupon-toggle,
.cart-chapitre-widget-container .cart-chapitre-coupon-toggle {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #718096 !important;
    cursor: pointer !important;
    text-align: left !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.cart-chapitre-coupon-toggle .chevron-icon {
    transition: transform 0.2s ease !important;
    stroke: currentColor !important;
}

.cart-chapitre-coupon-toggle.active .chevron-icon {
    transform: rotate(180deg) !important;
}

.cart-chapitre-coupon-body {
    display: block !important;
    margin-top: 10px !important;
}

.cart-chapitre-coupon-form {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cart-chapitre-widget-container input[type="text"].cart-chapitre-coupon-input,
.cart-chapitre-widget-container input.cart-chapitre-coupon-input,
.cart-chapitre-widget-container .cart-chapitre-coupon-input {
    flex: 1 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 14px !important;
    border: 1px solid #cbd5e0 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    color: #2d3748 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
}

.cart-chapitre-widget-container input.cart-chapitre-coupon-input:focus {
    border-color: #4a5568 !important;
}

.cart-chapitre-widget-container button.cart-chapitre-coupon-submit,
.cart-chapitre-widget-container .cart-chapitre-coupon-submit {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 20px !important;
    background-color: #e07a7a !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    white-space: nowrap !important;
    transition: background-color 0.2s ease !important;
}

.cart-chapitre-widget-container button.cart-chapitre-coupon-submit:hover,
.cart-chapitre-widget-container .cart-chapitre-coupon-submit:hover {
    background-color: #d66464 !important;
    color: #ffffff !important;
}

.cart-chapitre-coupon-msg {
    font-size: 13px !important;
    margin-top: 8px !important;
}

.cart-chapitre-coupon-msg.success {
    color: #38a169 !important;
}

.cart-chapitre-coupon-msg.error {
    color: #e53e3e !important;
}

/* Summary Rows */
.cart-chapitre-summary-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 14px !important;
    color: #718096 !important;
}

.shipping-label-group {
    display: flex !important;
    flex-direction: column !important;
}

.row-subtext {
    font-size: 11px !important;
    color: #a0aec0 !important;
    margin-top: 2px !important;
}

.cart-chapitre-summary-row .row-value {
    font-weight: 600 !important;
    color: #4a5568 !important;
}

/* Estimated Total Row */
.cart-chapitre-summary-row.grand-total-row {
    padding-top: 16px !important;
    border-top: 1px solid #edf2f7 !important;
    margin-top: 6px !important;
}

.cart-chapitre-grand-total-label {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
}

.cart-chapitre-grand-total {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
}

/* Actions Buttons */
.cart-chapitre-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 10px !important;
}

.cart-chapitre-widget-container a.cart-chapitre-btn-checkout,
.cart-chapitre-widget-container .cart-chapitre-btn-checkout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 48px !important;
    background-color: #2d3748 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
}

.cart-chapitre-widget-container a.cart-chapitre-btn-checkout:hover,
.cart-chapitre-widget-container .cart-chapitre-btn-checkout:hover {
    background-color: #1a202c !important;
    color: #ffffff !important;
}

.cart-chapitre-widget-container a.cart-chapitre-btn-continue,
.cart-chapitre-widget-container .cart-chapitre-btn-continue {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 48px !important;
    background-color: #f7fafc !important;
    color: #2d3748 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.cart-chapitre-widget-container a.cart-chapitre-btn-continue:hover,
.cart-chapitre-widget-container .cart-chapitre-btn-continue:hover {
    background-color: #edf2f7 !important;
    border-color: #cbd5e0 !important;
    color: #2d3748 !important;
}

/* Empty Cart State */
.cart-chapitre-empty-state {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 60px 20px !important;
    background: #ffffff !important;
    border-radius: 8px !important;
}

.cart-chapitre-empty-icon {
    font-size: 64px !important;
    color: #cbd5e0 !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cart-chapitre-empty-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin: 0 0 10px 0 !important;
}

.cart-chapitre-empty-desc {
    font-size: 15px !important;
    color: #718096 !important;
    margin: 0 0 24px 0 !important;
    max-width: 400px !important;
}

.cart-chapitre-empty-btn {
    max-width: 240px !important;
}

/* Loading state overlay */
.cart-chapitre-loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* Responsive Rules */
@media (max-width: 768px) {
    .cart-chapitre-wrapper {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .cart-chapitre-items-col,
    .cart-chapitre-totals-col {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .cart-chapitre-product-row {
        align-items: flex-start !important;
    }

    .cart-chapitre-product-total {
        margin-top: 4px !important;
    }
}
