/* styles/styleListView.css */

body {
    background-color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    color: #1D1616;
    margin: 0;
}

header {
    position: sticky;
    top: 0;
    z-index: 9999;
}

.container {
    margin: 10px auto;
    padding: 10px;
    background-color: #F8F9FA;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.category-heading {
    font-size: 1.5rem;
    color: #E67E22;
    font-weight: 700;
    margin: 30px 0 15px;
    text-transform: capitalize;
    border-left: 4px solid #E67E22;
    padding-left: 12px;
}

.remove-button {
    color: #B71C1C;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.price-strike {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #1D1616;
    margin-right: 8px;
    font-weight: 700;
}

.price-current {
    font-size: 1.2rem;
    font-weight: 800;
    color: #8B0000;
}

button {
    background-color: #E67E22;
    color: #FFFFFF;
    border: 2px solid #E67E22;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    padding: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background-color: #B71C1C;
    transform: scale(1.05);
}

button:focus {
    outline: none;
    box-shadow: 0 0 4px 2px rgba(230, 126, 34, 0.4);
}

button:active {
    background-color: #8B0000;
    transform: scale(0.98);
}

.add-to-cart-btn {
    border-radius: 6px;
    padding: 10px;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto; 
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fffef5;
    border: 2px solid #654321;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(101, 67, 33, 0.08);
    height: 40px;
    margin: 0 auto; /* Center horizontally within flex container */
}

.quantity-control button {
    flex: 1;
    background: linear-gradient(135deg, #654321, #8b5a2b);
    color: #fffef5;
    border: none;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.quantity-control button:hover {
    background: linear-gradient(135deg, #4a2f15, #654321);
    transform: scale(1.02);
}

.quantity-control span {
    flex: 1;
    background: #fffef5;
    color: #654321;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 1px solid #f7ece1;
    border-right: 1px solid #f7ece1;
}

.quantity {
    font-size: 1rem;
    font-weight: 600;
    color: #654321;
}

.table-responsive {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

table {
    width: 100%;
    margin-bottom: 20px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table th,
.table td {
    font-size: 0.95rem;
    color: #1D1616;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.table th {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    background-color: #F8F9FA;
    text-align: center;
}

.table td {
    vertical-align: middle;
}

.table td:last-child {
    text-align: center;
    width: 150px;
    display: flex; /* Use flexbox for vertical centering */
    flex-direction: column; /* Stack elements vertically */
    justify-content: center; /* Center vertically */
    align-items: center; /* Center horizontally */
    height: 100%; /* Take full height of the row */
}

.table td:nth-child(2) { /* Product column */
    width: 40%; /* Default width for larger screens */
}

td img {
    width: 50px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

td img:hover {
    transform: scale(1.05);
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.category-buttons button {
    border-radius: 10px;
    padding: 6px 15px;
    padding-top: 10px;
    background-color: #F5E8D9;
    color: #1D1616;
    border: 2px solid #E67E22;
    transition: background-color 0.3s, color 0.3s;
}

.category-buttons button:hover {
    background-color: #E67E22;
    color: #FFFFFF;
}

.hidden {
    display: none !important;
}

button.active {
    background-color: #8B0000;
    color: #FFD700;
    border-color: #8B0000;
}

.discount-text {
    font-size: 1rem;
    font-weight: 600;
    color: #FFD700;
}

.countdown {
    color: #D4A017;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    padding: 5px;
    background-color: #fff3e0;
    border-radius: 5px;
    margin: 0 auto; /* Center horizontally within flex container */
}

/* Media Queries */

/* Below 600px (new media query) */
@media (max-width: 600px) {
    .add-to-cart-btn {
        width: 30px; /* Reduced width */
        height: 30px;
        padding: 6px;
    }

    .quantity-control {
        width: 80px; /* Reduced total width */
        height: 30px;
        gap: 5px; /* Reduced gap to fit smaller width */
    }

    .quantity-control button {
        width: 20px; /* Reduced width */
        height: 20px;
        font-size: 14px;
        padding: 5px 0;
    }

    .quantity-control span {
        font-size: 14px;
        width: 30px; /* Adjusted to fit within 80px total */
    }

    .table td:nth-child(2) { /* Product column */
        width: 50%; /* Wider product section */
    }

    .table td:last-child { /* Shop column */
        width: 100px; /* Reduced to avoid overlap */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .table th,
    .table td {
        font-size: 0.85rem;
        padding: 8px;
    }

    td img {
        width: 40px;
        border-radius: 5px;
    }

    .category-heading {
        font-size: 1rem;
    }

    .category-buttons button {
        font-size: 0.85rem;
        padding: 4px 10px;
    }

    .category-buttons {
        gap: 10px;
    }
}

/* Below 360px */
@media (max-width: 360px) {
    td img {
        width: 30px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 0.65rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 0.85rem;
    }

    .add-to-cart-btn {
        width: 25px; /* Further reduced */
        height: 25px;
        font-size: 0.65rem;
        padding: 4px;
    }

    .quantity-control {
        width: 70px; /* Further reduced */
        height: 25px;
    }

    .quantity-control button {
        width: 18px;
        height: 18px;
        font-size: 12px;
        padding: 4px 0;
    }

    .quantity-control span {
        font-size: 12px;
        width: 25px;
    }

    .price-strike {
        font-size: 0.60rem;
    }

    .price-current {
        font-size: 0.70rem;
    }

    .quantity {
        font-size: 0.65rem;
    }

    .category-buttons button {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .category-buttons {
        gap: 5px;
        margin-bottom: 10px;
    }

    .remove-button {
        font-size: 0.75rem;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 361px - 414px */
@media (min-width: 361px) and (max-width: 414px) {
    td img {
        width: 30px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 0.70rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 0.90rem;
    }

    .add-to-cart-btn {
        width: 28px; /* Slightly adjusted */
        height: 28px;
        font-size: 0.75rem;
        padding: 5px;
    }

    .quantity-control {
        width: 75px;
        height: 28px;
    }

    .quantity-control button {
        width: 20px;
        height: 20px;
        font-size: 14px;
        padding: 5px 0;
    }

    .quantity-control span {
        font-size: 14px;
        width: 25px;
    }

    .price-strike {
        font-size: 0.70rem;
    }

    .price-current {
        font-size: 0.80rem;
    }

    .quantity {
        font-size: 0.75rem;
    }

    .category-buttons button {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 415px - 480px */
@media (min-width: 415px) and (max-width: 480px) {
    td img {
        width: 35px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 0.80rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 0.90rem;
    }

    .add-to-cart-btn {
        width: 30px;
        height: 30px;
        font-size: 0.80rem;
        padding: 6px;
    }

    .quantity-control {
        width: 80px;
        height: 30px;
    }

    .quantity-control button {
        width: 20px;
        height: 20px;
        font-size: 14px;
        padding: 5px 0;
    }

    .quantity-control span {
        font-size: 14px;
        width: 30px;
    }

    .price-strike {
        font-size: 0.80rem;
    }

    .price-current {
        font-size: 0.90rem;
    }

    .quantity {
        font-size: 0.80rem;
    }

    .category-buttons button {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 481px - 768px */
@media (min-width: 481px) and (max-width: 768px) {
    td img {
        width: 40px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 0.85rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 0.95rem;
    }

    .add-to-cart-btn {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
        padding: 6px;
    }

    .quantity-control {
        width: 90px;
        height: 35px;
    }

    .quantity-control button {
        width: 25px;
        height: 25px;
        font-size: 16px;
        padding: 6px 0;
    }

    .quantity-control span {
        font-size: 16px;
        width: 35px;
    }

    .price-strike {
        font-size: 0.85rem;
    }

    .price-current {
        font-size: 0.95rem;
    }

    .quantity {
        font-size: 0.85rem;
    }

    .category-buttons button {
        font-size: 0.85rem;
        padding: 3px 6px;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    td img {
        width: 45px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 0.95rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 1rem;
    }

    .add-to-cart-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        padding: 6px;
    }

    .quantity-control {
        width: 100px;
        height: 40px;
    }

    .quantity-control button {
        width: 30px;
        height: 30px;
        font-size: 18px;
        padding: 8px 0;
    }

    .quantity-control span {
        font-size: 18px;
        width: 40px;
    }

    .price-strike {
        font-size: 0.90rem;
    }

    .price-current {
        font-size: 1rem;
    }

    .quantity {
        font-size: 0.95rem;
    }

    .category-buttons button {
        font-size: 0.95rem;
        padding: 3px 6px;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* Above 1025px */
@media (min-width: 1025px) {
    td img {
        width: 50px;
        border-radius: 5px;
    }

    .table th,
    .table td {
        font-size: 1rem;
        padding: 5px;
    }

    .category-heading {
        font-size: 1.2rem;
    }

    .add-to-cart-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        padding: 8px;
    }

    .quantity-control {
        width: 100px;
        height: 40px;
    }

    .quantity-control button {
        width: 30px;
        height: 30px;
        font-size: 18px;
        padding: 10px 0;
    }

    .quantity-control span {
        font-size: 18px;
        width: 40px;
    }

    .price-strike {
        font-size: 1rem;
    }

    .price-current {
        font-size: 1.2rem;
    }

    .quantity {
        font-size: 1rem;
    }

    .category-buttons button {
        font-size: 1rem;
        padding: 6px 10px;
    }

    .table td:last-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}