/* Styles Frontend Huitric Panier */

:root {
    --huitric-primary-color: #8B7355;
    --huitric-secondary-color: #D4A574;
    --huitric-text-color: #333;
    --huitric-border-color: #ddd;
    --huitric-bg-color: #fafafa;
    --huitric-blackboard-bg: #1a1a1a;
    --huitric-accent: #E74C3C;
}

.huitric-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Afficher/masquer selon le device */
.huitric-mobile-view {
    display: none;
}

.huitric-desktop-view {
    display: block;
}

@media (max-width: 768px) {
    .huitric-mobile-view {
        display: block;
    }

    .huitric-desktop-view {
        display: none;
    }
}

.huitric-layout {
    display: block;
}

/* ========== COLONNE PANIERS ========== */
.huitric-baskets-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ========== EN-TÊTES DES PANIERS ========== */
.huitric-baskets-headers {
    display: grid;
    grid-template-columns: 80px repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 20px;
}

.huitric-basket-header-box {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.basket-icon {
    display: block;
    margin: 0 auto 10px;
    color: #5a8a3c;
}

/* Icône panier — taille uniforme */
.basket-icon svg {
    display: block;
    margin: 0 auto;
    width: 50px;
    height: 50px;
    stroke-width: 1.5;
}

.basket-name {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: #3d2b1a;
    font-style: italic;
    letter-spacing: 0.5px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.basket-price {
    margin: 0;
    font-size: 28px;
    font-weight: 400;
    color: #FF6B6B;
    font-style: italic;
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* ========== CONTENU DES PANIERS ========== */
.huitric-baskets-products {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

/* Ligne produit : image + 3 colonnes paniers */
.huitric-product-row {
    display: grid;
    grid-template-columns: 80px repeat(3, 1fr);
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.huitric-product-row:first-child {
    padding-top: 0;
}

.huitric-product-row:last-of-type {
    border-bottom: none;
}

/* Cellule image dans la ligne produit (desktop) */
.huitric-product-image-cell {
    width: 80px;
    text-align: center;
}

.huitric-product-image-cell img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 80px;
}

.huitric-product-cell {
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

.huitric-product-cell.not-in-basket {
    opacity: 0;
    visibility: hidden;
}

.huitric-product-cell.in-basket {
    opacity: 1;
    visibility: visible;
}

.product-name {
    display: block;
    font-weight: 600;
    color: #565b5c;
    font-size: 1.3em;
    line-height: 1.4;
    margin-bottom: 5px;
    font-style: italic;
}

.product-value {
    display: block;
    color: #8cae57;
    font-size: 1.3em;
    font-weight: 600;
}

/* ========== PIED DE PAGE DES PANIERS ========== */
.huitric-baskets-footer {
    display: grid;
    grid-template-columns: 80px repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    align-items: center;
}

.huitric-basket-footer-cell {
    display: flex;
    justify-content: center;
}

.huitric-commander-btn {
    width: 100%;
    max-width: 180px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #8B7355, #A0826D);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.huitric-commander-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #7A6347, #90735D);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.huitric-commander-btn:active:not(.disabled) {
    transform: translateY(0);
}

.huitric-commander-btn.disabled,
.huitric-commander-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.huitric-commander-btn:disabled:hover {
    box-shadow: none;
}

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 1024px) {
    .huitric-baskets-headers,
    .huitric-baskets-footer {
        grid-template-columns: 80px repeat(2, 1fr) !important;
    }

    .huitric-product-row {
        grid-template-columns: 80px repeat(2, 1fr) !important;
    }

    .basket-name {
        font-size: 18px;
    }

    .basket-price {
        font-size: 24px;
    }

    .product-name {
        font-size: 1.1em;
    }

    .product-value {
        font-size: 1.1em;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .huitric-container {
        padding: 20px 10px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .huitric-mobile-view {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .huitric-baskets-column {
        display: block;
        width: 100%;
    }

    .huitric-baskets-headers {
        display: none;
    }

    .huitric-baskets-products {
        display: none;
    }

    .huitric-baskets-footer {
        display: none;
    }

    /* Layout mobile : un panier par section */
    .huitric-basket-section {
        margin-bottom: 40px;
        width: 100%;
        max-width: 100%;
    }

    .huitric-basket-section:last-child {
        margin-bottom: 0;
    }

    .huitric-basket-products-list {
        width: 100%;
        max-width: 100%;
    }

    .huitric-basket-header-box {
        padding: 15px;
        border-width: 6px;
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .basket-name {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .basket-price {
        font-size: 24px;
    }

    /* Ligne produit mobile : Image 30% + Contenu 70% */
    .huitric-product-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 15px 0;
        border-bottom: 1px solid #e0e0e0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .huitric-product-row:first-child {
        padding-top: 0;
    }

    .huitric-product-row:last-child {
        border-bottom: none;
    }

    .huitric-product-row-image {
        flex: 0 0 30%;
        max-width: 30%;
        box-sizing: border-box;
    }

    .huitric-product-row-image img {
        width: 100%;
        height: auto;
        border-radius: 4px;
        display: block;
    }

    .huitric-product-cell {
        flex: 1 1 auto;
        max-width: calc(70% - 10px);
        text-align: left;
        min-height: auto;
        padding: 0;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .product-name {
        font-size: 1.1em;
        text-align: left;
        margin-bottom: 5px;
        display: block;
        word-wrap: break-word;
    }

    .product-value {
        font-size: 1.1em;
        text-align: left;
        display: block;
        word-wrap: break-word;
    }

    .huitric-basket-footer-btn {
        width: 100%;
        margin-top: 20px;
        box-sizing: border-box;
    }

    .huitric-commander-btn {
        width: 100%;
        max-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        box-sizing: border-box;
        display: block;
    }
}

/* Petit mobile */
@media (max-width: 480px) {
    .huitric-container {
        padding: 15px 10px;
    }

    .huitric-basket-header-box {
        padding: 12px;
        border-width: 4px;
        border-radius: 8px;
    }

    .basket-name {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .basket-price {
        font-size: 20px;
    }

    .product-name {
        font-size: 1em;
    }

    .product-value {
        font-size: 1em;
    }

    .huitric-commander-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.huitric-basket-header-box {
    animation: fadeIn 0.4s ease-out;
}

.huitric-product-cell.in-basket {
    animation: fadeIn 0.3s ease-out;
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    .huitric-product-row {
        border-bottom-color: #444;
    }

    .huitric-product-row:last-of-type {
        border-bottom: none;
    }

    .product-value {
        color: #81C784;
    }

    .huitric-baskets-footer {
        border-top-color: #444;
    }
}
