/* ============================================
   Product Cards — Redesign v2
   Uses CSS vars: --primary-color, --secondary-color, --category-badge-color
   ============================================ */

/* ── Card container ── */
.fruite-item,
[class*="col-"] > div[style*="border:1px solid"] {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}
.fruite-item {
    background: #fff;
    border-radius: 14px !important;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06) !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}
.fruite-item:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* ── Image container ── */
.fruite-img {
    position: relative;
    overflow: hidden;
    background: #f9f9f9;
    aspect-ratio: 1 / 1;
}
.fruite-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.15s ease;
}
.fruite-item:hover .fruite-img img {
    transform: scale(1.05);
}

/* ── Category badge ── */
.category-badge {
    background-color: var(--category-badge-color, var(--secondary-color, #ffb524)) !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Sale badge ── */
.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: #ff3b5c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255,59,92,0.25);
}

/* ── Wishlist/Compare action buttons ── */
.card-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: 0.25s ease;
    opacity: 0;
    transform: scale(0.8);
}
.fruite-item:hover .card-action-btn {
    opacity: 1;
    transform: scale(1);
}
.card-action-btn:hover {
    background: var(--primary-color, #81c408);
    color: #fff !important;
    transform: scale(1.15) !important;
}

/* ── Image dots (cycling indicator) ── */
.img-cycle-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 4;
    opacity: 0;
    transition: 0.3s;
}
.fruite-item:hover .img-cycle-dots {
    opacity: 1;
}
.img-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.img-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ── Card body ── */
.card-content {
    padding: 18px 14px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.fruite-item h4,
.fruite-item .product-card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: #333;
    margin-bottom: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden;
    transition: color 0.2s;
    min-height: 2.7em;
    max-height: 2.7em;
}
.fruite-item:hover h4,
.fruite-item:hover .product-card-title {
    color: var(--primary-color, #81c408) !important;
}

/* Stars */
.product-rating,
.card-stars-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 6px;
    font-size: 11px;
}
.card-stars-row i { color: var(--secondary-color, #ffb524); }
.card-stars-row .rating-count { color: #ccc; font-weight: 500; margin-left: 2px; font-size: 11px; }

/* Description */
.card-desc-text {
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

/* ── Price footer ── */
.card-price-footer {
    margin-top: auto;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--secondary-color, #ffb524) 10%, #fff),
        color-mix(in srgb, var(--primary-color, #81c408) 8%, #fff)
    );
    border-top: 1.5px solid rgba(0,0,0,0.04);
}
.price-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.price-now {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color, #81c408);
    letter-spacing: -0.5px;
}
.price-was {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
}
.price-unit {
    font-size: 11px;
    color: #aaa;
}

/* Buy button */
.card-buy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: var(--primary-button, #8e6d6d) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);
    white-space: nowrap;
    text-decoration: none;
}
.card-buy-btn i { font-size: 13px; transition: 0.2s; }
.card-buy-btn:hover {
    background: var(--primary-button-hover, #6e5555) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    transform: translateY(-2px) scale(1.05);
}
.card-buy-btn:hover i { transform: rotate(-12deg) scale(1.15); }
.card-buy-btn:active { transform: translateY(0) scale(0.97); }

/* ── Portrait mode ── */
body.portrait-mode .fruite-img { aspect-ratio: 3 / 4 !important; }
body.portrait-mode .card-content { text-align: center; }
body.portrait-mode .card-stars-row { justify-content: center; }
body.portrait-mode .card-price-footer { flex-direction: column; align-items: center; gap: 8px; }
body.portrait-mode .price-block { justify-content: center; }
body.portrait-mode .fruite-item h4,
body.portrait-mode .product-card-title { font-size: 13px !important; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1199px) {
    .fruite-item h4 { font-size: 14px !important; }
}

@media (max-width: 991px) {
    .card-action-btn { opacity: 1; transform: scale(1); }
}

@media (max-width: 767px) {
    .row.g-4 { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }
    .fruite-item { border-radius: 12px !important; }
    .fruite-item:hover { transform: none; }
    .fruite-img img { transition: opacity 0.15s ease !important; }
    .fruite-item:hover .fruite-img img { transform: none; }
    
    .card-content { padding: 10px 10px 0; }
    .fruite-item h4,
    .fruite-item .product-card-title {
        font-size: 13px !important;
        min-height: 2.5em;
        max-height: 2.5em;
    }
    .card-desc-text { font-size: 11px; -webkit-line-clamp: 1; margin-bottom: 4px; }
    .card-stars-row { font-size: 10px; margin-bottom: 4px; }
    .card-price-footer {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .price-block { justify-content: center; }
    .price-now { font-size: 15px; }
    .price-was { font-size: 11px; }
    .card-buy-btn { justify-content: center; padding: 9px 14px; font-size: 12px; border-radius: 8px; }
    
    .card-action-btn { opacity: 1; transform: scale(1); width: 30px; height: 30px; font-size: 12px; }
    .category-badge { font-size: 9px !important; padding: 3px 8px !important; border-radius: 6px !important; }
    .sale-badge { font-size: 9px; padding: 3px 7px; border-radius: 6px; }
    
    body.portrait-mode .fruite-img { aspect-ratio: 3 / 4 !important; max-height: 360px !important; }
}

@media (max-width: 379px) {
    .card-desc-text { display: none; }
    .fruite-item h4 { font-size: 12px !important; }
    .price-now { font-size: 14px; }
    body.portrait-mode .fruite-img { aspect-ratio: 2 / 3 !important; }
}

/* ── Portrait responsive ── */
@media (min-width: 1400px) {
    body.portrait-mode .fruite-img { max-height: 440px !important; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    body.portrait-mode .fruite-img { max-height: 380px !important; }
}
@media (min-width: 992px) and (max-width: 1199px) {
    body.portrait-mode .fruite-img { max-height: 340px !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
    body.portrait-mode .fruite-img { max-height: 320px !important; }
}

/* ── Zoom-safe ── */
@media (min-resolution: 120dpi), (min-resolution: 1.25dppx) {
    .fruite-item h4 { font-size: max(12px, 0.85rem) !important; }
    .price-now { font-size: max(13px, 0.9rem) !important; }
    .card-buy-btn { font-size: max(11px, 0.75rem) !important; }
}
