﻿/* ===========================================
   PRODUCT CARD
=========================================== */

.product-card {
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.05), 0 14px 28px rgba(0,0,0,.05);
    transition: all .25s ease;
}

    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 18px rgba(0,0,0,.10), 0 20px 40px rgba(0,0,0,.08);
        border-color: #d7f0dd;
    }

/* Whole card clickable */

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-title-link {
    text-decoration: none;
    color: inherit;
}

    .product-title-link:hover .product-title {
        color: #198754;
    }

/* ================= IMAGE ================= */

.product-img-wrapper {
    overflow: hidden;
    background: #f6f8f7;
    position: relative;
}

.product-img {
    width: 100%;
    aspect-ratio: 1/.72;
    object-fit: cover;
    transition: transform .4s;
    border-radius: 16px 16px 0 0;
}

.product-card:hover .product-img {
    transform: scale(1.08);
}

.product-img-wrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55px;
    background: linear-gradient( to top, rgba(0,0,0,.18), transparent );
}

/* ================= BADGE ================= */

.badge-new {
    background: linear-gradient(135deg,#ff5722,#ff9800);
    font-weight: 700;
    border-radius: 30px;
    padding: 5px 10px;
    box-shadow: 0 5px 12px rgba(255,87,34,.35);
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 6;
}

/* ================= ICONS ================= */

.wishlist-btn,
.view-btn {
    width: 38px;
    height: 38px;
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: .25s;
    background: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 8px 18px rgba(13,110,253,.30);
}

    .wishlist-btn.active {
        background: #e53935;
        color: #fff;
    }

.wishlist-btn {
    top: 14px;
    right: 14px;
}

.view-btn {
    top: 58px;
    left: 14px;
}

    .wishlist-btn:hover,
    .view-btn:hover {
        background: #0b5ed7;
        color: #fff;
        transform: scale(1.08);
    }

.wishlist-btn {
    top: 14px;
    right: 14px;
}

.view-btn {
    top: 58px;
    left: 14px;
}

/* ================= BODY ================= */

.product-body {
    display: flex;
    flex-direction: column;
    padding: 12px;
    flex: 1;
}

/* ================= TITLE ================= */

.product-title {
    font-size: 18px;
    font-weight: 700;
    color: #202124;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: calc(1.3em * 2);
    max-height: calc(1.3em * 2);
    overflow: hidden;
    transition: .2s;
}
/* ================= RATING ================= */

.rating-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.rating-count {
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
}

.stars {
    position: relative;
    color: #9ca3af;
    font-size: 14px;
}

    .stars:before {
        content: "★★★★★";
    }

.stars-fill {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #ffb400;
}

    .stars-fill:before {
        content: "★★★★★";
    }

/* ================= TYPE ================= */

.plant-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f5e9;
    color: #166534;
    padding: 4px 10px;
    border-radius: 20px;
    width: max-content;
    font-size: 12px;
    font-weight: 600;
}

/* ================= FOOTER ================= */

.bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.price-box {
    flex: 0 0 auto;
}

.seller-box {
    min-width: 0;
    flex: 1;
    text-align: right;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #c45100;
    line-height: 1;
}

.seller-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2E7D32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-city {
    font-size: 11px;
    color: #666;
}

#galleryModal .modal-content {
    border-radius: 18px;
    overflow: hidden;
}

#galleryModal .modal-body {
    background: #f8f9fa;
}

#galleryModalImage {
    max-height: 75vh;
    width: auto;
    object-fit: contain;
}

/* ==========================================
   PLANTSPK PRODUCT CARD IMPROVEMENTS
========================================== */

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
}

    .product-img-wrapper .card-link {
        display: block;
        width: 100%;
        line-height: 0;
    }

.product-img {
    display: block;
    width: 100%;
    height: auto;
}

/* Overlay should not block clicks */
.product-img-wrapper::after {
    pointer-events: none;
}

/* Wishlist and Preview */
.product-img-wrapper .wishlist-btn,
.product-img-wrapper .view-btn {
    position: absolute;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

/* Active Wishlist */
.wishlist-btn.active,
.wishlist-btn.active:hover {
    background: #e53935;
    color: #fff;
    box-shadow: 0 5px 15px rgba(229,57,53,.3);
}

/* Keyboard focus */
.wishlist-btn:focus-visible,
.view-btn:focus-visible {
    outline: 2px solid #198754;
    outline-offset: 2px;
}

/* Product body */
.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Seller and price */
.bottom-row {
    margin-top: auto;
}

/* Login Modal */
.wishlist-login-modal {
    border: none;
    border-radius: 18px;
    overflow: hidden;
}

.wishlist-login-icon {
    width: 65px;
    height: 65px;
    background: #ffebee;
    color: #e53935;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: auto;
}

.product-img-wrapper .card-link {
    display: block;
    width: 100%;
    line-height: 0;
}

.product-img-wrapper::after {
    pointer-events: none;
}

.product-img-wrapper .wishlist-btn,
.product-img-wrapper .view-btn {
    position: absolute;
    z-index: 10;
}
#galleryModal .modal-content {
    border-radius: 18px;
    overflow: hidden;
}

#galleryModal .modal-body {
    background: #f8f9fa;
}

#galleryModalImage {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
}


/* Seller Name + Verified Badge */

.seller-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
}

    .seller-name-line .seller-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.seller-verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0d6efd;
    font-size: 15px;
    line-height: 1;
}

    .seller-verified-icon i {
        color: #0d6efd;
    }



/* =================================
   CATALOG PAGINATION
================================= */

.catalog-pagination {
    margin: 35px 0 25px;
}

    .catalog-pagination .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 7px;
        margin: 0;
    }

    .catalog-pagination .page-item {
        margin: 0;
    }

    .catalog-pagination .page-link {
        min-width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
        border: 1px solid #dce8df;
        border-radius: 9px !important;
        background: #fff;
        color: #198754;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
        transition: all 0.2s ease;
    }

        .catalog-pagination .page-link:hover {
            background: #eaf6ed;
            border-color: #198754;
            color: #146c43;
            transform: translateY(-2px);
        }

    .catalog-pagination .page-item.active .page-link {
        background: #198754;
        border-color: #198754;
        color: #fff;
        box-shadow: 0 4px 10px rgba(25, 135, 84, 0.22);
    }

    .catalog-pagination .page-item.disabled .page-link {
        background: #f5f7f5;
        color: #adb5bd;
        border-color: #e9ecef;
        cursor: not-allowed;
        box-shadow: none;
    }


/* ===========================
   Desktop (992px+)
=========================== */

@media (min-width:992px) {

    .product-card {
        border-radius: 12px;
    }

    .product-img {
        aspect-ratio: 1 / 0.68;
    }

    .product-body {
        padding: 12px;
    }

    .product-title {
        font-size: 19px;
        line-height: 1.25;
        margin-bottom: 6px;
    }

    .rating-row {
        margin: 3px 0;
        gap: 4px;
    }

    .stars {
        font-size: 13px;
    }

    .rating-count {
        font-size: 11px;
    }

    .plant-type {
        font-size: 12px;
        margin: 4px 0 8px;
    }

    .bottom-row {
        gap: 8px;
        margin-top: 10px;
    }

    .product-price {
        font-size: 24px;
        line-height: 1;
        margin: 0;
    }

    .seller-name {
        font-size: 14px;
        line-height: 1.2;
    }

    .seller-city {
        font-size: 11px;
    }

    .wishlist-btn,
    .view-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .view-btn {
        top: 46px;
    }

    .badge-new {
        font-size: 10px;
        padding: 3px 8px;
    }
}




@media (max-width: 576px) {
  
    .product-card {
        border-radius: 12px;
    }

    .product-body {
        padding: 8px;
    }

    .product-title {
        font-size: 19px;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .rating-row {
        margin: 2px 0;
        gap: 3px;
    }

    .stars {
        font-size: 11px;
    }

    .rating-count {
        font-size: 10px;
    }

    .plant-type {
        font-size: 11px;
        margin: 2px 0 6px;
    }

    .bottom-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-top: 8px;
    }

    .product-price {
        font-size: 22px;
        line-height: 1;
        margin: 0;
    }

    .seller-row {
        width: 100%;
        border-top: 1px solid #f2f2f2;
        padding-top: 6px;
        margin-top: 0;
    }

    .seller-name {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .seller-city {
        font-size: 10px;
    }

    .seller-city {
        font-size: 10px;
        line-height: 1.1;
    }

    .wishlist-btn,
    .view-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
        top: 10px;
        right: 10px;
    }

    .view-btn {
        top: 44px;
        left: 10px;
    }

    .badge-new {
        font-size: 8px;
        padding: 2px 6px;
    }
    .product-card {
        border-radius: 12px;
    }

    .product-body {
        padding: 8px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-price {
        font-size: 18px;
    }

    .wishlist-btn,
    .view-btn {
        width: 30px;
        height: 30px;
    }

    .bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .seller-row {
        width: 100%;
    }

    .catalog-pagination {
        margin: 25px 0 20px;
    }

        .catalog-pagination .pagination {
            gap: 5px;
        }

        .catalog-pagination .page-link {
            min-width: 38px;
            height: 38px;
            padding: 6px 11px;
            font-size: 13px;
        }
}

/* =========================================
   PRODUCT CARD - PRICE & SELLER FIX
========================================= */

.product-card {
    min-width: 0;
}

.product-body {
    min-width: 0;
    overflow: hidden;
}

.bottom-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.product-price {
    flex: 0 1 45%;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.15;
    color: #c45100;
    overflow-wrap: anywhere;
}

    .product-price span {
        display: block;
    }

.seller-row {
    flex: 1 1 55%;
    min-width: 0;
    max-width: 55%;
    text-align: right;
    overflow: hidden;
}

.seller-name-line {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

    .seller-name-line .seller-name {
        display: block;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.seller-city {
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile */
@media (max-width: 576px) {

    .bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 7px;
    }

    .product-price {
        flex: none;
        width: 100%;
        font-size: 17px;
    }

    .seller-row {
        width: 100%;
        max-width: 100%;
        text-align: left;
        border-top: 1px solid #f2f2f2;
        padding-top: 6px;
    }

    .seller-name-line {
        justify-content: flex-start;
    }

        .seller-name-line .seller-name {
            font-size: 11px;
        }
}