/* ============================================
   BESTSELLERS SECTION - Style Pizze and Cook
   ============================================ */

.bestsellers-section {
    padding: 25px 0;
    width: 100vw !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Header */
.bestsellers-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 135px;
}

.bestsellers-title {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    color: #000000;
}

.bestsellers-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    max-width: 700px;
    margin: 0 auto;
}

/* Grid */
.bestsellers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 135px;
}

/* Card */
.bestseller-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid;
    border-color: #C5C5C5;
}

.bestseller-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* Image */
.bestseller-card-image {
    position: relative;
    width: 100%;
    height: 262px;
    /* overflow: hidden; */
    /* background: #2a2a2a; */
    /* border-radius: 12px; */
    /* margin: 15px 15px 0 15px; */
    /* width: calc(100% - 30px); */
}

.bestseller-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.bestseller-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    /* border-radius: 12px; */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.bestseller-card:hover .bestseller-card-image img {
    transform: scale(1.05);
}

/* Content */
.bestseller-card-content {
    padding: 8px 26px 14px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bestseller-card-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.bestseller-card-title a {
    color: #000000;
    transition: color 0.3s ease;
    font-weight: lighter;
}

.bestseller-card-title a:hover {
    color: #222248;
}

.bestseller-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: #a0a0a0;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

/* Remove HTML tags from description */
.bestseller-card-description p {
    margin: 0;
}

/* Footer */
.bestseller-card-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
}

.bestseller-card-price {
    font-size: 24px;
    font-weight: bolder;
    color: #000000;
}

/* Add to cart button */
.add-to-cart-form {
    margin: 0;
    width: 100%;
    text-align: end;
}

.bestseller-add-to-cart {
    background: #E52A20;
    color: #ffffff;
    border: none;
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    width: 53%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bestseller-add-to-cart svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.bestseller-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.bestseller-add-to-cart:active {
    transform: translateY(0);
}

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

/* Desktop large */
@media (max-width: 1400px) {
    .bestsellers-grid {
        gap: 25px;
        padding: 0 100px;
    }

    .bestsellers-header {
        padding: 0 100px;
    }
}

/* Laptop */
@media (max-width: 1199px) {
    .bestsellers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 60px;
    }

    .bestsellers-header {
        padding: 0 60px;
    }

    .bestsellers-title {
        font-size: 28px;
        letter-spacing: 6px;
    }

    .bestseller-card-image {
        height: 250px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .bestsellers-section {
        padding: 40px 0;
    }

    .bestsellers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 40px;
    }

    .bestsellers-header {
        padding: 0 40px;
    }

    .bestsellers-title {
        font-size: 26px;
        letter-spacing: 5px;
    }

    .bestsellers-subtitle {
        font-size: 15px;
    }

    .bestseller-card-image {
        height: 220px;
    }

    .bestseller-card-title {
        font-size: 18px;
    }

    .bestseller-card-price {
        font-size: 22px;
    }

    .bestseller-add-to-cart {
        padding: 10px 25px;
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .bestsellers-section {
        padding: 35px 0;
    }

    .bestsellers-header {
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .bestsellers-title {
        font-size: 22px;
        letter-spacing: 4px;
        margin-bottom: 15px;
    }

    .bestsellers-subtitle {
        font-size: 14px;
    }

    .bestsellers-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 64px;
    }

    .bestseller-card-image {
        height: 250px;
    }

    .bestseller-card-content {
        padding: 20px;
    }

    .bestseller-card-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .bestseller-card-description {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .bestseller-add-to-cart {
        padding: 14px 20px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .bestsellers-title {
        font-size: 20px;
        letter-spacing: 3px;
    }

    .bestseller-card-image {
        height: 200px;
    }

    .bestseller-card-price {
        font-size: 20px;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.bestseller-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.bestseller-add-to-cart:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.bestseller-add-to-cart:disabled:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

/* ============================================
   ANIMATION VARIANTS
   ============================================ */

.bestseller-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.bestseller-card:nth-child(1) {
    animation-delay: 0.1s;
}

.bestseller-card:nth-child(2) {
    animation-delay: 0.2s;
}

.bestseller-card:nth-child(3) {
    animation-delay: 0.3s;
}

.bestseller-card:nth-child(4) {
    animation-delay: 0.4s;
}

.bestseller-card:nth-child(5) {
    animation-delay: 0.5s;
}

.bestseller-card:nth-child(6) {
    animation-delay: 0.6s;
}

.bestseller-card:nth-child(7) {
    animation-delay: 0.7s;
}

.bestseller-card:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance optimizations */
.bestseller-card-image,
.bestseller-card-image img {
    will-change: transform;
}

.bestseller-card:hover {
    will-change: transform, box-shadow;
}

.link_best {
    text-transform: uppercase;
    font-weight: 500;
    font-size: 14px;
    color: #222248;
    letter-spacing: 2px;
    text-decoration: none;
    margin: 0px;
    display: flex;
    flex-direction: row-reverse;
}