@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    color: #000;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    display: flex;
    margin-top: 80px;
    overflow: hidden;
}

.filtres-container {
    position: sticky;
    top: 0;
    align-self: start;
    background-color: #fff;
    font-size: 0.8rem;
    width: 220px;
    padding-left: 10px;
    padding-right: 5px;
}

.filtres-types, .filtres-groupes {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.genres-header {
    background-color: #fff;
    margin-bottom: 10px;
}

.genres-header h3 {
    margin: 0 0 5px 0;
    font-size: 0.8rem;
    color: #000;
}

.genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.genres-list a {
    padding: 8px 12px;
    background-color: #fff;
    border-radius: 4px;
    text-decoration: none;
    color: #000;
    font-size: 0.8rem;
    transition: all 0.3s;
    display: inline-block;
}

.genres-list a:hover {
    background-color: #e0e0e0;
}

.genres-list a.active {
    background-color: #000;
    color: #fff;
}

.filtres-types {
    padding: 10px;
}

.filtres-groupes {
    border-top: 1px solid #ddd;
    background-color: #fff;
}

.filtres-groupes h3 {
    margin-top: 5px;
    color: #000;
    font-size: 0.875rem;
}

.filtres-types a, .filtres-groupes a {
    text-decoration: none;
    color: #000;
    text-align: left;
}

.filtres-types a:hover, .filtres-groupes a:hover {
    text-decoration: underline;
}

.filtres-avances {
    margin-top: 10px;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.filtres-avances h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #000;
}

.filtres-avances h4 {
    font-size: 0.8rem;
    margin: 10px 0 5px 0;
    color: #000;
}

.filtre-prix, .filtre-notes {
    margin-bottom: 15px;
}

.filtre-section {
    margin-bottom: 15px;
}

.filtre-options {
    display: flex;
    flex-wrap: wrap;
    margin-top: 5px;
    gap: 8px;
}

.filtre-option {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #000;
    transition: all 0.3s;
    background-color: #fff;
    font-weight: bold;
    gap: 5px;
}

.filtre-option:hover {
    background-color: #f5f5f5;
}

.filtre-option.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.couleur-options {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.couleur-options.active {
    border-color: #f1c40f;
    transform: scale(1.1);
}

.prix-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #fff;
}

.prix-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prix-inputs input {
    width: 86px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #000;
}

.prix-inputs span {
    font-size: 0.8rem;
    color: #000;
}

.prix-form button {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s;
}

.prix-form button:active {
    background-color: #1a252f;
}

.note-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: #fff;
}

.note-options a {
    color: #000;
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.note-options a.active {
    font-weight: bold;
    color: #e74c3c;
}

.note-options i {
    color: #f1c40f;
}

.rating-display i {
    color: #f1c40f;
    font-size: 0.8rem;
}

.rating-display .far.fa-star {
    color: #ddd;
}

.produits-main-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 20px;
}

.produits-container {
    margin-left: 0;
    flex: 1;
    background-color: #fff;
}

.produits-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    background-color: #fff;
}

.produit-card {
    background: #fff;
    border-radius: 4px;
    padding: 5px;
    width: 210px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.produit-card img {
    position: relative;
    max-width: 100%;
    width: 100%;
    height: 200px;
    border-bottom: 1px solid #ddd;
}

.image-container {
    position: relative;
    display: inline-block;
}

.discount-badge {
    position: absolute;
    background: #151335;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 5px;
    top: 0;
    right: 0;
    z-index: 10;
}

.produit-card:hover img {
    transform: scale(1.05);
}

.produit-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.produit-card p {
    font-size: 0.8rem;
    color: #000;
    padding-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-display {
    font-size: 0.8rem;
    color: #f1c40f;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.note-text {
    font-size: 0.75rem;
    color: #000;
    padding-left: 5px;
    display: flex;
    align-items: center;
}

.prix-ajouter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
}

.current-price {
    color: #000;
    font-size: 0.95rem;
    font-weight: bold;
}

.normal-price {
    color: #000;
    font-size: 0.95rem;
    font-weight: bold;
}

.icone-produit {
    text-decoration: none;
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 50%;
    color: #000;
    background: whitesmoke;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 3px;
    cursor: pointer;
}

.icone-produit:hover {
    background-color: #151335;
    color: #ffffff;
}

.icone-produit::before,
.icone-produit::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24);
}

.icone-produit::before {
    content: '';
    top: -0.0625rem;
    border: 0.5rem solid transparent;
    border-top-color: #151335;
}

.icone-produit::after {
    content: attr(aria-label);
    bottom: 100%;
    background-color: #151335;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    color: #fff;
}

.icone-produit:hover::before,
.icone-produit:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-0.5rem);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px 0;
    grid-column: 1 / -1;
    font-size: 0.8rem;
}

.pagination button {
    padding: 8px 16px;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background-color: #ddd;
}

.pagination button:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-numbers {
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-count {
    transition: transform 0.3s ease;
    display: inline-block;
}

.cart-count.pulse {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes flyToCart {
    0% { transform: scale(1) translate(0, 0); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: scale(0.3) translate(var(--end-x), var(--end-y)); opacity: 0; }
}

.flying-item {
    position: fixed;
    width: 30px;
    height: 30px;
    background-color: #f1c40f;
    color: #151335;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    animation: flyToCart 0.8s cubic-bezier(0.42, 0, 0.58, 1) forwards;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.empty-products-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    margin-top: 200px;
}

.empty-products-container i {
    font-size: 5rem;
    color: #f1c40f;
    margin-bottom: 10px;
}

.aucun-produit {
    font-size: 0.9rem;
    color: #000;
    margin-top: 10px;
}

.flash-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ff4757;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
}

.time-remaining {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #e0e0e0;
    z-index: 10;
}

.time-progress {
    height: 100%;
    background-color: #ff4757;
    width: 100%;
    transition: width 1s linear;
}

.flash-price-display {
    display: flex;
    align-items: center;
    gap: 5px;
}

.flash-price {
    color: #ff4757;
    font-weight: bold;
}

.original-price-flash {
    text-decoration: line-through;
    color: #777;
    font-size: 0.8rem;
}

.flash-alert {
    background-color: #ff4757;
    color: white;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-align: center;
    animation: pulse 1s infinite;
    margin-top: 5px;
}

.variantes-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    min-height: 200px;
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.taille-option, .couleur-option {
    display: inline-block;
    margin: 5px;
    padding: 10px;
    border: 2px solid #ddd;
    cursor: pointer;
    font-weight: bold;
    background-color: #fff;
    border-radius: 5px;
}

.taille-option.active, .couleur-option.active {
    border-color: #f1c40f;
}

.couleur-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.btn-ajouter {
    border-radius: 5px;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    color: #fff;
    background-color: #151335;
}

.btn-annuler {
    border-radius: 5px;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    color: #000;
    background-color: #f1c40f;
}

.logistics-info {
    display: none;
}

.taille-option.out-of-stock,
.couleur-option.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.stock-label {
    font-size: 0.7em;
    color: #ff4444;
    display: block;
}

.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    border-radius: 5px;
}

@media (max-width: 480px) {
    * { font-family: 'Poppins', sans-serif; }
    body { background-color: #fff; }
    .container { margin-top: 10px; }
    .filtres-container { display: none; }
    .produits-main-container { margin-left: 0; }
    .produits-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 5px; padding: 5px; }
    .produit-card { width: 174px; }
    .produit-card img { width: 160px; height: 160px; }
    .discount-badge { font-size: 0.7rem; }
    .produit-card p { font-size: 0.75rem; padding-top: 0; }
    .rating-display { font-size: 0.75rem; }
    .note-text { font-size: 0.7rem; }
    .current-price, .normal-price { font-size: 0.85rem; }
    .icone-produit { width: 1.8rem; height: 1.8rem; font-size: 0.8rem; }
    .empty-products-container i { font-size: 3rem; }
    .aucun-produit { font-size: 0.8rem; }
    .modal-content h3 { font-size: 1rem; }
    .btn-ajouter, .btn-annuler { font-size: 0.85rem; }
}

@media (min-width: 481px) and (max-width: 900px) {
    * { font-family: 'Poppins', sans-serif; }
    body { background-color: #fff; }
    .container { margin-top: 10px; }
    .filtres-container { display: none; }
    .produits-main-container { margin-left: 0; }
    .produits-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 5px; padding: 10px; padding-top: 5px; }
    .produit-card { width: 180px; }
    .produit-card img { width: 180px; height: 180px; }
    .discount-badge { font-size: 0.75rem; }
    .produit-card p { font-size: 0.75rem; padding-top: 0; }
    .rating-display { font-size: 0.75rem; }
    .note-text { font-size: 0.75rem; }
    .current-price, .normal-price { font-size: 0.85rem; }
    .icone-produit { width: 2rem; height: 2rem; font-size: 0.9rem; }
    .empty-products-container i { font-size: 4rem; }
    .aucun-produit { font-size: 0.85rem; }
    .modal-content h3 { font-size: 1rem; }
    .btn-ajouter, .btn-annuler { font-size: 0.85rem; }
}
