/* WooCommerce Quotes for Woodmart - Frontend Styles */

/* Page de devis */
.wcq-quote-page {
    padding: 20px 0;
}

.wcq-page-title {
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 700;
}

/* Bouton créer un devis sur la page panier */
.wcq-create-quote-button {
    margin-left: 10px;
    background-color: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

.wcq-create-quote-button:hover {
    background-color: #e0e0e0 !important;
}

/* Détails de variations */
.wcq-variation-details {
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.wcq-variation-details small {
    display: block;
    line-height: 1.4;
}

/* Options du devis */
.wcq-quote-options {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.wcq-quote-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.wcq-quote-options input[type="number"] {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.wcq-quote-options .description {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Actions du devis */
.wcq-quote-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.wcq-quote-actions .button {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

/* Espace client - Liste des devis */
.wcq-customer-quotes {
    padding: 20px 0;
}

.wcq-customer-quotes h2 {
    margin-bottom: 20px;
}

/* Statuts des devis */
.wcq-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcq-status-pending {
    background: #f0ad4e;
    color: #fff;
}

.wcq-status-accepted {
    background: #5cb85c;
    color: #fff;
}

.wcq-status-rejected {
    background: #d9534f;
    color: #fff;
}

.wcq-status-expired {
    background: #999;
    color: #fff;
}

/* Date expirée */
.wcq-expired {
    color: #d9534f !important;
    font-weight: 600;
}

/* Devis unique */
.wcq-single-quote {
    padding: 20px 0;
}

.wcq-back-link {
    margin-bottom: 20px;
}

.wcq-back-link a {
    color: #666;
    text-decoration: none;
}

.wcq-back-link a:hover {
    color: #333;
}

.wcq-quote-header {
    margin: 20px 0 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.wcq-quote-info table {
    margin: 0;
}

.wcq-quote-info th {
    width: 150px;
    font-weight: 600;
    padding: 8px 15px 8px 0;
}

.wcq-quote-info td {
    padding: 8px 0;
}

/* Produit dans le devis */
.wcq-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wcq-product-thumbnail {
    flex-shrink: 0;
    width: 60px;
}

.wcq-product-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.wcq-product-details {
    flex: 1;
}

/* Actions du devis unique */
.wcq-single-quote .wcq-quote-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Loading state */
.wcq-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wcq-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wcq-spin 0.6s linear infinite;
}

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

/* Notifications */
.wcq-notice {
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid;
    border-radius: 3px;
}

.wcq-notice-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.wcq-notice-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.wcq-notice-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Responsive */
@media (max-width: 768px) {
    .wcq-quote-actions {
        flex-direction: column;
    }
    
    .wcq-quote-actions .button {
        width: 100%;
        min-width: 0;
    }
    
    .wcq-product-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wcq-product-thumbnail {
        width: 80px;
    }
    
    .wcq-create-quote-button {
        margin: 10px 0 0 0;
        display: block;
        width: 100%;
    }
}

/* Compatibilité Woodmart */
.woodmart-theme .wcq-quote-page .button,
.woodmart-theme .wcq-customer-quotes .button {
    transition: all 0.3s ease;
}

.woodmart-theme .wcq-status {
    border-radius: 50px;
}

.woodmart-theme .shop_table.woocommerce-cart-table {
    border: 1px solid #e0e0e0;
}

.woodmart-theme .cart_totals {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* ===== Édition de devis ===== */

/* Notice d'édition */
.wcq-edit-notice {
    background: #e7f7ff;
    border-left: 4px solid #00a0d2;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 3px;
}

/* Tableau éditable */
.wcq-quote-items-table .wcq-product-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.wcq-product-sku {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.wcq-variation-details.variation {
    margin-top: 10px;
    font-size: 0.9em;
}

.wcq-variation-details dt {
    font-weight: 600;
    float: left;
    clear: left;
    margin-right: 5px;
}

.wcq-variation-details dd {
    margin-left: 0;
    margin-bottom: 5px;
}

.wcq-product-dimensions,
.wcq-product-weight {
    font-size: 0.85em;
    color: #777;
    margin-top: 5px;
}

/* Champs de quantité éditables */
.wcq-quantity-input {
    width: 80px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wcq-quantity-input:focus {
    border-color: #00a0d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 160, 210, 0.1);
}

/* Bouton de suppression d'article */
.product-remove {
    text-align: center;
    width: 50px;
}

.wcq-remove-item {
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wcq-remove-item:hover {
    background: #a00;
}

.wcq-remove-item .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

/* Article marqué pour suppression */
.wcq-item-removed {
    opacity: 0.4;
    position: relative;
    text-decoration: line-through;
}

.wcq-item-removed .wcq-product-info {
    filter: grayscale(100%);
}

/* Actions du formulaire de mise à jour */
.wcq-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.wcq-update-quote-btn {
    background: #00a0d2;
    color: #fff !important;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.wcq-update-quote-btn:hover {
    background: #0087be;
}

.wcq-update-quote-btn:active {
    background: #006fa0;
}

/* Highlight du total qui change */
.wcq-item-total,
.wcq-grand-total {
    transition: color 0.3s;
}

.wcq-item-total.wcq-updating,
.wcq-grand-total.wcq-updating {
    color: #00a0d2;
    font-weight: 700;
}

/* Mobile responsive pour l'édition */
@media (max-width: 768px) {
    .wcq-quantity-input {
        width: 60px;
        font-size: 13px;
        padding: 6px;
    }
    
    .wcq-actions {
        text-align: center;
    }
    
    .wcq-update-quote-btn {
        width: 100%;
    }
    
    .product-remove {
        width: auto;
    }
    
    .wcq-remove-item {
        padding: 6px 10px;
    }
}

/* ===== Style Woodmart pour devis ===== */

/* Quantités en lecture seule */
.wcq-quantity-readonly {
    font-size: 14px;
    margin-top: 8px;
}

.wcq-quantity-readonly strong {
    color: #666;
    font-weight: 600;
    margin-right: 5px;
}

/* Style Woodmart pour les quantités */
.wcq-quote-items-table .quantity {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wcq-quote-items-table .quantity .btn {
    background: #f5f5f5;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    color: #333;
}

.wcq-quote-items-table .quantity .btn:hover {
    background: #e0e0e0;
}

.wcq-quote-items-table .quantity .wcq-quantity-input {
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    width: 60px;
    text-align: center;
    padding: 8px 5px;
    margin: 0;
    border-radius: 0;
}

.wcq-quote-items-table .quantity .wcq-quantity-input:focus {
    border-color: #ddd;
    box-shadow: none;
}

/* Bouton de suppression style Woodmart */
.wd-checkout-remove-btn-wrapp {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.wcq-remove-item.wd-checkout-remove-btn {
    display: block;
    width: 24px;
    height: 24px;
    background: #dc3232;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.wcq-remove-item.wd-checkout-remove-btn:hover {
    background: #a00;
    transform: rotate(90deg);
}

.wcq-remove-item.wd-checkout-remove-btn::before,
.wcq-remove-item.wd-checkout-remove-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
}

.wcq-remove-item.wd-checkout-remove-btn::before {
    width: 12px;
    height: 2px;
}

.wcq-remove-item.wd-checkout-remove-btn::after {
    width: 2px;
    height: 12px;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Structure produit style Woodmart */
.wcq-quote-items-table .wd-checkout-prod {
    position: relative;
    display: flex;
    gap: 15px;
    padding: 20px;
}

.wcq-quote-items-table .wd-checkout-prod-img {
    flex-shrink: 0;
    width: 80px;
}

.wcq-quote-items-table .wd-checkout-prod-img img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.wcq-quote-items-table .wd-checkout-prod-cont {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcq-quote-items-table .wd-checkout-prod-title {
    flex: 1;
}

.wcq-quote-items-table .cart-product-label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.wcq-quote-items-table .wd-product-sku {
    margin-top: 5px;
    font-size: 13px;
    color: #999;
}

.wcq-quote-items-table .wd-product-sku .wd-label {
    font-weight: 600;
    margin-right: 5px;
}

/* Variations style Woodmart */
.wcq-quote-items-table .variation {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.wcq-quote-items-table .variation li {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.wcq-quote-items-table .variation .item-variation-name {
    font-weight: 600;
    margin-right: 5px;
}

.wcq-quote-items-table .variation .item-variation-value {
    color: #333;
}

/* Total produit style Woodmart */
.wcq-quote-items-table .wd-checkout-prod-total {
    text-align: right;
    font-weight: 600;
    font-size: 16px;
}

/* Ligne supprimée */
.wcq-quote-items-table tr.wcq-item-removed {
    opacity: 0.4;
}

.wcq-quote-items-table tr.wcq-item-removed .wd-checkout-prod-img {
    filter: grayscale(100%);
}

/* Actions du formulaire */
.wcq-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.wcq-update-quote-btn {
    background: #83b735;
    color: #fff !important;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcq-update-quote-btn:hover {
    background: #6fa329;
}

/* Mobile responsive Woodmart */
@media (max-width: 768px) {
    .wcq-quote-items-table .wd-checkout-prod {
        flex-direction: column;
        padding: 15px;
    }
    
    .wcq-quote-items-table .wd-checkout-prod-img {
        width: 100%;
        max-width: 150px;
    }
    
    .wcq-quote-items-table .wd-checkout-prod-total {
        text-align: left;
        margin-top: 10px;
    }
    
    .wcq-quote-items-table .quantity {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Pastille de notification des devis non lus ===== */
.wcq-unread-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 5px;
    background: #d9534f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    vertical-align: middle;
}

/* Pastille dans le menu WooCommerce */
.woocommerce-MyAccount-navigation .wcq-unread-badge {
    margin-left: 8px;
}

/* Style Woodmart pour la pastille */
.woodmart-theme .wcq-unread-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #d9534f 100%);
    box-shadow: 0 2px 4px rgba(217, 83, 79, 0.3);
}
