/* base.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f1f3f6;
}

/* Main Content */
.container {
    max-width: 1250PX;
    margin: 0 auto;
    margin-top: 10px;
    padding: 0 1s0px;
    background-color: #ffffff;
}



.button {
    border: none;
    color: white;
    padding: 10px 3px;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    font-size: 16px;
    margin: 4px 0;
    transition-duration: 0.4s;
    cursor: pointer;
}

.variation_button {
    background-color: #f7f7f5;
    color: black;
    border: 1px solid black;
    border-radius: 12px;

}

/* related product */
.deals-section {
    background-color: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;

}

.section-title {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
}

.view-all {
    color: #2874f0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;       /* keeps spacing inside */
    margin: 0 auto;      /* center align */
    overflow-x: auto;  /* stop scrolling */
}


.products-grid::-webkit-scrollbar {
    display: grid;
    /* Chrome, Safari, Opera */
}

.products-grid a {
    display: block;        /* make anchor take full grid cell */
    width: 100%;           /* anchor stretches */
    text-decoration: none; /* keep your styling */
}

.product-card {
    flex: 0 0 auto;
    width: 180px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s;
    border: 1px solid #f0f0f0;
    border-radius: 5px;
    box-sizing: border-box;
    position: relative;
}

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

.product-img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
}

.product-title {
    font-size: 12px;
    color: #212121;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}

.product-price {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 3px;
}

.product-original-price {
    font-size: 10px;
    color: #878787;
    text-decoration: line-through;
    margin-right: 3px;
}

.product-discount {
    font-size: 10px;
    color: #388e3c;
}

.wishlist-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 32px;
    /* Fixed width */
    height: 32px;
    /* Fixed height */
    display: flex;
    /* Center icon */
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #e53935;
    transition: opacity 0.3s ease, transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    position: absolute;
    top: 105%;
    /* Below the heart */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}


/* When product card is hovered */
.product-card:hover .wishlist-icon {
    opacity: 1;
    pointer-events: auto;
    /* Allow clicks when visible */
}

.wishlist-icon:hover {
    transform: scale(1.2);
}

.wishlist-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.wishlist-icon.wishlist-active {
    background-color: #e53935;
    /* red background */
    color: #fff;
    /* white heart icon */
}


/* search-input */
.list-view {
    border: 1px solid #ccc;
    margin-top: 10px;
    padding: 10px;

    display: block;
    /* hidden by default */
}

.list-item {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.list-item-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: Arial, sans-serif;
}

.list-item-text {
    max-width: 60%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #212121;
}

.list-item-image {
    width: 50px;
    object-fit: contain;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;

}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Media Queries for Responsive Design */
@media (min-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        
    }

}

@media (max-width: 600px) {

    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 equal columns */
        gap: 5px; /* space between cards */
        padding: 0 10px; /* left-right padding */
    }

    .products-grid a {
        width: 100%;   /* each anchor is exactly 50% */
    }

    .product-card {
        width: 170px !important;   /* let it stretch */
        max-width: 100%;
        box-sizing: border-box; /* include padding/border in width */
        margin: 0;    
        
    }
}



@media (min-width: 768px) {

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }


    .product-title {
        -webkit-line-clamp: 2;
        min-height: 30px;
    }

    .product-img {
        height: 130px;
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .product-card {
        min-width: auto;
    }

    .product-img {
        height: 150px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-original-price,
    .product-discount {
        font-size: 12px;
    }

}