/**
 * MODULE BOUTIQUE - STYLES PERSONNALISÉS
 * Intégration avec le système de design moderne
 * Version: 1.0
 */

/* ============================================================
   VARIABLES ET TOKENS
   ============================================================ */
:root {
    /* Couleurs spécifiques au module boutique */
    --shop-primary: #28a745;
    --shop-primary-dark: #1e7e34;
    --shop-secondary: #17a2b8;
    --shop-warning: #ffc107;
    --shop-danger: #dc3545;
    --shop-success: #28a745;
    --shop-info: #17a2b8;

    /* Couleurs d'état du stock */
    --stock-ok: #28a745;
    --stock-warning: #ffc107;
    --stock-danger: #dc3545;

    /* Espacements */
    --shop-spacing-sm: 0.5rem;
    --shop-spacing-md: 1rem;
    --shop-spacing-lg: 1.5rem;

    /* Bordures */
    --shop-radius: 8px;
    --shop-border-color: #dee2e6;
}

/* ============================================================
   WIDGETS STATISTIQUES (Small Boxes)
   ============================================================ */
.small-box {
    border-radius: var(--shop-radius);
    position: relative;
    display: block;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.small-box > .inner {
    padding: 20px;
}

.small-box > .inner h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    white-space: nowrap;
    padding: 0;
}

.small-box > .inner p {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

.small-box .icon {
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 0;
    font-size: 70px;
    color: rgba(0, 0, 0, 0.1);
}

.small-box:hover .icon {
    font-size: 80px;
}

.small-box .small-box-footer {
    position: relative;
    text-align: center;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    z-index: 10;
    background: rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border-bottom-left-radius: var(--shop-radius);
    border-bottom-right-radius: var(--shop-radius);
    transition: all 0.3s ease;
    font-weight: 500;
}

.small-box .small-box-footer:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
}

/* Couleurs des widgets */
.small-box.bg-success {
    background: linear-gradient(135deg, var(--shop-success) 0%, #20c997 100%);
    color: #fff;
}

.small-box.bg-info {
    background: linear-gradient(135deg, var(--shop-info) 0%, #138496 100%);
    color: #fff;
}

.small-box.bg-warning {
    background: linear-gradient(135deg, var(--shop-warning) 0%, #ff9800 100%);
    color: #212529;
}

.small-box.bg-danger {
    background: linear-gradient(135deg, var(--shop-danger) 0%, #c82333 100%);
    color: #fff;
}

.small-box.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
}

/* ============================================================
   BADGES D'ÉTAT DU STOCK
   ============================================================ */
.badge-stock-ok {
    background-color: var(--stock-ok);
    color: white;
    padding: 0.35em 0.65em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.badge-stock-alerte {
    background-color: var(--stock-warning);
    color: #212529;
    padding: 0.35em 0.65em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.badge-stock-rupture {
    background-color: var(--stock-danger);
    color: white;
    padding: 0.35em 0.65em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================================
   CARTES ARTICLES
   ============================================================ */
.shop-article-card {
    border-radius: var(--shop-radius);
    transition: all 0.3s ease;
    border: 1px solid var(--shop-border-color);
    overflow: hidden;
}

.shop-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.shop-article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f8f9fa;
}

.shop-article-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #adb5bd;
    font-size: 3rem;
}

.shop-article-details {
    padding: 1rem;
}

.shop-article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.shop-article-ref {
    font-size: 0.875rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.shop-article-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-success);
    margin: 0.5rem 0;
}

/* ============================================================
   TABLES AMÉLIORÉES
   ============================================================ */
.shop-table {
    border-radius: var(--shop-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shop-table thead {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
}

.shop-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.shop-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e9ecef;
}

.shop-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.shop-table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.shop-table tbody td.text-end {
    font-weight: 600;
}

/* ============================================================
   ALERTES DE STOCK
   ============================================================ */
.shop-alert-stock {
    border-left: 4px solid var(--stock-danger);
    background-color: #fff5f5;
    padding: 1rem;
    border-radius: var(--shop-radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.shop-alert-stock:hover {
    background-color: #ffe5e5;
    transform: translateX(4px);
}

.shop-alert-stock.warning {
    border-left-color: var(--stock-warning);
    background-color: #fffbf0;
}

.shop-alert-stock.warning:hover {
    background-color: #fff8e1;
}

/* ============================================================
   FORMULAIRES DE VENTE
   ============================================================ */
.shop-form-vente {
    background: white;
    border-radius: var(--shop-radius);
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.shop-form-group {
    margin-bottom: 1.5rem;
}

.shop-form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.shop-form-control {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.shop-form-control:focus {
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.shop-form-control.is-invalid {
    border-color: var(--shop-danger);
}

.shop-form-control.is-valid {
    border-color: var(--shop-success);
}

/* ============================================================
   BOUTONS MODULE BOUTIQUE
   ============================================================ */
.btn-shop-primary {
    background: linear-gradient(135deg, var(--shop-primary) 0%, var(--shop-primary-dark) 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-shop-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
}

.btn-shop-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-shop-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    color: white;
}

.btn-shop-danger {
    background: linear-gradient(135deg, var(--shop-danger) 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-shop-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
}

/* ============================================================
   ACTIONS RAPIDES
   ============================================================ */
.shop-quick-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.shop-quick-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================================
   RÉCAPITULATIFS DE VENTE
   ============================================================ */
.shop-sale-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--shop-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.shop-sale-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.shop-sale-summary-item:last-child {
    border-bottom: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--shop-success);
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--shop-success);
}

/* ============================================================
   MOUVEMENTS DE STOCK
   ============================================================ */
.shop-mouvement-entree {
    border-left: 4px solid var(--shop-success);
}

.shop-mouvement-sortie {
    border-left: 4px solid var(--shop-danger);
}

.shop-mouvement-ajustement {
    border-left: 4px solid var(--shop-warning);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .small-box > .inner h3 {
        font-size: 1.8rem;
    }

    .small-box .icon {
        font-size: 50px;
    }

    .shop-article-card {
        margin-bottom: 1rem;
    }

    .shop-quick-actions {
        flex-direction: column;
    }

    .shop-quick-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   ANIMATIONS D'ENTRÉE
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shop-fade-in {
    animation: fadeInUp 0.5s ease-out;
}

/* ============================================================
   CATÉGORIES
   ============================================================ */
.shop-category-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.shop-category-card {
    border: 2px solid #e9ecef;
    border-radius: var(--shop-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.shop-category-card:hover {
    border-color: var(--shop-primary);
    background-color: #f8f9fa;
}

/* ============================================================
   MODES DE PAIEMENT
   ============================================================ */
.shop-payment-badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.shop-payment-badge.especes {
    background-color: #28a745;
    color: white;
}

.shop-payment-badge.mobile_money {
    background-color: #17a2b8;
    color: white;
}

.shop-payment-badge.carte {
    background-color: #6f42c1;
    color: white;
}

.shop-payment-badge.virement {
    background-color: #fd7e14;
    color: white;
}

.shop-payment-badge.autre {
    background-color: #6c757d;
    color: white;
}

/* ============================================================
   LOADER / SPINNER
   ============================================================ */
.shop-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--shop-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.shop-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.shop-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.shop-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.shop-empty-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}
