﻿body {
    overflow-x: hidden;
}

.best-seller-container {
    padding: 80px;
}

.best-seller-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: #000000;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
    position: relative;
    padding-bottom: 10px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(90deg, #000000, #333333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    cursor: default;
}

    .best-seller-title:hover {
        text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    }

.view-all-btn {
    display: block;
    width: 200px; /* Smaller width than Sign-in button */
    margin: 10px auto 30px; /* Reduced margin-top for less spacing */
    padding: 8px; /* Slightly smaller padding for smaller appearance */
    background-color: #000000; /* Matches .Sign-in background */
    color: white; /* Matches .btn-dark text color */
    text-align: center;
    text-transform: uppercase; /* Matches .Sign-in text-transform */
    font-size: 16px; /* Slightly smaller than .Sign-in for proportionality */
    font-weight: 600; /* Matches .Sign-in implied weight */
    border: none; /* Matches .Sign-in border */
    border-radius: 0; /* Matches .Sign-in border-radius */
    transition: background-color 0.3s ease;
    text-decoration: none; /* Ensures no underline on anchor */
}

    .view-all-btn:hover {
        background-color: #333333; /* Matches existing hover effect */
        color: white;
        text-decoration: none;
    }

.best-seller {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 80px;
}

    .best-seller a {
        text-decoration: none;
        color: inherit;
        display: contents;
        width: 100%;
    }

.best-seller-item {
    height: auto;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: calc(25% - 60px);
    display: flex;
    flex-direction: column;
}

.card-img {
    width: 100%;
    height: 0;
    padding-bottom: 133.33%;
    position: relative;
    overflow: hidden;
}

    .card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
        transition: opacity 0.5s ease;
    }

.img-1 {
    opacity: 1;
    z-index: 1;
}

.img-2 {
    opacity: 0;
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
}

.best-seller-item:hover .img-1 {
    opacity: 0;
}

.best-seller-item:hover .img-2 {
    opacity: 1;
}

.new {
    width: 60px;
    height: 36px;
    background-color: rgb(226, 59, 59);
    border: none;
    border-radius: 4px;
    z-index: 9;
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .new p {
        margin: 0;
        font-style: normal;
        font-size: 14px;
        font-weight: 600;
        color: white;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.best-seller-item .new:hover {
    background-color: rgb(200, 50, 50);
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.card-description {
    width: 100%;
    padding-top: 15px;
    padding-left: 0;
    font-size: 16px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

    .card-description span {
        display: block;
    }

    .card-description .item-name {
        display: block;
        font-size: 1.2rem;
        font-weight: normal;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 5px;
    }

.price-row {
    display: flex;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .price-row .old-price {
        color: #000;
        opacity: 1;
        font-weight: normal;
    }

    .price-row del.old-price {
        color: #888;
        opacity: 1;
        text-decoration: line-through;
        text-decoration-color: red;
        font-weight: normal;
    }

    .price-row .new-price {
        color: rgb(226, 59, 59);
        font-weight: 600;
        opacity: 1;
    }

@media (max-width: 768px) {
    .new {
        width: 50px;
        height: 30px;
        top: 8px;
        left: 8px;
    }

        .new p {
            font-size: 12px;
        }

    .best-seller-item {
        max-width: calc(50% - 60px);
    }

    .card-description {
        font-size: 14px;
    }

        .card-description .item-name {
            font-size: 16px;
        }

    .price-row .old-price,
    .price-row .new-price {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .best-seller-item {
        max-width: 100%;
    }

    .best-seller {
        margin-top: 70px;
    }

    .best-seller-container {
        padding: 60px;
    }

    .card-description {
        font-size: 12px;
    }

        .card-description .item-name {
            font-size: 14px;
        }

    .price-row .old-price,
    .price-row .new-price {
        font-size: 12px;
    }

    .view-all-btn {
        width: 160px; /* Slightly smaller for mobile */
        font-size: 14px; /* Smaller font for mobile */
        padding: 6px; /* Reduced padding for mobile */
    }
}


.out-of-stock {
    width: 120px;
    height: 28px;
    background-color: #212529; /* Matches Bootstrap .btn-dark */
    border: none;
    border-radius: 4px;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0 8px;
}

    .out-of-stock p {
        margin: 0;
        font-style: normal;
        font-size: 12px; /* Reduced from 14px */
        font-weight: 600;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .out-of-stock:hover {
        background-color: #343a40; /* Slightly lighter for hover, like .btn-dark */
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    }
