.products-wrapper {
    margin: 0 auto;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.products-wrapper h2 {
    font-size: 1.8rem;
    color: #333;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}


/* Container for goods items */
.goods-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: space-between;
    padding:0;
    margin-top:10px;
}

/* Individual goods item layout */
.goods-layout {
    width: calc(25% - 10px); /* Three items per row */
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border-radius: 8px;
    display: flex;
}

/* Image wrapper */
.image-wrapper {
    flex: 0 0 40%; /* Image takes 40% of the container width */
    overflow: hidden;
    border-radius: 8px 0 0 8px; /* Rounded corners only on the left */
    position: relative; /* Ensure relative positioning for pseudo-element */
}

/* Available or Sold label */

.sale-or-sold {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    padding: 4px 8px;
    font-size: 12px; 
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); 
    transition: background-color 0.3s ease; 
}

/* Available label */
.available {
    background-color: rgba(0, 128, 0, 0.8); /* Green background for available */
}

/* Sold out label */
.sold-out {
    background-color: rgba(255, 0, 0, 0.8); /* Red background for sold out */
}



.image-wrapper img {
    width: 100%;
    height: 100%; /* Ensure the image covers the entire container */
    object-fit: cover; /* Fit the image inside the container covering it */
    display: block;
}

/* Detail wrapper */
.detail-wrapper {
    flex: 0 0 60%; /* Detail section takes 60% of the container width */
    padding:6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden; /* Hide any overflow content */
}

.detail-wrapper h1 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
    overflow: hidden; /* Ensure title doesn't overflow */
    text-overflow: ellipsis; /* Show ellipsis if title overflows */
    white-space: nowrap; /* Prevent title from wrapping */
}
/* Tag section */
.tags {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin-bottom: 4px;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.tags::-webkit-scrollbar {
    display: none;
}

.tags-items {
    display: flex;
    align-items: center;
    background-color: #6ab070;
    color: white;
    font-weight: 300;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 3px;
    height: 20px;
    width: auto;
    white-space: nowrap;
}



/* Price wrapper */
.price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2px;
}

.price {
    font-family: 'Arial', sans-serif;
    font-size: 1rem;
    color: #333333;
    font-weight: bold;
    margin-top:-4px;
    margin-bottom: 10px;
    position: relative;
    transform: translateY(5px);
}

.price::before {
    content: '';
    font-size: 0.75em;
    position: absolute;
    left: -1.5em;
    color: #ff5733;
}

.decimal {
    font-family: 'Arial', sans-serif;
    font-size: 0.85em;
    vertical-align: super;
    color: #777777;
}

.discount {
    font-size: 0.8rem;
    color: green;
    font-weight: bold;
    position: relative;
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid green;
    border-radius: 5px;
    background: rgba(0, 128, 0, 0.1);
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    top: -8px;
    margin-left: auto;
}

.discount:hover {
    background: rgba(0, 128, 0, 0.2);
    border-color: darkgreen;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.discount::before {
    content: 'Save';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: green;
    background: white;
    padding: 0 3px;
    border-radius: 3px;
    border: 1px solid green;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.discount span {
    text-decoration: line-through;
    margin-right: 5px;
    color: red;
    transition: color 0.3s ease;
}

.discount:hover span {
    color: darkred;
}
.discount-amount {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: bold;
    padding: 1px 3px;
    border-left: 2px solid #6c757d;
    border-radius: 3px;
    display: inline-block;
}


/* Info section */
.info {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-bottom: 4px; /* Added margin-bottom for spacing */
    padding-bottom: 4px;
    top: -4px; /* Adjusted upward */
    -webkit-overflow-scrolling: touch;
}

.info::-webkit-scrollbar {
    display: none;
}

.info-item {
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--light-text-color);
    border-radius: 4px;
    font-size: 8px;
    white-space: nowrap;
    cursor: w-resize;
    transition: background-color 0.3s ease;
}

.info-item:hover {
    background-color: rgba(255, 255, 255, 0.4);
}


.less-available {
    display: flex;
    align-items: center; 
    padding: 5px 8px; 
    font-size: 12px; 
    height: 20px; 
    background: #FFB74D; 
    color: #FFF;
    border-radius: 3px; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); 
    transition: background 0.3s, box-shadow 0.3s;
    white-space: nowrap;
}

.less-available:hover {
    background: #FFA000; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); 
}

.less-available::before {
    content: '';
    background: url('../image/icons/sand-watch.png') no-repeat center; 
    background-size: 14px; 
    width: 16px; 
    height: 16px; 
    margin-right: 4px; 
    animation: rotate 3s infinite; 
}

@keyframes rotate {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}


.goods-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    position: relative;
}

.action-wrapper {
    display: flex;
    gap: 8px;
}

.see-more, .add-to-cart{
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px; 
    text-decoration: none;
    font-size: 0.75rem;
    border: 2px solid;
    color: #FFFFFF;
    white-space: nowrap;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.see-more {
    border-color: #007BFF;
    color: #007BFF; 
}

.add-to-cart {
    border-color: #DAA520;
    color: #DAA520; 
}

.request-restock {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #228B22;
    color: #228B22;
    padding: 4px 8px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    font-size: 0.5rem; 
    white-space: nowrap;
    background-color: transparent;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.request-restock:hover {
    background-color: #228B22;
    color: #FFFFFF;
}


.see-more:hover {
    background-color: #007BFF;
    color: #FFFFFF;
}

.add-to-cart:hover {
    background-color: #DAA520;
    color: #FFFFFF;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the content horizontally */
    position: absolute;
    right: 0;
    top: -3px; /* Adjusted top position to raise it a bit */
}

.like-btn {
    display: flex;
    flex-direction: column; /* Stack the icon and count vertically */
    align-items: center; /* Center the icon and count */
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
}

.like-icon {
    width: 24px;
    height: auto;
    content: url('../image/icons/love.png');
}

.like-btn.liked .like-icon {
    content: url('../image/icons/likedlove.png');
}

.like-count {
    font-size: 0.5rem;
    margin-top: 2px; /* Adjusted margin to bring it closer to the button */
}

.see-more.disabled, .add-to-cart.disabled {
    cursor: not-allowed;
    background-color: #ddd;
    color: #888;
    border-color: #ddd;
    pointer-events: none;
}

.see-more.disabled:hover, .add-to-cart.disabled:hover {
    background-color: #ddd;
    color: #888;
    border-color: #ddd;
}

@media (max-width: 768px) {
    .goods-layout {
        flex: 0 0 100%; /* One item per row on small screens */
    }

    .detail-wrapper {
        padding: 10px;
    }

    .tags-items,
    .info-item {
        margin-bottom: 5px; /* Increased margin between items on small screens */
    }
}



