/* Product card wrapper */
.product-card-wrapper {
    position: relative;
}

/* Card styling */
.product-card-wrapper .card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.product-card-wrapper:hover .card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Image styling */
.product-card-wrapper .card-img-top {
    height: 200px;
    object-fit: cover;
    background-color: #f5f5f5;
}

/* Card body styling */
.product-card-wrapper .card-body {
    padding: 12px;
    background: #ffffff;
}

.product-card-wrapper .card-title {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.product-card-wrapper .card-text {
    font-size: 13px;
    color: #666;
}

/* Overlay - only covers the image */
.add-to-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.product-card-wrapper:hover .add-to-cart-overlay {
    opacity: 1;
}

/* Add to cart button */
.add-to-cart-btn {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-to-cart-btn:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}
/* Title styling - make it smaller */
.modal-header h1,
.modal-header .modal-title {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

/* Footer buttons styling - both red */
.mt-4 .btn-secondary,
.mt-4 .btn-primary {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    font-weight: 500;
}

.mt-4 .btn-secondary:hover,
.mt-4 .btn-primary:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.mt-4 .btn-secondary:active,
.mt-4 .btn-primary:active {
    background-color: #bd2130;
    border-color: #a71d2a;
}

/* Button size and spacing */
.btn-lg {
    font-size: 16px;
    padding: 12px 24px;
}
/* <CHANGE> Made cards smaller, reduced image height */
.product-card-wrapper .card-img-top {
    height: 150px;
    object-fit: cover;
    background-color: #f5f5f5;
}

/* <CHANGE> Reduced card body padding for compact look */
.product-card-wrapper .card-body {
    padding: 10px;
    background: #ffffff;
}

/* <CHANGE> Smaller title and changed font to modern sans-serif */
.product-card-wrapper .card-title {
    font-size: 12px;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* <CHANGE> Smaller text and changed font */
.product-card-wrapper .card-text {
    font-size: 12px;
    color: #666;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* <CHANGE> Updated overlay height to match new image height */
.add-to-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* ... existing code ... */

/* <CHANGE> Main page title styling */
h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 30px;
}

/* <CHANGE> Category titles styling */
h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -0.5px;
}

/* <CHANGE> Product card titles styling */
h5.card-title {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdance, sans-serif;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* <CHANGE> Apply modern font to entire page */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.add-to-cart-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important; /* optional: to match the border */
    color: #fff; /* optional: make the text white for contrast */
}

.add-to-cart-btn:hover {
    background-color: #c82333 !important; /* slightly darker on hover */
    border-color: #c82333 !important;
}
/* ===============================
   PAGINATION – COMPACT & RED
   =============================== */

.pagination {
    gap: 6px !important;
    justify-content: center;
}

/* Page buttons */
.pagination .page-link {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 2px solid #c41e3a !important;
    color: #c41e3a !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hover */
.pagination .page-link:hover {
    background-color: #c41e3a !important;
    color: #fff !important;
}

/* ACTIVE PAGE */
.pagination .page-item.active .page-link {
    background-color: #c41e3a !important;
    color: #fff !important;
    border-color: #c41e3a !important;
}

/* Disabled arrows */
.pagination .page-item.disabled .page-link {
    opacity: 0.4 !important;
    pointer-events: none !important;
}
.cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 360px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    opacity: 0;
    transform: translateX(120%);
    transition: all .4s ease;
    z-index: 9999;
    overflow: hidden;
}

.cart-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Header */
.cart-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Body */
.cart-toast-body {
    padding: 16px;
}

.cart-toast-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-toast-product img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-toast-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
}

.product-qty {
    font-size: 13px;
    color: #777;
}

.product-price {
    font-weight: 600;
    white-space: nowrap;
}

/* Button */
.cart-toast .btn-danger {
    background-color: #c41e3a !important;
    border: none !important;
    padding: 12px;
    font-weight: 600;
}

@media (max-width: 991px) {

    /* Cards: 3 per row instead of 4 */
    .product-card-wrapper {
        margin-bottom: 20px;
    }

    .product-card-wrapper .card-img-top {
        height: 140px;
    }

    .add-to-cart-overlay {
        height: 160px;
        background: rgba(0,0,0,.35);
    }

    /* Button always visible on mobile */
    .add-to-cart-btn {
        font-size: 14px;
        padding: 10px 18px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 17px;
    }
}

@media (max-width: 768px) {

    /* Cards become larger & touch-friendly */
    .product-card-wrapper .card {
        box-shadow: 0 3px 8px rgba(0,0,0,.12);
    }

    .product-card-wrapper .card-img-top {
        height: 160px;
    }

    .add-to-cart-overlay {
        height: 160px;
        background: rgba(0,0,0,.35);
    }

    /* Button always visible on mobile */
    .add-to-cart-btn {
        font-size: 14px;
        padding: 10px 18px;
    }

    /* Typography */
    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .product-card-wrapper .card-title {
        font-size: 13px;
    }

    .product-card-wrapper .card-text {
        font-size: 12px;
    }

    /* Footer buttons stack nicely */
    .mt-4.d-flex {
        flex-direction: column;
        gap: 12px;
    }

    .btn-lg {
        width: 100%;
    }
}

@media (max-width: 480px) {

    /* One card per row feel */
    .product-card-wrapper .card-img-top {
        height: 180px;
    }

    .add-to-cart-overlay {
        height: 180px;
    }

    /* Toast adapts to small screens */
    .cart-toast {
        width: calc(100% - 24px);
        right: 12px;
        top: 12px;
    }

    .cart-toast-product img {
        width: 52px;
        height: 52px;
    }

    .product-name {
        font-size: 13px;
    }

    .product-price {
        font-size: 13px;
    }
}
/* ===============================
   TOUCH DEVICES (mobile & tablet)
   =============================== */
@media (hover: none) and (pointer: coarse) {

    .add-to-cart-overlay {
        opacity: 1 !important;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.35);
    }

    .add-to-cart-btn {
        font-size: 14px;
        padding: 10px 18px;
    }
}
