/* =========================================================
   Product Grid
========================================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);  /* 4 equal columns */
    gap: 1.5rem;
    max-width: 100vw;
    margin: 2rem 1rem;
}

/* Product Card */
.product-card {
    position: relative;   /* Add this */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--cardBgColor);
    padding: 0rem 0 1rem 0;
    margin: 0rem 0rem;
}

.product-card a {
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}
.product-card a:hover {
    text-decoration: none;
    cursor: pointer;
}

/* Product Image */
.product-card img {
    width: 100%;
    height: auto;
    padding: 0rem;
    margin: 0rem;
    object-fit: cover;
    box-sizing: border-box;
}

/* Product Name */
.product-card h3 {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--textColor);
}

/* Product Price */
.product-card p {
    font-weight: 500;
    margin: 0.5rem;
    color: var(--textColor);
}

/* Add to Cart Button */
.product-card button.add-to-cart {
    background-color: var(--btnBgColor);
    color: var(--btnTextColor);
    padding: 0.25rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
    border: none;
}

.product-card button.add-to-cart:hover {
    background-color: var(--btnHoverColor);
}

.wishlist-heart {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
}

/* ------------------- Share section ------------------- */
.share-wrapper {
    position: absolute;
    top: 0.5rem;      /* top-left corner */
    left: 0.5rem;
    z-index: 15;
}

.share-wrapper .share-btn {
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 1.3rem;
}

.share-menu {
    display: none;     /* hidden by default */
    position: absolute;
    top: 110%;         /* below the button */
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    min-width: 80px;
    cursor: pointer;
    z-index: 20;
}

.share-menu.open {
    display: flex;     /* show menu when .open is toggled */
}

.share-menu button {
    background: none;
    border: none;
    padding: 0.6rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}

.share-menu button:hover {
    cursor: pointer;
    background-color: #e1e1e1;
}

/* =========================================================
   MOBILE RESPONSIVE STYLES
========================================================= */
@media (max-width: 700px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 1rem;
        margin: 1rem;
    }

    .wishlist-heart {
        top: 0.5rem;
    }

    .share-wrapper .share-btn {
        font-size: 1.1rem;
        border-radius: 1.5rem;
    }

    .product-card img {
        width: 100%;
        height: auto;
    }
}
