/* ============================================
   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, #C79A3E)) !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, #56682F);
    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, #56682F) !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, #C79A3E); }
.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, #C79A3E) 10%, #fff),
        color-mix(in srgb, var(--primary-color, #56682F) 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, #56682F);
    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; }
}


/* Ensure <a> inside .fruite-img fills container so img height:100% works on all screens */
.fruite-item .fruite-img a,
.fruite-img > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Mobile: also ensure portrait images on shop.html don't exceed viewport */
@media (max-width: 767px) {
    body.portrait-mode .fruite-img { aspect-ratio: 3 / 4 !important; }
    /* For shop.html static inline-height images, clamp to portrait ratio on mobile */
    body.portrait-mode #productsContainer img[style*="height:420px"],
    body.portrait-mode #productsContainer img[style*="height: 420px"] {
        height: auto !important;
        aspect-ratio: 3 / 4 !important;
        max-height: 60vh;
    }
}

/* ════════════════════════════════════════════════════════════
   ФЕРМАТА — ПРЕРАБОТЕНИ ПРОДУКТОВИ КАРТИ (топла палитра + орнаменти)
   Добавено последно → печели над горните правила
   ════════════════════════════════════════════════════════════ */
.fruite-item{
  background:#FFFDF8 !important;
  border:1px solid #E8DDC6 !important;
  border-radius:18px !important;
  box-shadow:0 8px 26px rgba(60,72,32,.07) !important;
  overflow:hidden !important;
  transition:transform .3s ease, box-shadow .3s ease, border-color .3s ease !important;
}
.fruite-item:hover{
  transform:translateY(-5px) !important;
  box-shadow:0 18px 42px rgba(60,72,32,.15) !important;
  border-color:#D9C896 !important;
}
.fruite-img{ overflow:hidden !important; }
.fruite-img img{ transition:transform .55s ease !important; }
.fruite-item:hover .fruite-img img{ transform:scale(1.06) !important; }

.category-badge{
  background:#B05B2C !important; color:#fff !important;
  font-size:10px !important; font-weight:700 !important;
  letter-spacing:1.3px !important; text-transform:uppercase !important;
  padding:5px 12px !important; border-radius:50px !important;
  box-shadow:0 3px 10px rgba(140,70,34,.30) !important;
  border:1px solid rgba(255,255,255,.28) !important;
}

.card-content{ text-align:center !important; padding:16px 16px 0 !important; }

.product-card-title,
.fruite-item h4.product-card-title{
  font-family:'Cormorant Garamond','Fraunces',Georgia,serif !important;
  font-size:21px !important; font-weight:700 !important;
  line-height:1.18 !important; color:#3C4820 !important;
  margin:0 0 2px !important; letter-spacing:.2px !important; display:block !important; white-space:nowrap !important; overflow:hidden !important; text-overflow:ellipsis !important; min-height:0 !important; max-height:none !important;
}
.product-card-title a{ color:inherit !important; text-decoration:none !important; }
#bestsellersContainer .fruite-item h6.product-card-title,
#bestsellersContainer h6.product-card-title{
  font-family:'Cormorant Garamond','Fraunces',Georgia,serif !important;
  font-size:20px !important; font-weight:700 !important;
  line-height:1.2 !important; color:#3C4820 !important; letter-spacing:.2px !important;
  white-space:normal !important; text-overflow:clip !important;
  display:-webkit-box !important; -webkit-line-clamp:2 !important; -webkit-box-orient:vertical !important;
  overflow:hidden !important; min-height:1.5em !important; max-height:none !important; margin:0 0 4px !important;
}

.card-stars-row{ color:#C79A3E !important; font-size:12px !important; }
.card-stars-row .rating-count{ color:#bcb39c !important; margin-left:5px !important; }

.card-desc-text{
  font-family:'Cormorant Garamond',Georgia,serif !important;
  font-style:italic !important; font-size:17px !important;
  line-height:1.4 !important; color:#6E6A56 !important;
  display:-webkit-box !important; -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important; overflow:hidden !important;
  min-height:48px !important; margin:5px 4px 0 !important;
}

.card-content::after{
  content:"" !important; display:block !important;
  height:11px !important; width:66px !important; margin:9px auto 3px !important;
  background:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2066%2012'%3E%3Cline%20x1='2'%20y1='6'%20x2='27'%20y2='6'%20stroke='%23C79A3E'%20stroke-width='1.2'/%3E%3Cpath%20d='M33,2L37,6L33,10L29,6Z'%20fill='%23B05B2C'/%3E%3Cline%20x1='39'%20y1='6'%20x2='64'%20y2='6'%20stroke='%23C79A3E'%20stroke-width='1.2'/%3E%3C/svg%3E") center/contain no-repeat !important;
}

.card-price-footer{
  display:flex !important; flex-direction:row !important;
  justify-content:space-between !important; align-items:center !important;
  padding:14px 16px 16px !important; gap:10px !important;
}
.price-block{ display:flex !important; flex-direction:row !important; align-items:baseline !important; gap:4px !important; line-height:1.05 !important; flex-wrap:wrap !important; }
.price-was{ color:#b6ac95 !important; text-decoration:line-through !important; font-size:12px !important; }
.price-now{ font-family:'Cormorant Garamond',Georgia,serif !important; font-size:25px !important; font-weight:700 !important; color:#3C4820 !important; }
.price-unit{ color:#6E6A56 !important; font-size:12.5px !important; margin-top:0 !important; }

.fruite-item a.card-buy-btn,
.fruite-item a.card-buy-btn.add-to-cart-btn{
  display:inline-flex !important; align-items:center !important; justify-content:center !important; gap:7px !important;
  background:linear-gradient(135deg,#B96334 0%,#8C4622 100%) !important;
  color:#fff !important; border:none !important;
  padding:11px 20px !important; border-radius:50px !important;
  font-size:14px !important; font-weight:700 !important; letter-spacing:.3px !important;
  text-decoration:none !important;
  box-shadow:0 6px 16px rgba(140,70,34,.32) !important;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}
.fruite-item a.card-buy-btn:hover{ background:linear-gradient(135deg,#C2703F 0%,#7A3D1D 100%) !important; transform:translateY(-2px) !important; box-shadow:0 11px 24px rgba(140,70,34,.44) !important; filter:brightness(1.08) !important; color:#fff !important; }
.card-buy-btn:active{ transform:translateY(0) scale(.98) !important; }
.card-buy-btn i{ font-size:13px !important; transition:transform .2s !important; }
.card-buy-btn:hover i{ transform:rotate(-10deg) scale(1.12) !important; }

.card-action-btn{
  background:rgba(255,253,248,.92) !important;
  width:34px !important; height:34px !important; border-radius:50% !important;
  display:flex !important; align-items:center !important; justify-content:center !important;
  box-shadow:0 2px 8px rgba(0,0,0,.12) !important; border:1px solid #EFE7D3 !important;
}

@media (max-width:575.98px){
  .product-card-title,.fruite-item h4.product-card-title{ font-size:16px !important; }
  #bestsellersContainer .fruite-item h6.product-card-title,#bestsellersContainer h6.product-card-title{ font-size:16px !important; }
  .card-desc-text{ display:-webkit-box !important; font-size:15px !important; -webkit-line-clamp:2 !important; min-height:42px !important; }
  .price-now{ font-size:20px !important; }
  .card-content{ padding:13px 13px 0 !important; }
  .card-price-footer{ flex-direction:column !important; align-items:stretch !important; gap:9px !important; padding:11px 13px 14px !important; }
  .price-block{ align-items:center !important; }
  .card-buy-btn{ width:100% !important; padding:10px 15px !important; font-size:13px !important; }
  .category-badge{ font-size:9px !important; padding:4px 10px !important; }
}

/* social-proof 'купени днес' бейдж — пази от агресивния mobile font fix */
.fz-sold-badge{ font-weight:600 !important; font-size:11px !important; line-height:1.4 !important; white-space:nowrap !important; }
.fz-sold-badge i{ font-size:10px !important; }

/* ════════════════════════════════════════════════════════════ */
/* ЕДИНЕН ШРИФТ НА КАРТИТЕ — магазин/любими/търсене = като начало */
/* shop.js рисува .card-title-wrap / .card-desc-wrap без сериф;   */
/* изравняваме ги с .product-card-title / .card-desc-text         */
/* ════════════════════════════════════════════════════════════ */
.card-title-wrap,
.card-title-wrap a{
  font-family:'Cormorant Garamond','Fraunces',Georgia,serif !important;
  font-weight:700 !important;
  color:#3C4820 !important;
  letter-spacing:.2px !important;
  font-size:20px !important;
  line-height:1.2 !important;
}
.card-desc-wrap{
  font-family:'Cormorant Garamond',Georgia,serif !important;
  font-style:italic !important;
  color:#6E6A56 !important;
  font-size:16px !important;
  line-height:1.4 !important;
}
@media (max-width:575.98px){
  .card-title-wrap,.card-title-wrap a{ font-size:17px !important; }
  .card-desc-wrap{ font-size:14px !important; }
}
/* По-компактно: по-малко въздух над звездите и под описанието */
.card-title-wrap{ min-height:1.4em !important; max-height:2.6em !important; margin-bottom:2px !important; }
.card-stars-wrap{ margin-bottom:2px !important; }
.card-desc-wrap{ min-height:1.4em !important; max-height:2.8em !important; margin-bottom:2px !important; }

/* ============ UNIFIED CARD LAYOUT - all card types ============ */
/* Titles: same serif, size, tight (1 line min, 2 line max) */
.product-card-title,.fruite-item h4.product-card-title,
#bestsellersContainer h6.product-card-title,#bestsellersContainer .fruite-item h6.product-card-title,
#vegetableCarousel .vesiteam-item .vesiteam-item-title,#vegetableCarousel .vesiteam-item .vesiteam-item-title a,
.card-title-wrap,.card-title-wrap a{
  font-family:'Cormorant Garamond','Fraunces',Georgia,serif!important;
  font-weight:700!important;font-style:normal!important;color:#3C4820!important;
  font-size:20px!important;line-height:1.22!important;letter-spacing:.2px!important;
}
.product-card-title,
#vegetableCarousel .vesiteam-item .vesiteam-item-title,
.card-title-wrap,
#bestsellersContainer h6.product-card-title{
  min-height:1.3em!important;max-height:2.55em!important;margin:0 0 4px!important;
  display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;
  overflow:hidden!important;white-space:normal!important;text-overflow:clip!important;
}
/* Descriptions: same italic serif, tight */
.card-desc-text,.card-desc-wrap{
  font-family:'Cormorant Garamond',Georgia,serif!important;font-style:italic!important;
  color:#6E6A56!important;font-size:16px!important;line-height:1.32!important;
  min-height:1.3em!important;max-height:2.7em!important;margin:0 0 6px!important;
  display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;
}
/* Stars: tight */
.card-stars-row,.card-stars-wrap{margin:0 0 5px!important;}
@media (max-width:575.98px){
  .product-card-title,#vegetableCarousel .vesiteam-item .vesiteam-item-title,#vegetableCarousel .vesiteam-item .vesiteam-item-title a,.card-title-wrap,.card-title-wrap a,#bestsellersContainer h6.product-card-title{font-size:17px!important;}
  .card-desc-text,.card-desc-wrap{font-size:14px!important;}
}
