
.product-list-wrapper {
    width: 100%;
    display: flex;
}

/* Custom dropdown - shared style for sort + page size */
.custom-sort {
    position: relative;
    width: 160px;
}

.custom-sort--small {
    width: 80px;
}

.custom-sort-btn {
    width: 100%;
    height: 32px;
    padding: 0 28px 0 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.42);
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    color: #000;
    text-align: left;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: border-color 0.2s;
}

.custom-sort-btn:hover {
    border-color: rgba(0,0,0,0.87);
}

.custom-sort.open .custom-sort-btn {
    border-color: var(--primary);
}

.custom-sort-value {
    flex: 1 1 auto;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-sort-caret {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #555;
    pointer-events: none;
}

.custom-sort-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
}

.custom-sort-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 101;
    overflow: hidden;
}

.custom-sort-item {
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
}

.custom-sort-item:hover {
    background-color: #f5f5f5;
    color: var(--primary);
}

.custom-sort-item.active {
    background-color: rgba(255, 193, 7, 0.15);
    font-weight: 600;
}

.products-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Pe paginile de categorii (cu sidebar) afișăm 3 produse pe rând ca să încapă bine */
.index-container .products-wrapper {
    grid-template-columns: repeat(3, 1fr);
}

.full-row.products-wrapper {
    grid-template-columns: 1fr !important;
}

#checkout-details {
    margin-top: 10px;
}

    #checkout-details form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

.product-item {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    flex-wrap: wrap;
    transition: box-shadow 0.3s, border-color 0.3s;
    overflow: hidden;
}

.product-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.full-row .product-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 15px;
    width: 100%;
    flex-direction: row;
    gap: 10px;
}

.full-row .product-img {
    flex: 0 1 200px;
}
.product-img {
    position: relative;
}
.product-img img {
    height: 170px;
    width: 100%;
    object-fit: contain;
}
.product-img .video-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    position: absolute;
    bottom: 15px;
    left: 5px;
    color: var(--secondary);
    transition: 0.7s;
}
    .product-img:hover .video-icon {
        color: var(--primary);
    }
.product-title {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
    line-height: 18px;
    text-align: center;
}

.product-description-wrap, .producer-info-wrap, .product-price-wrap {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.product-description-wrap {
    margin-bottom: auto;
    flex-grow: 1;
}

.full-row .product-description-wrap, .full-row .product-price-wrap {
    flex-basis: 180px;
}

.full-row .product-price-wrap {
    margin-left: auto;
    text-align: right;
}

.full-row .producer-info-wrap {
    justify-content: space-between;
    align-items: center;
    flex-basis: 180px;
}

.product-price-wrap {
    justify-content: space-between;
}

.full-row .producer-info {
    display: contents;
    flex-basis: 180px;
}

.product-description {
    display: none;
}

.full-row .product-description {
    display: block;
}

.product-toolbar {
}

    .product-toolbar .toolbar {
        display: flex;
        justify-content: space-between;
        border-bottom: 2px solid var(--primary);
        padding: 8px 14px;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 12px;
        background-color: var(--tertiary);
        color: #000;
        min-height: 48px;
    }

        .product-toolbar .toolbar .mud-select .mud-input-slot {
            padding: 4px 8px !important;
            min-height: 32px;
        }

        .product-toolbar .toolbar .mud-input-control {
            background-color: #fff;
            border-radius: var(--mud-default-borderradius);
            margin-top: 0 !important;
        }

        .product-toolbar .toolbar .mud-select {
            flex-grow: 0;
        }

/* Label static deasupra dropdown-ului (înlocuiește floating label) */
.toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toolbar-field-label {
    font-size: 0.7rem;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1;
    padding-left: 2px;
}

/* Ascundem orice label intern MudBlazor care ar mai apărea */
.toolbar-field .mud-input-label {
    display: none !important;
}

.show-pager {
    width: 144px; /* ≈ 90 × 1.6 (golden ratio) */
    font-size: 0.875rem;
}

.product-toolbar .toolbar .mud-icon-button {
    padding: 5px !important;
    color: #000;
}

/* Buton activ (Filled) - galben cu icon negru */
.product-toolbar .toolbar .mud-icon-button.mud-button-filled,
.product-toolbar .toolbar .mud-icon-button[class*="mud-button-filled"] {
    background-color: var(--primary) !important;
    color: #000 !important;
    box-shadow: none !important;
}

.product-toolbar .toolbar .mud-icon-button.mud-button-filled:hover {
    background-color: #ffcd38 !important;
}

/* Buton inactiv (Text) - icon negru, hover galben */
.product-toolbar .toolbar .mud-icon-button.mud-button-text,
.product-toolbar .toolbar .mud-icon-button:not(.mud-button-filled) {
    color: #000 !important;
}

.product-toolbar .toolbar .mud-icon-button.mud-button-text:hover,
.product-toolbar .toolbar .mud-icon-button:not(.mud-button-filled):hover {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: var(--primary) !important;
}

/* Buton Filter (text + starticon) */
.product-toolbar .toolbar .mud-button-filled-primary.filter_btn,
.product-toolbar .toolbar .mud-button-filled {
    background-color: var(--primary) !important;
    color: #000 !important;
    font-weight: 600;
    box-shadow: none;
}

.product-toolbar .mud-input-control.mud-input-control-margin-dense {
    margin: 0 !important;
}

.filter-toolbar {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.product-wrapper {
    background-color: #f7f7f7;
    border-radius: 4px;
    overflow: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

    .product-wrapper img {
        width: 100%;
        height: auto;
        -o-object-fit: cover;
        object-fit: cover;
    }

.product-price {
    margin: 0 10px;
    font-weight: bold;
    font-size: 1.2rem;
}


.product-description {
    text-align: left;
    margin-bottom: 1rem;
}


.product-grid {
    display: -ms-grid;
    display: grid;
    grid-gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.product-filter-section {
    padding: 8px 12px 12px 12px;
    margin: 0 10px 10px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: 0.3s !important;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
}

    .product-filter-section .mud-typography {
        font-size: 0.9rem;
    }

    .product-filter-section .mud-icon-button {
        padding: 6px;
    }

.product-list-wrapper .drawer-container {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.product-list-wrapper .mud-drawer {
    background-color: var(--tertiary);
    z-index: 98 !important;
}

.special-price-container {
    position: absolute;
    top: 10px;
    background-color: var(--primary);
    color: #000;
    font-weight: bold;
    width: 50%;
    padding: 4px 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    left: 0;
    z-index: 2;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Date tehnice hover overlay */
.product-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.product-tech-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(from var(--tertiary) r g b / 0.96);
    color: #000;
    padding: 10px 12px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255,255,255,0.1);
}

.product-item:hover .product-tech-overlay {
    transform: translateY(0);
}

.product-tech-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.35);
}

.product-tech-content {
    font-size: 11px;
    line-height: 1.5;
    color: #000;
    word-break: break-word;
    white-space: normal;
}

.product-tech-content span {
    font-size: 11px !important;
    line-height: 1.5 !important;
}

.product-tech-content br {
    display: block;
    margin-bottom: 3px;
}

.product-tech-content > div {
    margin-bottom: 2px;
}

.product-tech-content blockquote {
    margin: 2px 0 2px 6px !important;
    padding-left: 6px !important;
    border-left: 2px solid rgba(255, 193, 7, 0.3) !important;
}

.producer-info img {
    width: 100%;
    max-width: 80px;
    max-height: 40px;
    object-fit: contain;
}

.full-row .special-price-container {
    width: 15%;
}

.special-price-container:last-child .special-price {
    border-bottom-right-radius: 3px;
    box-shadow: 0 2px 6px -2px rgb(0 0 0 / 40%);
}

.special-price-container:first-child .special-price {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.product-wishlist {
    position: absolute;
    top: 0px;
    right: 0px;
}

.full-row .product-wishlist {
    position: relative;
}

.product-filters {
    min-width: 250px;
    height: fit-content;
    position: sticky;
    top: 50px;
}

@media (max-width: 1324px) {
    .products-wrapper {
        grid-template-columns: repeat(3, 1fr);
        margin-left: 0px !important;
    }
    .index-container .products-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .product-filters .mud-toolbar {
        display: none;
    }
    .filter_btn {
        display: none;
    }
}

@media (max-width: 1024px) {
    .product-filters .mud-toolbar {
        background-color: #fff;
        margin-bottom: 10px;
    }

    .cart-drawer:before, .cart-drawer:after {
        padding-left: 0 !important;
    }

    .product-filters {
        position: fixed;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        width: 100vw;
        transform: translateX(-100%);
        transition: 0.3s;
        left: 0;
        z-index: 10000;
        background-color: #f5f5f5;
    }

        .product-filters.visible {
            transform: translateX(0);
        }


    .toolbar.sticky {
        position: fixed;
        width: 100%;
        top: 40px;
        left: 0;
        z-index: 1101;
    }

    .mud-drawer-open-persistent-left .products-wrapper {
        max-height: var(--filter-height);
    }

    .product-list-wrapper .mud-drawer {
        --mud-drawer-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .products-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }

    .full-row .producer-info {
        flex-direction: column;
        margin: 12px 0;
        height: 40%;
        text-align: center;
    }


    .full-row .producer-info-wrap {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }



    .full-row .product-description {
        display: block;
    }

    .full-row .product-description-wrap {
        width: 50%;
        padding: 10px;
        box-sizing: border-box;
    }

    .full-row .producer-info-wrap {
        width: 20%;
    }
}

@media (max-width: 600px) {
    .products-wrapper {
        grid-template-columns: 1fr;
    }

    .view-modes {
        display: none;
    }
}
