﻿/* UX página búsqueda
-------------------------------------------------- */

.section-products {
    background: #f7f8f9 !important;
    padding: 1.5rem 0 3rem 0 !important;
    margin: 0 !important;
}

    .section-products .header {
        margin-bottom: 50px;
    }

        .section-products .header h3 {
            font-size: 1rem;
            color: #198754;
            font-weight: 600;
        }

        .section-products .header h2 {
            font-size: 2.2rem;
            font-weight: 600;
            color: #1f2933;
        }

    .section-products .single-product {
        position: relative;
        display: flex;
        flex-direction: column;
        height: 100%;
        margin-bottom: 0;
        background: #ffffff;
        border: 1px solid rgba(25, 135, 84, 0.16);
        border-radius: 18px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.055);
        overflow: hidden;
        transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    }

        .section-products .single-product:hover {
            transform: translateY(-4px);
            border-color: rgba(25, 135, 84, 0.34);
            box-shadow: 0 16px 34px rgba(25, 135, 84, 0.13);
        }

        .section-products .single-product .part-1 {
            position: relative;
            height: 290px;
            max-height: 290px;
            margin-bottom: 20px;
            overflow: hidden;
        }

            .section-products .single-product .part-1::before {
                position: absolute;
                content: "";
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                z-index: -1;
                transition: all 0.3s;
            }

        .section-products .single-product:hover .part-1::before {
            transform: scale(1.2,1.2) rotate(5deg);
        }

    .section-products #product-1 .part-1::before {
        background: url("https://i.ibb.co/L8Nrb7p/1.jpg") no-repeat center;
        background-size: cover;
        transition: all 0.3s;
    }

    .section-products #product-2 .part-1::before {
        background: url("https://i.ibb.co/cLnZjnS/2.jpg") no-repeat center;
        background-size: cover;
    }

    .section-products #product-3 .part-1::before {
        background: url("https://i.ibb.co/L8Nrb7p/1.jpg") no-repeat center;
        background-size: cover;
    }

    .section-products #product-4 .part-1::before {
        background: url("https://i.ibb.co/cLnZjnS/2.jpg") no-repeat center;
        background-size: cover;
    }

    .section-products .single-product .part-1 .discount,
    .section-products .single-product .part-1 .new {
        position: absolute;
        top: 15px;
        left: 20px;
        color: #ffffff;
        background-color: #dc3545;
        padding: 2px 8px;
        text-transform: uppercase;
        font-size: 0.85rem;
    }

    .section-products .single-product .part-1 .etiqueta {
        position: relative;
        top: 15px;
        left: 20px;
        padding: 2px 8px;
    }

    .section-products .single-product .part-1 .new {
        left: 0;
        background-color: #198754;
    }

    .section-products .single-product .part-1 ul {
        position: absolute;
        bottom: -41px;
        left: 20px;
        margin: 0;
        padding: 0;
        list-style: none;
        opacity: 0;
        transition: bottom 0.5s, opacity 0.5s;
    }

    .section-products .single-product:hover .part-1 ul {
        bottom: 30px;
        opacity: 1;
    }

    .section-products .single-product .part-1 ul li {
        display: inline-block;
        margin-right: 4px;
    }

        .section-products .single-product .part-1 ul li a {
            display: inline-block;
            width: 40px;
            height: 40px;
            line-height: 40px;
            background-color: #ffffff;
            color: #444444;
            text-align: center;
            box-shadow: 0 2px 20px rgb(50 50 50 / 10%);
            transition: color 0.2s;
        }

            .section-products .single-product .part-1 ul li a:hover {
                color: #198754;
            }

    .section-products .single-product .part-2 .product-title {
        font-size: 1rem;
    }

    .section-products .single-product .part-2 h4 {
        display: inline-block;
        font-size: 1rem;
    }

    .section-products .single-product .part-2 .product-old-price {
        position: relative;
        padding: 0 7px;
        margin-right: 2px;
        opacity: 0.6;
    }

        .section-products .single-product .part-2 .product-old-price::after {
            position: absolute;
            content: "";
            top: 50%;
            left: 0;
            width: 100%;
            height: 1px;
            background-color: #444444;
            transform: translateY(-50%);
        }

.product-image-wrapper {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #f8fcf8 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(25, 135, 84, 0.10);
    padding: 10px;
}

.contenedor-etiquetas {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    max-width: 250px;
    gap: 6px;
    z-index: 10;
}

.etiqueta {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.product-image-wrapper.no-stock .product-image img {
    filter: grayscale(100%) brightness(0.6);
}

#lbNoStock {
    position: absolute;
    top: 45%;
    left: 0;
    width: 100%;
    background: rgba(33, 37, 41, 0.86);
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 8px 0;
    font-size: 18px;
    z-index: 2;
    display: none;
}

.product-image-wrapper.no-stock #lbNoStock {
    display: block;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
}

.product-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: .55rem;
    color: #1f2933;
}

    .product-title:hover {
        color: #198754;
    }

    .product-title a,
    a.product-title {
        color: #1f2933 !important;
        transition: color 0.2s ease;
    }

        .product-title a:hover,
        a.product-title:hover {
            color: #198754 !important;
        }

.product-description-box {
    margin: 0.35rem 0 0.75rem 0;
}

.product-description {
    font-size: 0.88rem;
    line-height: 1.4;
    color: #6c757d;
    margin: 0;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.45rem;
    font-weight: 800;
    color: #198754;
    margin-bottom: 0.85rem;
}

    .product-price small {
        font-size: .82rem;
        font-weight: 600;
        color: #6c757d;
    }

.product-buy-box {
    margin-top: auto;
}

.product-label {
    font-size: .85rem;
    font-weight: 700;
    color: #2f3e46;
    margin-bottom: .35rem;
}

.quantity-control {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 220px;
    margin-bottom: 0;
}

.quantity-btn {
    width: 42px;
    min-width: 42px;
    border: 1px solid rgba(25, 135, 84, 0.22);
    background: #f4fbf6;
    color: #198754;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    transition: all .15s ease-in-out;
}

    .quantity-btn:hover {
        background: #198754;
        border-color: #198754;
        color: #ffffff;
    }

    .quantity-btn.decrement {
        border-radius: .55rem 0 0 .55rem;
    }

    .quantity-btn.increment {
        border-radius: 0 .55rem .55rem 0;
    }

.quantity-input {
    max-width: 90px;
    text-align: center;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    border-color: rgba(25, 135, 84, 0.22);
    box-shadow: none !important;
}

    .quantity-input:focus {
        border-color: rgba(25, 135, 84, 0.45);
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12) !important;
    }

    .quantity-input::-webkit-outer-spin-button,
    .quantity-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .quantity-input[type=number] {
        -moz-appearance: textfield;
    }

.product-observation {
    resize: none;
    font-size: .9rem;
    min-height: 70px;
    border-radius: .75rem;
    border: 1px solid rgba(25, 135, 84, 0.18);
    box-shadow: none !important;
}

    .product-observation:focus {
        border-color: rgba(25, 135, 84, 0.45);
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12) !important;
    }

.btn-add-cart {
    width: 100%;
    min-height: 44px;
    border: none !important;
    border-radius: .9rem !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #198754 0%, #20a763 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: .96rem !important;
    box-shadow: 0 10px 20px rgba(25, 135, 84, .20);
    transition: all .18s ease-in-out;
}

    .btn-add-cart:hover,
    .btn-add-cart:focus {
        background: linear-gradient(135deg, #157347 0%, #198754 100%) !important;
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: 0 14px 24px rgba(25, 135, 84, .26);
    }

    .btn-add-cart:active {
        transform: translateY(0);
    }

.btn-stock-alert {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(25, 135, 84, .28) !important;
    border-radius: .9rem !important;
    padding: 11px 14px !important;
    background: #edf8f2 !important;
    color: #146c43 !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    transition: all .15s ease-in-out;
}

    .btn-stock-alert:hover {
        background: #198754 !important;
        border-color: #198754 !important;
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(25, 135, 84, .22);
    }

    .btn-stock-alert:focus {
        color: #146c43;
        box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .18);
    }

.stock-alert-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: rgba(25, 135, 84, .12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-stock-alert:hover .stock-alert-icon {
    background: rgba(255, 255, 255, .18);
}

.stock-alert-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.1;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .50);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-text {
    color: #fff;
    margin-top: 1rem;
    text-align: center;
    padding: 0 1rem;
    font-size: 1rem;
}

.search-header-section {
    background: #f7f8f9;
    padding: 1.5rem 0 1rem 0;
}

.search-hero {
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .06);
    padding: 1.35rem 1.5rem;
}

.search-hero-title {
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 800;
    color: #16202a;
    margin-bottom: .35rem;
    letter-spacing: -.03em;
}

.search-hero-text {
    color: #6c757d;
    margin-bottom: 0;
    font-size: .95rem;
}

.search-breadcrumb {
    --bs-breadcrumb-divider-color: #b8c0c7;
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    font-size: .9rem;
}

    .search-breadcrumb a {
        color: #198754;
        font-weight: 700;
        text-decoration: none;
    }

        .search-breadcrumb a:hover {
            color: #146c43;
            text-decoration: underline;
        }

.search-term {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #edf8f2;
    color: #146c43;
    border: 1px solid rgba(25, 135, 84, .22);
    border-radius: 999px;
    padding: .25rem .65rem;
    font-weight: 800;
    line-height: 1.2;
}

.search-back-btn {
    min-height: 42px;
    border-radius: 999px;
    font-weight: 700;
}

.products-shell {
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .06);
    padding: 1.25rem;
}

.products-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

    .products-section-title h2 {
        font-size: 1.2rem;
        font-weight: 800;
        color: #16202a;
        margin: 0 0 .25rem 0;
        letter-spacing: -.02em;
    }

    .products-section-title span {
        color: #6c757d;
        font-size: .92rem;
    }

.products-title-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: #edf8f2;
    color: #198754;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.empty-products-box {
    max-width: 560px;
    margin: .5rem auto 1rem auto;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 1.25rem;
    background: #ffffff;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .05);
}

.empty-products-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #edf8f2;
    color: #198754;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin-bottom: 1rem;
}

.empty-products-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #16202a;
    letter-spacing: -.02em;
    margin-bottom: .5rem;
}

.empty-products-text {
    color: #6c757d;
    max-width: 440px;
    margin: 0 auto 1.25rem auto;
    line-height: 1.45;
}

.pagination-wrap {
    padding-top: .5rem;
}

.pagination .page-link {
    border-radius: .75rem;
    margin: 0 .15rem;
    min-width: 42px;
    text-align: center;
    color: #198754;
    font-weight: 700;
    border-color: rgba(25, 135, 84, .18);
}

    .pagination .page-item.active .page-link,
    .pagination .page-link:hover {
        background-color: #198754;
        border-color: #198754;
        color: #ffffff;
    }

.stock-modal-content {
    border: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}

.stock-modal-header {
    background: linear-gradient(135deg, #198754, #146c43);
    color: #ffffff;
    border-bottom: 0;
    padding: 1.25rem;
}

    .stock-modal-header .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

.stock-modal-subtitle {
    font-size: .92rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.stock-modal-footer {
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.char-counter {
    display: block;
    text-align: right;
    font-size: .8rem;
    margin-top: -.5rem;
}

.category-result-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #f7f8f9;
    border: 1px solid rgba(25, 135, 84, .10);
    border-radius: 1rem;
    padding: .9rem 1rem;
    margin-bottom: 1.25rem;
}

.category-result-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: #edf8f2;
    color: #198754;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.category-result-label {
    display: block;
    color: #6c757d;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.1;
}

.category-result-name {
    display: block;
    color: #16202a;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

#pProductos {
    border-radius: 1rem;
}

@media (max-width: 576px) {
    .search-header-section {
        padding: 1rem 0 .75rem 0;
    }

    .search-hero {
        padding: 1rem;
    }

    .search-back-btn {
        width: 100%;
    }

    .products-shell {
        padding: .9rem;
    }

    .products-section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination {
        flex-wrap: wrap;
        gap: .35rem;
    }

    .category-result-title {
        padding: .8rem;
    }

    .category-result-name {
        font-size: 1.1rem;
    }

    .section-products .single-product {
        border-radius: 14px;
    }

    .product-card-body {
        padding: 14px;
    }

    .product-title {
        font-size: .95rem;
    }

    .product-description {
        font-size: .82rem;
        min-height: 36px;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .quantity-control {
        max-width: 100%;
    }

    .quantity-input {
        max-width: none;
        flex: 1;
    }

    .product-observation {
        min-height: 64px;
    }

    .btn-add-cart,
    .btn-stock-alert {
        width: 100%;
        font-size: .9rem !important;
        padding: 11px 12px !important;
    }
}

/* Cantidad - ocupar todo el ancho */
.cantidad-control {
    width: 100%;
}

.cantidad-input-group {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
}

    .cantidad-input-group .quantity-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        flex: 0 0 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(25, 135, 84, 0.22);
        background: #f4fbf6;
        color: #198754;
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1;
        transition: all .15s ease-in-out;
    }

        .cantidad-input-group .quantity-btn:hover,
        .cantidad-input-group .quantity-btn:focus {
            background-color: #198754;
            border-color: #198754;
            color: #ffffff;
        }

        .cantidad-input-group .quantity-btn.decrement {
            border-radius: .55rem 0 0 .55rem;
        }

        .cantidad-input-group .quantity-btn.increment {
            border-radius: 0 .55rem .55rem 0;
        }

    .cantidad-input-group .quantity-input {
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        flex: 1 1 auto;
        height: 42px;
        text-align: center;
        font-weight: 700;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        border-color: rgba(25, 135, 84, 0.22);
        box-shadow: none !important;
    }

        .cantidad-input-group .quantity-input:focus {
            border-color: rgba(25, 135, 84, 0.45);
            box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.18) !important;
        }

        .cantidad-input-group .quantity-input::-webkit-outer-spin-button,
        .cantidad-input-group .quantity-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .cantidad-input-group .quantity-input[type=number] {
            -moz-appearance: textfield;
        }

/* / UX página búsqueda
-------------------------------------------------- */
