/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background-color: #f7f7fa;
}

/* Our Products Heading */
h4.text-center.fw-bold {
    margin-bottom: 40px;
    color: black;
}

/* Product Card Container */
.product-card {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure all cards have the same height */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Product Image */
.product-img {
    width: 100%;           /* Smaller width than container */
    height: auto;         /* Keep aspect ratio */
    object-fit: contain;  /* Show entire image without cropping */
    display: block;
    margin: 0 auto;       /* Center the image horizontally */
}



/* Product Info Section */
.product-info {
    padding: 10px;
    text-align: center;
    flex: 1; /* Allow this section to grow and fill remaining space */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space between elements */
}

.product-title {
    font-size: 17px;
    font-weight: bold;
    color: #333;
    text-decoration: none !important;
    display: block;
    margin-bottom: 10px;
    flex: 1; /* Allow title to grow and take available space */
}

.product-title:hover {
    color: #007bff;
}

.product-price {
    font-size: 18px;
    color: #28a745;
    margin-top: 0px;    /* remove negative margin */
    margin-bottom: 8px;
    font-weight: bold;
    line-height: 1.4;   /* adds breathing space */
}


.original-price {
    text-decoration: line-through;
    color: #888;
    margin-right: 10px;
}

/* Add to Cart Button */
.btn-add-to-cart {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

.btn-add-to-cart:hover {
    background-color: #0056b3;
}

.btn-buy-now {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.btn-buy-now:hover {
    background-color: #0056b3;

}

/* Custom buttons for Select Options and Product Details */
.btn-custom {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff; /* তোমার কাস্টম কালার */
    color: #fff;
    border-radius: 5px;
    text-decoration: none !important;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    font-weight: 500;
    font-size: 1rem;
}

.btn-custom:hover {
    background-color: #0056b3;
    color: #fff;
}



.product-card {
    position: relative; /* relative needed for absolute positioning */
}

.product-card .stock-overlay {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    background: rgba(220, 53, 69, 0.85); /* Red translucent */
    color: white;
    font-weight: bold;
    font-size: 16px;
    padding: 6px 0; 
    pointer-events: none; /* so it doesn’t block clicks */
    z-index: 10;
    user-select: none;
    text-align: center;
    white-space: nowrap;
}




/* Responsive Adjustments */
@media (max-width: 1200px) {
    .col-lg-3 {
        width: 24%; /* 4 cards per row */
    }
    .btn-add-to-cart {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-buy-now {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-custom{
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
}

@media (max-width: 992px) {
    .col-md-6 {
        width: 48%; /* 2 cards per row */
    }
    .btn-add-to-cart {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-buy-now {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-custom{
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .col-sm-12 {
        width: 100%; /* 1 card per row */
    }

    .product-card {
        margin: 10px 0; /* Reduce margin for smaller screens */
    }

    .product-img {
        height: 250px; /* Slightly smaller image height for medium screens */
    }

    .product-title {
        font-size: 16px; /* Smaller font size */
    }

    .product-price {
        font-size: 18px; /* Smaller font size */
        font-weight: bold;
    }

    .btn-add-to-cart {
        padding: 8px 16px; /* Smaller button */
        font-size: 14px;
    }
    .btn-buy-now {
        padding: 8px 16px; /* Smaller button */
        font-size: 14px;
        
    }
}

@media (max-width: 576px) {
    .product-img {
        width: 100%;
        height: auto;
        max-height: 180px;
        object-fit: contain;
    }

      .col-6 {
        padding-left: 4px;
        padding-right: 4px;
        margin-bottom: 4px; /* reduced bottom space between rows */
    }
     .col-6.mb-4 {
        margin-bottom: 15px !important; /* or 4px for even tighter */
    }

    .row {
        margin-bottom: 0 !important; /* override any extra space */
    }

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

    .product-price {
        font-size: 15px; /* Smaller font size */
    }

    .btn-add-to-cart {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-buy-now {
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
    .btn-custom{
        padding: 6px 12px; /* Smaller button */
        font-size: 12px;
    }
}
}

/* ---------- iPhone specific fix ---------- */
/* Apply only on iOS Safari/Chrome */
@supports (-webkit-touch-callout: none) {
    /* Product grid wrapper */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* adjust spacing */
}

/* Each product card */
.product-card {
    flex: 1 1 calc(25% - 20px); /* 4 per row (desktop), responsive */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 380px; /* adjust to match your design */
    box-sizing: border-box;
}

/* Product image equal size */
.product-card img {
    width: 100%;
    height: 200px; /* fixed */
    object-fit: cover;
}

/* Info section grows equally */
.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

}

/* Make all product cards in the same row equal height */
.row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; /* stretch children equally */
}

.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.product-card {
    flex: 1; /* take full available height */
    display: flex;
    flex-direction: column;
}


