.products-list-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 100px 16px;
}

.products-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.header-products {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: bolder;
}

/* link-ul catre cos (redirect -> /basket/{lang}) */
.basket-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 16px;
    border: 1px solid #562677;
    border-radius: 8px;
    color: #5c2880;
    transition: background .15s ease, color .15s ease;
}

.basket-link:hover {
    background: #dddddd;
    border: 1px solid #240638;
    color: #2a0747;
}

/* Desktop: 2 carduri pe rand. Cardul umple coloana (pana la 760px), deci are
   ~650-760px pe un laptop obisnuit si exact 760px la latimea maxima a paginii.
   minmax(0, ...) impiedica depasirea coloanei de catre continut lat. */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 760px));
    justify-content: center;
    gap: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f2f2f2;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
    gap: 8px;
}

.product-title {
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

/* rezumatul se afiseaza integral; cardurile de pe acelasi rand se aliniaza oricum,
   pentru ca .products-grid le intinde pe inaltimea celui mai inalt */
.product-summary {
    font-size: .95rem;
    color: #555;
    margin: 0;
    flex: 1;
    display: block;
    overflow-wrap: anywhere;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111;
    white-space: nowrap;
}

.buy-btn {
    border: none;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    background: #a44edd;
    color: #fff;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: background .15s ease;
}

.buy-btn:hover {
    background: #482361;
}

/* notificare "Adăugat în coș": o eticheta discreta (nu un buton) - la produsele fara formular
   inlocuieste butonul "Cumpără" (produsul e deja in cos). Produsele cu formular folosesc in
   schimb mesajul .product-success (acelasi loc/stil ca .product-error), ca acelasi produs
   poate fi cumparat din nou. */
.added-cart {
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid #b7e4c3;
    cursor: default;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    background: #e6f6ea;
    color: #1b6b34;
}

.added-cart.show {
    display: inline-flex;
}

.added-cart i {
    font-size: .85em;
}

.products-empty {
    text-align: center;
    color: #777;
    padding: 48px 0;
}

/* un singur produs: nu se mai afiseaza ca un card in grid, ci ca o pagina de produs -
   fara chenar/umbra/fundal de card, poza si detaliile alaturate, direct pe fundalul paginii */
.products-grid--single {
    grid-template-columns: minmax(0, 1600px);
}

.products-grid--single .product-card {
    flex-direction: row;
    align-items: flex-start;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 48px;
}

.products-grid--single .product-card:hover {
    transform: none;
    box-shadow: none;
}

.products-grid--single .product-image-container {
    width: 42%;
    aspect-ratio: auto;
    flex-shrink: 0;
    border-radius: 12px;
}

.products-grid--single .product-body {
    width: 58%;
    padding: 0;
    gap: 16px;
    justify-content: flex-start;
}

.products-grid--single .product-title {
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    padding-bottom: 16px;
    border-bottom: 1px solid #e6e6e6;
}

.products-grid--single .product-summary {
    font-size: 1.15rem;
    line-height: 1.6;
}

/* panoul de optiuni (formularul de customizare / variante de pret) ramane un panou
   distinct, dar mai discret decat un card imbricat intr-un card */
.products-grid--single .product-description {
    border: none;
    border-top: 1px solid #e6e6e6;
    border-radius: 0;
    background: transparent;
    padding: 20px 0 0;
}

@media (max-width: 900px) {
    .products-grid--single .product-card {
        flex-direction: column;
        gap: 24px;
    }

    .products-grid--single .product-image-container {
        width: 100%;
        aspect-ratio: 16 / 10;
    }

    .products-grid--single .product-body {
        width: 100%;
    }
}

/* sub breakpoint-ul de navbar (hamburger) antetul e mai jos, deci padding mai mic;
   padding-bottom trebuie sa ramana peste cei 60px cu care footer-ul (.footer-info) se
   trage in sus peste continut (margin-top:-60px, vezi footer.css), altfel ultimul rand
   de produse ajunge sub cardul rotunjit al footerului */
@media (max-width: 900px) {
    .products-list-content {
        padding: 88px 16px 80px;
    }
}

/* telefoane: un card pe rand, footer-ul cardului pe verticala */
@media (max-width: 700px) {
    .products-grid {
        grid-template-columns: minmax(0, 500px);
        gap: 18px;
    }

    /* produsul unic ramane pe toata latimea disponibila, nu limitat la 500px ca in grid */
    .products-grid--single {
        grid-template-columns: minmax(0, 100%);
    }

    .products-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 24px;
    }

    .basket-link {
        justify-content: center;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-price {
        font-size: 1.15rem;
    }

    .buy-btn,
    .added-cart {
        width: 100%;
    }

    .added-cart.show {
        display: block;
    }
}

@media (max-width: 420px) {
    .products-list-content {
        padding: 80px 12px 68px;
    }

    .product-body {
        padding: 14px;
    }
}

/* ---- cantitate + actiuni pe card (camp cantitate / customizare produs) ---- */
.product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-label {
    font-size: .9rem;
    color: #555;
    font-weight: 600;
}

.qty-input {
    width: 64px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.product-error {
    flex-basis: 100%;
    width: 100%;
    margin: 4px 0 0;
    color: #b71c1c;
    font-size: .9rem;
}

.product-error[hidden] {
    display: none;
}

/* confirmare "adaugat in cos" pentru produsele cu formular - acelasi loc/forma ca .product-error,
   doar verde in loc de rosu */
.product-success {
    flex-basis: 100%;
    width: 100%;
    margin: 4px 0 0;
    color: #1b6b34;
    font-size: .9rem;
    font-weight: 600;
}

.product-success[hidden] {
    display: none;
}

/* .product-description (continutul HTML al articolului) e sursa formularului de customizare;
   ramane sub rezumat in card, ascuns cu atributul "hidden" pana la primul click pe "Cumpără". */
.product-description[hidden] {
    display: none;
}

.product-description {
    margin-top: 4px;
    padding: 14px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #faf8fc;
}

.product-description form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-description label {
    font-size: .9rem;
    font-weight: 600;
    color: #444;
    margin-top: 6px;
}

.product-description input,
.product-description select,
.product-description textarea {
    padding: 9px 11px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: .95rem;
    width: 100%;
}

.product-description input:invalid {
    border-color: #b71c1c;
}

.product-computed-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111;
    white-space: nowrap;
}

.product-computed-price[hidden] {
    display: none;
}

@media (max-width: 700px) {
    .product-actions {
        width: 100%;
        justify-content: space-between;
    }
}
