/**
 * ADW Best Sellers - Frontend Styles
 * BlackMarket Design System
 * 
 * @author    ADW
 * @copyright 2025 ADW
 */

/* ============================================
   CSS Variables - BlackMarket Theme
   ============================================ */
:root {
    /* Colors */
    --adw-primary: #E6254F;
    --adw-primary-dark: #c41d3f;
    --adw-primary-light: #ff4d75;
    --adw-secondary: #4A4745;
    --adw-secondary-light: #6b6663;
    --adw-accent: #E3D8B0;
    --adw-accent-dark: #d4c591;
    
    /* Neutrals */
    --adw-black: #1a1a1a;
    --adw-gray-900: #2d2d2d;
    --adw-gray-800: #3d3d3d;
    --adw-gray-700: #4d4d4d;
    --adw-gray-600: #666666;
    --adw-gray-500: #808080;
    --adw-gray-400: #999999;
    --adw-gray-300: #cccccc;
    --adw-gray-200: #e6e6e6;
    --adw-gray-100: #f5f5f5;
    --adw-white: #ffffff;
    
    /* Spacing */
    --adw-space-xs: 0.5rem;
    --adw-space-sm: 0.75rem;
    --adw-space-md: 1rem;
    --adw-space-lg: 1.5rem;
    --adw-space-xl: 2rem;
    --adw-space-2xl: 3rem;
    --adw-space-3xl: 4rem;
    
    /* Typography */
    --adw-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --adw-font-size-xs: 0.75rem;
    --adw-font-size-sm: 0.875rem;
    --adw-font-size-base: 1rem;
    --adw-font-size-lg: 1.125rem;
    --adw-font-size-xl: 1.25rem;
    --adw-font-size-2xl: 1.5rem;
    --adw-font-size-3xl: 2rem;
    
    /* Borders */
    --adw-border-radius-sm: 0.375rem;
    --adw-border-radius-md: 0.5rem;
    --adw-border-radius-lg: 0.75rem;
    --adw-border-radius-xl: 1rem;
    
    /* Shadows */
    --adw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --adw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --adw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --adw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --adw-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --adw-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --adw-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Container Principal
   ============================================ */
.adw-bestsellers-container {
    width: 100%;
    padding: var(--adw-space-2xl) 0;
    background: var(--adw-white);
}

.adw-bestsellers-wrapper {
    max-width: var(--adw-container-max-width);
    margin: 0 auto;
    padding: 0 var(--adw-space-lg);
    overflow: hidden;
}

/* ============================================
   En-tête Section
   ============================================ */
.adw-bestsellers-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--adw-space-xl);
    padding-bottom: var(--adw-space-lg);
    border-bottom: 1px solid var(--adw-border-light);
    flex-direction: column;
}

.adw-bestsellers-title {
    font-size: var(--adw-font-2xl);
    font-weight: var(--adw-font-bold);
    color: var(--adw-text-dark);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em
}

.adw-bestsellers-subtitle {
    font-size: var(--adw-font-size-lg);
    color: var(--adw-gray-600);
    margin: 0;
    font-weight: 400;
}

/* ============================================
   Layout Content - Grid avec Encart Fixe
   ============================================ */
.adw-bestsellers-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--adw-space-2xl);
    align-items: start;
    /* overflow: hidden; */
}

/* Desktop - Encart fixe à gauche, carousel à droite */
@media (min-width: 1024px) {
    .adw-bestsellers-content {
        grid-template-columns: 320px 1fr;
    }
}

@media (min-width: 1280px) {
    .adw-bestsellers-content {
        grid-template-columns: 380px 1fr;
    }
}

/* ============================================
   Encart Fixe (Featured Product)
   ============================================ */
.adw-bestsellers-featured {
    position: sticky;
    top: var(--adw-space-2xl);
    display: none;
}

/* Visible uniquement sur desktop */
@media (min-width: 1024px) {
    .adw-bestsellers-featured {
        display: block;
        z-index: 999;
    }
}

.adw-featured-card {
    background: var(--adw-gray-100);
    border-radius: var(--adw-border-radius-sm);
    overflow: hidden;
    box-shadow: var(--adw-shadow-lg);
    transition: all var(--adw-transition-base);
    border: 2px solid transparent;
}

.adw-featured-card:hover {
    border-color: var(--adw-primary);
    box-shadow: var(--adw-shadow-xl);
    transform: translateY(-4px);
}

.adw-featured-badge {
    display: flex;
    align-items: center;
    gap: var(--adw-space-xs);
    padding: var(--adw-space-sm) var(--adw-space-md);
    background: linear-gradient(135deg, var(--adw-primary) 0%, var(--adw-primary-dark) 100%);
    color: var(--adw-white);
    font-size: var(--adw-font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.adw-badge-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.adw-featured-image {
    position: relative;
    width: 100%;
    /* padding-bottom: 100%; */
    background: var(--adw-white);
    overflow: hidden;
}

.adw-featured-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--adw-transition-slow);
}

.adw-featured-card:hover .adw-featured-image img {
    transform: scale(1.08);
}

.adw-featured-info {
    padding: var(--adw-space-xl);
    position: absolute;
    z-index: 99;
    top: 7rem;
    background: rgb(255 255 255 / 69%);
}

.adw-featured-name {
    font-size: var(--adw-font-size-xl);
    font-weight: 700;
    margin: 0 0 var(--adw-space-md) 0;
    line-height: 1.3;
    height: 3rem;
}

.adw-featured-name a {
    color: var(--adw-black);
    text-decoration: none;
    transition: color var(--adw-transition-fast);
}

.adw-featured-name a:hover {
    color: var(--adw-primary);
}

.adw-featured-description {
    font-size: var(--adw-font-size-sm);
    color: var(--adw-gray-600);
    line-height: 1.6;
    margin-bottom: var(--adw-space-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.adw-featured-price {
    display: flex;
    align-items: center;
    gap: var(--adw-space-sm);
    margin-bottom: var(--adw-space-lg);
}

.adw-price-regular {
    font-size: var(--adw-font-size-sm);
    color: var(--adw-gray-500);
    text-decoration: line-through;
}

.adw-price-special,
.adw-price-current {
    font-size: var(--adw-font-size-2xl);
    font-weight: 700;
    color: var(--adw-primary);
}

.adw-featured-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--adw-space-xs);
    padding: var(--adw-space-md) var(--adw-space-xl);
    background: var(--adw-black);
    color: var(--adw-white);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--adw-font-size-base);
    border-radius: var(--adw-buttons-radius-small);
    transition: all var(--adw-transition-base);
    width: 100%;
    justify-content: center;
}

.adw-featured-cta:hover {
    background: var(--adw-primary);
    color: var(--adw-white) !important;
    transform: translateX(4px);
}

.adw-cta-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--adw-transition-fast);
}

.adw-featured-cta:hover .adw-cta-arrow {
    transform: translateX(4px);
}

/* ============================================
   Carousel de Produits
   ============================================ */
.adw-bestsellers-carousel {
    width: 100%;
    position: relative;
    /* overflow: hidden; */
}

/* Ajustement quand il y a un featured product */
.adw-bestsellers-carousel.adw-with-featured {
    grid-column: 1;
    width: 100%;
    max-width: 100%;  /* S'adapte au grid */
    min-width: 0;     /* Critique pour grid ! */
}

@media (min-width: 1024px) {
    .adw-bestsellers-carousel.adw-with-featured {
        grid-column: 2;
    }
}

/* ============================================
   Splide Carousel Customization
   ============================================ */
.adw-bestsellers-splide {
    padding-bottom: var(--adw-space-2xl);
}

/* .adw-bestsellers-container .splide__track {
    overflow: visible;
} */

.adw-bestsellers-container .splide__list {
    display: flex;
    align-items: stretch;
}

.adw-bestsellers-container .splide__slide {
    height: auto;
    /* display: flex; */
}

/* ============================================
   Product Card
   ============================================ */
.adw-product-card {
    background: var(--adw-white);
    border: 1px solid var(--adw-gray-200);
    border-radius: var(--adw-border-radius-lg);
    overflow: hidden;
    transition: all var(--adw-transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.adw-product-card:hover {
    border-color: var(--adw-primary);
    box-shadow: var(--adw-shadow-lg);
    transform: translateY(-8px);
}

.adw-product-badge {
    position: absolute;
    top: var(--adw-space-md);
    right: var(--adw-space-md);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--adw-space-xs);
    padding: var(--adw-space-xs) var(--adw-space-sm);
    border-radius: var(--adw-border-radius-sm);
    font-size: var(--adw-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.adw-badge-sale {
    background: var(--adw-primary);
    color: var(--adw-white);
}

.adw-product-badge .adw-badge-icon {
    width: 14px;
    height: 14px;
}

.adw-product-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: var(--adw-gray-100);
    overflow: hidden;
}

.adw-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--adw-transition-slow);
}

.adw-product-card:hover .adw-product-image img {
    transform: scale(1.1);
}

.adw-product-info {
    padding: var(--adw-space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.adw-product-name {
    font-size: var(--adw-font-size-base);
    font-weight: 600;
    margin: 0 0 var(--adw-space-sm) 0;
    line-height: 1.4;
    flex: 1;
}

.adw-product-name a {
    color: var(--adw-black);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--adw-transition-fast);
}

.adw-product-name a:hover {
    color: var(--adw-primary);
}

.adw-product-price {
    display: flex;
    align-items: center;
    gap: var(--adw-space-sm);
    margin-bottom: var(--adw-space-md);
}

.adw-product-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--adw-space-xs);
    padding: var(--adw-space-sm) var(--adw-space-lg);
    background: var(--adw-black);
    color: var(--adw-white);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--adw-font-size-sm);
    border-radius: var(--adw-border-radius-md);
    transition: all var(--adw-transition-base);
}

.adw-product-cta:hover {
    background: var(--adw-primary);
}

.adw-cta-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   FLÈCHES DE NAVIGATION
   ============================================ */

.adw-bestsellers-container .splide__arrows {
    position: absolute;
    top: 0;
    width: 100%;
}

.adw-bestsellers-container .splide__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-color, #e6254f);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.adw-bestsellers-container .splide__arrow:hover:not(:disabled) {
  background: var(--secondary-color, #4a4745);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
}

.adw-bestsellers-container .splide__arrow--prev {
  left: -1.5rem;
}

.adw-bestsellers-container .splide__arrow--next {
  right: -1.5rem;
}

.adw-bestsellers-container .splide__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #ccc;
}

.adw-bestsellers-container .splide__arrow svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

/* Alternative: Icônes avec chevrons purs CSS */
.adw-bestsellers-container .splide__arrow::before {
  content: "";
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.adw-bestsellers-container .splide__arrow--prev::before {
  transform: rotate(-135deg);
  margin-left: 0.25rem;
}

.adw-bestsellers-container .splide__arrow--next::before {
  transform: rotate(45deg);
  margin-right: 0.25rem;
}

/* Masquer le SVG si vous utilisez ::before */
.adw-bestsellers-container .splide__arrow svg {
  display: none;
}
/* ============================================
   Splide Pagination
   ============================================ */
.adw-bestsellers-container .splide__pagination {
    bottom: 0;
    padding: 0;
    gap: var(--adw-space-xs);
}

.adw-bestsellers-container .splide__pagination__page {
    width: 10px;
    height: 10px;
    background: var(--adw-gray-300);
    border-radius: 50%;
    transition: all var(--adw-transition-base);
    margin: 0;
}

.adw-bestsellers-container .splide__pagination__page.is-active {
    background: var(--adw-primary);
    transform: scale(1.2);
}


/* ============================================
   PAGINATION
   ============================================ */

.adw-bestsellers-splide .splide__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0 0;
  margin: 0;
  list-style: none;
  position: relative;
  bottom: 0;
}

.adw-bestsellers-splide .splide__pagination__page {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: #d1d1d1;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
}

.adw-bestsellers-splide .splide__pagination__page:hover {
  background: var(--secondary-color, #4a4745);
  transform: scale(1.2);
}

.adw-bestsellers-splide .splide__pagination__page.is-active {
  background: var(--primary-color, #e6254f);
  width: 1.875rem;
  border-radius: 0.3125rem;
}

/* ============================================
   Empty State
   ============================================ */
.adw-bestsellers-empty {
    text-align: center;
    padding: var(--adw-space-3xl);
    background: var(--adw-gray-100);
    border-radius: var(--adw-border-radius-xl);
}

.adw-empty-icon {
    width: 64px;
    height: 64px;
    stroke: var(--adw-gray-400);
    margin: 0 auto var(--adw-space-lg);
}

.adw-bestsellers-empty p {
    font-size: var(--adw-font-size-lg);
    color: var(--adw-gray-600);
    margin: 0;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet Portrait - 768px */
@media (max-width: 1023px) {
    .adw-bestsellers-wrapper {
        padding: 0 var(--adw-space-md);
    }
    
    .adw-bestsellers-header {
        margin-bottom: var(--adw-space-2xl);
    }
    
    .adw-bestsellers-title {
        font-size: var(--adw-font-size-2xl);
    }
    
    .adw-bestsellers-subtitle {
        font-size: var(--adw-font-size-base);
    }
    
    /* Encart fixe masqué sur tablette */
    .adw-bestsellers-featured {
        display: none !important;
    }
    
    .splide__arrow--prev {
        left: -16px;
    }
    
    .splide__arrow--next {
        right: -16px;
    }
}

/* Mobile - 640px */
@media (max-width: 767px) {
    .adw-bestsellers-container {
        padding: var(--adw-space-xl) 0;
    }
    
    .adw-bestsellers-wrapper {
        padding: 0 var(--adw-space-sm);
    }
    
    .adw-bestsellers-header {
        margin-bottom: var(--adw-space-xl);
    }
    
    .adw-bestsellers-title {
        font-size: var(--adw-font-size-xl);
    }
    
    .adw-bestsellers-subtitle {
        font-size: var(--adw-font-size-sm);
    }
    
    /* Encart fixe masqué sur mobile */
    .adw-bestsellers-featured {
        display: none !important;
    }
    
    .adw-product-info {
        padding: var(--adw-space-md);
    }
    
    .adw-product-name {
        font-size: var(--adw-font-size-sm);
    }
    
    .adw-price-special,
    .adw-price-current {
        font-size: var(--adw-font-size-xl);
    }
    
    /* Flèches plus petites sur mobile */
    .splide__arrow {
        width: 40px;
        height: 40px;
    }
    
    .splide__arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .splide__arrow--prev {
        left: -12px;
    }
    
    .splide__arrow--next {
        right: -12px;
    }
}

/* Small Mobile - 480px */
@media (max-width: 639px) {
    .adw-bestsellers-title {
        font-size: var(--adw-font-size-lg);
    }
    
    .adw-product-card {
        border-radius: var(--adw-border-radius-md);
    }
    
    .adw-product-info {
        padding: var(--adw-space-sm);
    }
    
    /* Masquer les flèches sur très petit écran */
    .splide__arrows {
        display: none;
    }
}


@media (max-width: 430px) {
    .adw-bestsellers-splide .splide__slide {
        width: calc(100% - 4.45rem) !important;
        /* margin-right: 0.25rem !important; */
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .adw-bestsellers-featured,
    .splide__arrows,
    .splide__pagination {
        display: none !important;
    }
}
