/* =============================================================
   PRODUCTBOX MOBILE – Fix complet pentru card vizibil pe mobil
   Fișier: NOVAChild/themes/my-nova/css/productbox-mobile.css
   Adaugă în layout/base.tpl sau prin JTL CSS Manager
   ============================================================= */

/* ----------------------------------------------------------
   1. RIBBON / BADGE – poziție corectă pe mobile
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .cro-ribbon {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    font-size: 10px !important;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ribbon-top-angebot {
    background: #ff4444;
    color: #fff;
  }

  .ribbon-angebot {
    background: #ff9800;
    color: #fff;
  }

  .ribbon-bestseller {
    background: #f59e0b;
    color: #fff;
  }

  .ribbon-neu {
    background: #10b981;
    color: #fff;
  }
}

/* ----------------------------------------------------------
   2. IMAGINEA – înălțime redusă pe mobile pentru mai mult spațiu
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .productbox-image-container {
    width: 100% !important;
    height: 160px !important;
    overflow: hidden;
    margin: 0;
    padding: 6px !important;
  }

  .productbox-images {
    width: 100% !important;
    height: 100% !important;
    border-radius: 10px !important;
  }

  .productbox-images img.first,
  .productbox-images img.second {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
}

/* ----------------------------------------------------------
   3. NICOTINE BADGE – repoziționat față de noua înălțime imagine
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .cro-nicotine-badge,
  .nicotine-badge,
  .productbox .nicotine-badge,
  .productbox .cro-nicotine-badge {
    top: auto !important;
    bottom: 6px !important;
    left: 10px !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 20px !important;
    background: #06c1f0 !important;
    color: #fff !important;
    font-weight: 700;
    z-index: 11;
    white-space: nowrap;
    position: absolute;
  }
}

/* ----------------------------------------------------------
   4. PRODUCTBOX INNER – compact, fără spațiu pierdut
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .productbox {
    border-radius: 12px !important;
    padding: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .productbox-inner {
    padding: 6px 8px 8px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    gap: 0 !important;
  }

  /* Titlu – 2 linii max, font mai mic */
  .productbox-header {
    margin-bottom: 3px !important;
    padding: 0 !important;
  }

  .productbox-title,
  .productbox-title__link {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    min-height: auto !important;
    max-height: 2.5em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    color: #0a0a0a !important;
    text-decoration: none !important;
    margin: 0 !important;
  }
}

/* ----------------------------------------------------------
   5. DELIVERY STATUS – text complet, rupt după " - "
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .delivery-urgency-row {
    display: block !important;        /* nu mai e flex → old-price nu mai e împins la dreapta */
    margin-bottom: 3px !important;
  }

  /* Delivery status wrapper */
  .item-delivery-status,
  .delivery-status {
    display: block !important;
    font-size: 0.65rem !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  /* Textul din interior (small/span) – rupere după " - " */
  .item-delivery-status small,
  .item-delivery-status .delivery-text-inline,
  .delivery-status small {
    white-space: normal !important;
    /* Forțează ruperea rândului imediat după " - " */
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    display: inline !important;
  }

  /* Urgency badge */
  .cro-urgency-inline {
    display: inline-block !important;
    font-size: 0.62rem !important;
    margin-top: 2px !important;
  }

  .cro-urgency-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff6b35;
    margin-right: 3px;
    vertical-align: middle;
  }
}

/* ----------------------------------------------------------
   6. PRICE WRAPPER – layout curat pe mobile
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .price-wrapper {
    display: block !important;        /* anulează orice flex moștenit care centrează */
    padding: 3px 0 4px 0 !important;
    margin-bottom: 4px !important;
    text-align: left !important;
  }

  /* price-row: coloana stânga (prețuri) + badge dreapta, aliniate jos */
  .price-row {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  /* Coloana stânga: old-price deasupra, productbox-price dedesubt */
  .price-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  /* Prețul vechi (tăiat) – 12px, gri discret, aliniat stânga */
  .price-left .old-price,
  .price-row .old-price {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #aaa !important;
    text-decoration: line-through !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    display: block !important;
    text-align: left !important;
  }

  /* Badge – align-self: flex-end îl ancorează la baza price-row,
     care coincide cu baza lui productbox-price (ultimul element din price-left) */
  .price-row .cro-price-badge {
    align-self: flex-end !important;
    margin-bottom: 0 !important;
  }

  /* Prețul curent – mare, bold, vizibil */
  .price-left .productbox-price,
  .price-row .productbox-price {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #00bcd4 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: block !important;
  }

  /* Badge savings – dimensiuni și stil */
  .cro-price-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    padding: 3px 7px !important;
    border-radius: 20px !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    max-width: 88px !important;
    text-align: center !important;
    margin-bottom: 0 !important;
  }

  .cro-price-badge.save-eur,
  .cro-price-badge.save-pct {
    background: #10b981 !important;
    color: #fff !important;
  }

  /* "Sehr Beliebt" – ascuns pe mobile dacă există deja ribbon Bestseller */
  .productbox[data-ribbon-type="bestseller"] .cro-price-badge.popular {
    display: none !important;
  }

  .cro-price-badge.popular {
    background: #f59e0b !important;
    color: #fff !important;
  }
}

/* ----------------------------------------------------------
   7. FORM COUNTER + WARENKORB – un singur rând pe mobile
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .form-row {
    margin-top: auto !important;
    padding-top: 4px !important;
  }

  /* Containerul principal: counter + buton cart pe același rând */
  .input-group.form-counter {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 36px !important;
    border: 0.75px solid #03cdff !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    padding: 0 !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Butoanele minus/plus */
  .form-counter .input-group-prepend,
  .form-counter .input-group-append:not(:last-of-type) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    flex-shrink: 0;
  }

  .form-counter .btn-outline-secondary {
    all: unset !important;
    width: 32px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    color: #1d1d1d !important;
    cursor: pointer !important;
    background: transparent !important;
  }

  /* Input cantitate */
  .form-counter input.quantity-input,
  .form-counter input[name="anzahl"] {
    flex: 1 1 auto !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    height: 100% !important;
    padding: 0 !important;
    pointer-events: none !important;
  }

  /* Buton coș (ultimul element în form-counter) */
  .form-counter .input-group-append:last-of-type {
    width: 44px !important;
    height: 100% !important;
    background: #03cdff !important;
    border-left: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .form-counter .input-group-append:last-of-type .btn,
  .form-counter .input-group-append:last-of-type button {
    all: unset !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    cursor: pointer !important;
  }

  .form-counter .input-group-append:last-of-type .btn-text {
    display: none !important;
  }

  .form-counter .input-group-append:last-of-type i {
    font-size: 14px !important;
  }

  /* Buton "Zum Artikel" pentru produse out of stock */
  .btn-zumartikel {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    border-radius: 10px !important;
    width: 100% !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    background: #06c4da !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
  }

  /* Ascunde rândul suplimentar "Zum Artikel" pe desktop (deja e ascuns cu d-none d-sm-block) */
  .form-row .col-12.mt-2.d-none.d-sm-block {
    display: none !important;
  }

  /* Ascunde form-counter pentru out of stock */
  .form-row.is-outofstock .input-group.form-counter {
    display: none !important;
  }

  .form-row.is-outofstock .btn-zumartikel {
    display: flex !important;
  }
}

/* ----------------------------------------------------------
   8. SLICK SLIDER – carduri în slider pe mobile
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .slick-slide .productbox {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    padding-bottom: 0.5rem !important;
  }

  .slick-slide .productbox-inner {
    flex: 1 !important;
    padding-bottom: 6px !important;
  }

  .slick-slide .form-row,
  .slick-slide .form-counter {
    margin-bottom: 4px !important;
    padding-bottom: 0 !important;
  }
}

/* ----------------------------------------------------------
   9. GRID PRODUCTLIST – 2 coloane curate pe mobile
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  /* Asigură că cele 2 coloane au height egal */
  .productlist-items .row {
    align-items: stretch !important;
  }

  .productlist-items .col-6,
  .productlist-items [class*="col-6"] {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 8px !important;
  }

  .productlist-items .col-6 > .productbox,
  .productlist-items [class*="col-6"] > .productbox {
    flex: 1 1 auto !important;
  }
}

/* ----------------------------------------------------------
   10. WISHLIST ICON – corect poziționat
   ---------------------------------------------------------- */
@media (max-width: 575.98px) {
  .productbox-icons-wrapper {
    top: 0 !important;
    right: 0 !important;
    padding: 4px !important;
  }

  .productbox .wishlist-style,
  .productbox .wishlist-guest-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 4px !important;
    background: rgba(255,255,255,0.85) !important;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .productbox .wishlist-style img,
  .productbox .wishlist-guest-btn img {
    width: 14px !important;
    height: 14px !important;
  }
}

/* ----------------------------------------------------------
   DESKTOP ONLY – Preț final mai mare și bold
   Mobile (max 575.98px) nu este atins
   ---------------------------------------------------------- */
@media (min-width: 576px) {

  .productbox-price,
  .productbox .productbox-price {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
  }
}