/************************************************************
 *  FAMILY MATRIX – LAYOUT GENERAL
 ************************************************************/

.product-family-fullwidth {
    width: 100%;
    margin: 20px 0;
    position: relative; /* pentru preview imagine */
}

.product-family-fullwidth .products-family-matrix {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* cutia albă cu tabelul */
.products-family-matrix {
    margin-top: 30px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 0;
    background: #fff;
    overflow-x: auto; /* fallback pentru ecrane mici */
}

/* Desktop – nu vrem scroll orizontal în cutie */
@media (min-width: 992px) {
    .products-family-matrix {
        overflow-x: visible;
    }
}

/************************************************************
 *  LEGENDĂ STATUS STOC
 ************************************************************/

.pf-legend {
    margin: 20px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.pf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pf-stock-square {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 2px;
}

/* culori status */
.pf-stock-green  { background: #47B137; }  /* disponibil imediat */
.pf-stock-yellow { background: #f1c40f; }  /* disponibil în 10 zile / depășire stoc */
.pf-stock-red    { background: #e74c3c; }  /* indisponibil */
.pf-stock-blue   { background: #1d92eb; }  /* ridicare din depozit */


/************************************************************
 *  TABEL – STRUCTURĂ & HEADER
 ************************************************************/

.family-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 960px;
}

/* Sticky header ca la RAJA */
.family-table thead th {
    top: 0;
    background: #f7f9fc;
    z-index: 3;
}

/* headere generice */
.family-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #d4dce6;
    color: #333;
}

/* primul rând de header (Cod produs / Pret per cantitate / etc.) */
.pf-top-header th {
    background: #f2f3f5;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

/* grupul de prețuri */
.pf-price-group {
    text-transform: none;
}

/* rândul doi – capetele de coloană pentru praguri */
.pf-price-header th.pf-price-step {
    background: #f7a623;   /* portocaliu */
    color: #fff;
    text-align: center;
    font-weight: 600;
}

/************************************************************
 *  TABEL – RÂNDURI ȘI CELULE
 ************************************************************/

/* celule body */
.family-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #ececec;
    vertical-align: middle;
    text-align: center;
    height: 75px;
}

/* zebra */
.family-table tbody tr:nth-child(even) {
    background-color: #fbfcff;
}

/* hover pe rând */
.family-table tbody tr:hover {
    background: #fafbff;
}

/* celula Cod produs (cu bulina de stoc) */
.pf-sku-cell {
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}

/* a doua coloană (ex. clapeta) un pic mai mică */
.family-table td:nth-child(2) {
    color: #666;
    font-size: 13px;
}

/* celulele de preț */
.pf-price-cell {
    text-align: right;
    white-space: nowrap;
}

/* portocaliu pentru produsele cu reducere */
.pf-price-cell.pf-discount {
    color: #f57c00;
    font-weight: 600;
}

/* doar celulele de preț care au data-price nenul devin clickabile */
.pf-price-cell[data-price]:not([data-price=""]) {
    cursor: pointer;
}

/* celula de preț activă (pragul curent) */
.pf-active-break {
    background: #d4f4d7;   /* verde deschis */
    font-weight: 700;
}

/* celula Pret total */
.pf-total-cell {
    text-align: right;
    font-weight: 600;
}


/************************************************************
 *  QTY: -  [input]  +  [CART]
 ************************************************************/

/* containerul pentru -  [input]  +  [cart] */
.pf-qty-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* inputul de cantitate */
.pf-qty-cell .family-qty {
    width: 70px;
    height: 44px;
    border: 1px solid #e3e5ea;
    background: #ffffff;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    padding: 0 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* butoanele - și + */
.pf-qty-btn {
    width: 30px;
    height: 44px;
    border: 1px solid #e3e5ea;
    background: #f7f8fb;
    font-size: 20px;
    line-height: 1;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;

    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}

.pf-qty-btn:hover:not(:disabled) {
    background: #eef0f7;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

/* când e dezactivat (- la qty 0) */
.pf-qty-btn:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

/* butonul Contactați-ne ( când deny_orders ) */
.pf-qty-unavailable {
    justify-content: flex-end;
}

.pf-contact-btn {
    display: inline-block;
    padding: 7px 30px;
    border-radius: 4px;
    background: #27ae60;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-size: 15px;
    margin-right: 35px;
}




.pf-contact-btn:hover {
    background: #1f8b4c;
}

.pf-cart-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 6px 14px rgba(39,168,216,0.45);
}

/************************************************************
 *  BUTON COȘ – PNG + ANIMAȚIE
 ************************************************************/

/* coș albastru cu PNG-ul tău */
.pf-cart-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: #27a8d8;
    cursor: pointer;
    
    background-image: url("https://human-creative.ro/img/shoppingcart.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 26px 26px;

    box-shadow: 0 6px 14px rgba(39, 168, 216, 0.45);
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}

.pf-cart-btn:hover {
    background-color: #2198c4;
    box-shadow: 0 9px 20px rgba(39, 168, 216, 0.65);
    transform: translateY(-1px);
}

/* stare de succes – icon "văzut" + verde (check.png) */
.pf-cart-btn.pf-cart-success {
    background-color: #27a8d8; /* verde */
    background-image: url("https://human-creative.ro/img/check.png");
}

/* animația de rotire */
.pf-cart-btn.pf-cart-animating {
    animation: pf-cart-spin 1.5s ease-in-out;
}

/* stare dezactivată – qty = 0 */
.pf-cart-btn:disabled,
.pf-cart-btn.pf-cart-disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
    transform: none;
}

/* fără efect de hover când e dezactivat */
.pf-cart-btn:disabled:hover,
.pf-cart-btn.pf-cart-disabled:hover {
    background-color: #27a8d8; /* rămâne culoarea de bază */
    box-shadow: none;
    transform: none;
}



@keyframes pf-cart-spin {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(-20deg); }
    100% { transform: rotate(0deg); }
}

/* dacă mai există vreo .pf-cart-icon în HTML, o ascundem */
.pf-cart-btn .pf-cart-icon {
    display: none;
}

/************************************************************
 *  PREVIEW IMAGINE LA HOVER
 ************************************************************/

.pf-preview {
    position: absolute;
    left: 0;
    transform: translateX(-100%); /* scoate boxul în stânga wrapper-ului */
    background: #fff;
    z-index: 50;
    display: none;      /* ascuns implicit */
    padding: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.pf-preview img {
    max-width: 70px;
    height: auto;
    display: block;
}

.pf-preview-show {
    display: block;
}

/************************************************************
 *  TOTAL GENERAL SUB TABEL
 ************************************************************/

.pf-grand-total-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #1d92eb;
    text-align: right;
    padding-right: 4%;
    margin-bottom: 20px;
}

/************************************************************
 *  SCROLLBAR CUSTOM (opțional, doar WebKit)
 ************************************************************/

.products-family-matrix::-webkit-scrollbar {
    height: 8px;
}

.products-family-matrix::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Mobile / tabletă – lăsăm min-width mai mare și scrollbar */
@media (max-width: 991px) {
    .family-table {
        min-width: 1100px;
    }
}
