/* Bestsellers Section Styles - BEM Methodology */

.bestsellers {
    width: 100%;
    padding: 80px 20px;
    background-color: #ffffff;
    direction: ltr;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.bestsellers.bestsellers--visible {
    opacity: 1;
    transform: translateY(0);
}

.bestsellers__container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.bestsellers__title {
    font-size: 32px;
    font-weight: 600;
    color: #000000;
    text-align: center !important;
    margin: 0 auto 50px auto !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    display: block;
    position: relative;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    will-change: opacity, transform;
}

.bestsellers--visible .bestsellers__title {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bestsellers__title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60px;
    height: 2px;
    background-color: #000000;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

.bestsellers--visible .bestsellers__title::after {
    transform: translateX(-50%) scaleX(1);
}

.bestsellers__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    width: 100%;
}

.bestsellers__item {
    position: relative;
    opacity: 0;
    transform: translateY(50px) scale(0.9) rotateX(5deg);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    backface-visibility: hidden;
    perspective: 1000px;
    width: 100%;
}

.bestsellers__item.bestsellers__item--visible {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
}

.bestsellers__item--visible .bestsellers__image-wrapper {
    animation: bestsellersImageReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.bestsellers__item--visible .bestsellers__content {
    animation: bestsellersContentReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

@keyframes bestsellersImageReveal {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bestsellersContentReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.bestsellers__link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bestsellers__link:hover {
    transform: translateY(-5px);
}

.bestsellers__image-wrapper {
    position: relative;
    width: 100%;
    height: 422px;
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 15px;
}

.bestsellers__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    will-change: opacity, transform;
}

.bestsellers__image--main {
    opacity: 1;
    z-index: 1;
    transform: scale(1);
}

.bestsellers__image--gallery {
    opacity: 0;
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1);
    pointer-events: none;
    visibility: hidden;
}

.bestsellers__link:hover .bestsellers__image--main {
    opacity: 0;
    transform: scale(1.08);
    pointer-events: none;
}

/* Show first gallery image on hover */
.bestsellers__link:hover .bestsellers__image--gallery:first-of-type {
    opacity: 1;
    transform: scale(1.08);
    visibility: visible;
}

.bestsellers__image--gallery.bestsellers__image--active {
    opacity: 1 !important;
    transform: scale(1.08) !important;
    pointer-events: none;
    visibility: visible !important;
}

.bestsellers__link:hover .bestsellers__image--gallery.bestsellers__image--active {
    opacity: 1 !important;
    transform: scale(1.08) !important;
    visibility: visible !important;
}

.bestsellers__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
}

.bestsellers__placeholder-text {
    color: #808080;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bestsellers__badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #000000;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
    opacity: 0;
    transform: scale(0.8) translateX(-10px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s, 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.bestsellers__item--visible .bestsellers__badge {
    opacity: 1;
    transform: scale(1) translateX(0);
}

.bestsellers__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    backdrop-filter: blur(2px);
}

.bestsellers__link:hover .bestsellers__overlay {
    opacity: 1;
    transform: scale(1);
}

.bestsellers__view {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 30px;
    border: 2px solid #ffffff;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(10px);
    opacity: 0;
}

.bestsellers__link:hover .bestsellers__view {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(0);
    opacity: 1;
}

.bestsellers__content {
    text-align: left;
    padding: 0 5px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(10px);
}

.bestsellers__item--visible .bestsellers__content {
    opacity: 1;
    transform: translateY(0);
}

.bestsellers__link:hover .bestsellers__content {
    transform: translateY(-3px);
}

.bestsellers__product-title {
    font-size: 15px;
    font-weight: 400;
    color: #000000;
    margin: 0 0 8px 0;
    letter-spacing: 0.3px;
    line-height: 1.5;
    transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bestsellers__link:hover .bestsellers__product-title {
    color: #333333;
}

.bestsellers__price {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s, 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

.bestsellers__item--visible .bestsellers__price {
    opacity: 1;
    transform: translateY(0);
}

.bestsellers__price del {
    color: #808080;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 14px;
}

.bestsellers__price ins {
    text-decoration: none;
    color: #000000;
    font-weight: 600;
}

.bestsellers__price .woocommerce-Price-amount {
    display: inline-block;
}

/* ============================================
   RESPONSIVE STYLES - Complete & Enhanced
   ============================================ */

/* Large Devices (Desktops, 1200px to 1399px) */
@media (max-width: 1399.98px) {
    .bestsellers__container {
        max-width: 1200px !important;
    }

    .bestsellers__grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
}

/* Medium-Large Devices (Small Desktops, 992px to 1199px) */
@media (max-width: 1199.98px) {
    .bestsellers {
        padding: 70px 20px !important;
    }

    .bestsellers__container {
        max-width: 100% !important;
    }

    .bestsellers__grid {
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: repeat(3, auto) !important;
        gap: 12px !important;
    }

    .bestsellers__image-wrapper {
        height: 380px !important;
    }

    .bestsellers__title {
        font-size: 30px !important;
        margin-bottom: 40px !important;
    }
}

/* Medium Devices (Tablets, 768px to 991px) */
@media (max-width: 991.98px) {
    .bestsellers {
        padding: 60px 20px !important;
    }

    .bestsellers__container {
        max-width: 100% !important;
    }

    .bestsellers__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(4, auto) !important;
        gap: 15px !important;
    }

    .bestsellers__item {
        width: 100% !important;
        max-width: 100% !important;
    }

    .bestsellers__image-wrapper {
        height: 360px !important;
    }

    .bestsellers__title {
        font-size: 28px !important;
        margin-bottom: 35px !important;
    }

    .bestsellers__product-title {
        font-size: 14px !important;
    }

    .bestsellers__price {
        font-size: 15px !important;
    }
}

/* Small Devices (Landscape Phones, 576px to 767px) */
@media (max-width: 767.98px) {
    .bestsellers {
        padding: 50px 15px !important;
    }

    .bestsellers__container {
        max-width: 100% !important;
    }

    .bestsellers__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: auto !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .bestsellers__item {
        width: 100% !important;
        max-width: 100% !important;
    }

    .bestsellers__image-wrapper {
        height: 320px !important;
        margin-bottom: 12px !important;
    }

    .bestsellers__title {
        font-size: 24px !important;
        margin-bottom: 30px !important;
        letter-spacing: 0.8px !important;
    }

    .bestsellers__content {
        text-align: center !important;
        padding: 0 !important;
    }

    .bestsellers__product-title {
        font-size: 13px !important;
        text-align: center !important;
        margin-bottom: 6px !important;
    }

    .bestsellers__price {
        font-size: 14px !important;
        justify-content: center !important;
    }

    .bestsellers__badge {
        top: 10px !important;
        left: 10px !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }

    .bestsellers__view {
        font-size: 11px !important;
        padding: 10px 20px !important;
    }
}

/* Extra Small Devices (Portrait Phones, up to 575px) */
@media (max-width: 575.98px) {
    .bestsellers {
        padding: 40px 12px !important;
    }

    .bestsellers__container {
        max-width: 100% !important;
    }

    .bestsellers__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: auto !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .bestsellers__item {
        width: 100% !important;
        max-width: 100% !important;
    }

    .bestsellers__image-wrapper {
        height: 280px !important;
        margin-bottom: 10px !important;
    }

    .bestsellers__title {
        font-size: 20px !important;
        margin-bottom: 25px !important;
        letter-spacing: 0.5px !important;
    }

    .bestsellers__content {
        text-align: center !important;
        padding: 0 !important;
    }

    .bestsellers__product-title {
        font-size: 12px !important;
        text-align: center !important;
        margin-bottom: 5px !important;
        line-height: 1.4 !important;
    }

    .bestsellers__price {
        font-size: 13px !important;
        justify-content: center !important;
    }

    .bestsellers__price del {
        font-size: 11px !important;
    }

    .bestsellers__badge {
        top: 8px !important;
        left: 8px !important;
        padding: 4px 8px !important;
        font-size: 9px !important;
    }

    .bestsellers__view {
        font-size: 10px !important;
        padding: 8px 16px !important;
        letter-spacing: 1px !important;
    }
}

/* Very Small Devices (Small Phones, up to 375px) */
@media (max-width: 374.98px) {
    .bestsellers {
        padding: 35px 10px !important;
    }

    .bestsellers__grid {
        gap: 6px !important;
    }

    .bestsellers__image-wrapper {
        height: 250px !important;
        margin-bottom: 8px !important;
    }

    .bestsellers__title {
        font-size: 18px !important;
        margin-bottom: 20px !important;
    }

    .bestsellers__product-title {
        font-size: 11px !important;
    }

    .bestsellers__price {
        font-size: 12px !important;
    }

    .bestsellers__price del {
        font-size: 10px !important;
    }

    .bestsellers__badge {
        top: 6px !important;
        left: 6px !important;
        padding: 3px 6px !important;
        font-size: 8px !important;
    }

    .bestsellers__view {
        font-size: 9px !important;
        padding: 6px 12px !important;
    }
}

/* Landscape Orientation (Mobile) */
@media (max-width: 991.98px) and (orientation: landscape) {
    .bestsellers {
        padding: 40px 15px !important;
    }

    .bestsellers__grid {
        gap: 12px !important;
    }

    .bestsellers__image-wrapper {
        height: 300px !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .bestsellers__link {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }

    .bestsellers__item:active {
        transform: scale(0.98) !important;
    }

    .bestsellers__link:active {
        transform: translateY(0) !important;
    }
}






