﻿/* =========================================================
   PRODUCTO - INFO PRODUCTO
========================================================= */

:root {
    --mo-green: #009846;
    --mo-green-dark: #007a3d;
    --mo-green-soft: #eaf8f0;
    --mo-blue-dark: #001b3f;
    --mo-text-muted: #64748b;
    --mo-border: #e5e7eb;
    --mo-bg-soft: #f8f9fa;
}

.text-bold {
    font-weight: 800;
}

.text-color {
    color: var(--mo-green);
}

/* =========================================================
   IMAGEN PRINCIPAL
========================================================= */

.main-img {
    position: relative;
    background: #fff;
    border: 1px solid var(--mo-border);
    border-radius: 18px;
    padding: 14px;
    overflow: hidden;
}

    .main-img img,
    #imgProducto {
        width: 100%;
        object-fit: contain;
        border-radius: 14px;
        display: block;
        margin: 0 auto;
    }

.icon-overlay {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 10;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: calc(100% - 24px);
    pointer-events: none;
}

    .icon-overlay img {
        width: 42px;
        height: 42px;
        object-fit: cover;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0,0,0,.12);
    }

    .icon-overlay img {
        width: 42px;
        height: 42px;
        object-fit: cover;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,.08);
    }

/* Preview images */
.previews img {
    width: 100%;
    height: 140px;
}

/* =========================================================
   CONTENEDOR PRINCIPAL DEL PRODUCTO
========================================================= */

#pProducto {
    background: #fff;
    border: 1px solid var(--mo-border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

    #pProducto .row {
        row-gap: 20px;
    }

.main-description {
    padding: 0 6px;
}

    .main-description .category {
        text-transform: uppercase;
        color: var(--mo-green);
    }

.category .breadcrumb {
    background: var(--mo-bg-soft) !important;
    border: 1px solid var(--mo-border);
    border-radius: 14px !important;
    margin-bottom: 14px;
    font-size: .88rem;
}

.category .breadcrumb-item,
.category .breadcrumb-item.active {
    color: var(--mo-blue-dark);
    font-weight: 600;
}

    .category .breadcrumb-item a {
        color: var(--mo-green-dark);
        text-decoration: none;
        font-weight: 700;
    }

        .category .breadcrumb-item a:hover {
            color: var(--mo-green);
        }

.main-description .product-title {
    color: var(--mo-blue-dark);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px !important;
}

/* =========================================================
   PRECIO
========================================================= */

.old-price-discount {
    font-weight: 600;
}

.price-area {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--mo-border);
    border-left: 6px solid var(--mo-green);
    border-radius: 18px;
    padding: 16px 18px 16px 20px;
    margin-bottom: 16px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

    .price-area::before {
        content: "Precio";
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: fit-content;
        margin-bottom: 8px;
        padding: 4px 12px;
        border-radius: 999px;
        background: var(--mo-green-soft);
        color: var(--mo-green-dark);
        font-size: .78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .price-area::after {
        content: "";
        position: absolute;
        top: -35px;
        right: -35px;
        width: 95px;
        height: 95px;
        border-radius: 50%;
        background: rgba(0, 152, 70, .08);
        pointer-events: none;
    }

.new-price {
    color: var(--mo-green-dark);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
}

    .new-price .price-unit {
        color: #64748b;
        font-size: 1rem;
        font-weight: 700;
        margin-left: 4px;
        vertical-align: middle;
    }

/* =========================================================
   FORMULARIO COMPRA
========================================================= */

#pFormProducto {
    background: var(--mo-bg-soft);
    border: 1px solid var(--mo-border);
    border-radius: 18px;
    padding: 18px;
    margin-top: 10px;
}

.quantity label {
    display: inline-block;
    color: var(--mo-blue-dark);
    font-weight: 700;
    margin-bottom: 8px;
}

.quantity input {
    border-radius: 0;
    height: 40px;
}

.number-input {
    display: flex;
    align-items: center;
    max-width: 230px;
    width: 100%;
    background: #fff;
    border: 1px solid #dbe1e7;
    border-radius: 14px;
    overflow: hidden;
}

    .number-input .spinner {
        width: 42px;
        height: 42px;
        border: 0;
        background: #fff;
        color: var(--mo-green-dark);
        font-size: 1.2rem;
        font-weight: 800;
        transition: background .2s ease;
    }

        .number-input .spinner:hover {
            background: var(--mo-green-soft);
        }

    .number-input .form-control {
        height: 42px;
        border: 0;
        border-left: 1px solid #eef2f6;
        border-right: 1px solid #eef2f6;
        border-radius: 0;
        text-align: center;
        font-weight: 700;
        box-shadow: none;
    }

.buttons .block {
    margin-right: 5px;
}

.custom-btn {
    text-transform: capitalize;
    background-color: var(--mo-green);
    color: white;
    width: 150px;
    height: 40px;
    border-radius: 0;
}

    .custom-btn:hover {
        background-color: var(--mo-green-dark) !important;
        color: white !important;
    }

/* Botón agregar al carrito estilo grilla */
.btn-agregar-carrito {
    min-height: 48px;
    width: 100%;
    border-radius: 14px;
    background: var(--mo-green) !important;
    border: 1px solid var(--mo-green) !important;
    color: #ffffff !important;
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: .01em;
    padding: 0 22px;
    box-shadow: 0 8px 18px rgba(0, 152, 70, .20) !important;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

    .btn-agregar-carrito:hover,
    .btn-agregar-carrito:focus {
        background: var(--mo-green-dark) !important;
        border-color: var(--mo-green-dark) !important;
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(0, 152, 70, .26) !important;
    }

    .btn-agregar-carrito:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(0, 152, 70, .18) !important;
    }

#txtObservacion,
.form-floating textarea.form-control {
    min-height: 92px;
    border-radius: 14px;
    border-color: #dbe1e7;
    box-shadow: none;
}

    #txtObservacion:focus,
    .form-floating textarea.form-control:focus {
        border-color: var(--mo-green);
        box-shadow: 0 0 0 .20rem rgba(0, 152, 70, .12);
    }

/* =========================================================
   DETALLE PRODUCTO
========================================================= */

.product-details {
    background: #fff;
    border: 1px solid var(--mo-border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

    .details-title,
    .product-details .details-title {
        color: var(--mo-blue-dark);
        font-size: 1.05rem;
        font-weight: 800;
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    .product-details .description {
        color: var(--mo-text-muted);
        line-height: 1.7;
        font-size: .98rem;
        margin-bottom: 0;
    }

/* =========================================================
   SIN STOCK
========================================================= */

.stock-empty-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border: 1px solid rgba(220, 53, 69, .18);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 245, 245, .95), rgba(255, 255, 255, .98));
    box-shadow: 0 8px 22px rgba(0, 0, 0, .045);
}

.stock-empty-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(220, 53, 69, .1);
    color: #dc3545;
    font-size: 1.15rem;
}

.stock-empty-content {
    min-width: 0;
}

.stock-empty-title {
    margin: 0 0 2px;
    color: #842029;
    font-size: .95rem;
    font-weight: 700;
}

.stock-empty-text {
    margin: 0;
    color: #6c2f36;
    font-size: .875rem;
    line-height: 1.35;
}

.btn-stock-alert {
    border: 0;
    border-radius: 14px;
    padding: 11px 14px;
    background: linear-gradient(135deg, #198754, #20a36b);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(25, 135, 84, .22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

    .btn-stock-alert:hover,
    .btn-stock-alert:focus {
        color: #fff;
        transform: translateY(-1px);
        filter: brightness(1.02);
        box-shadow: 0 10px 24px rgba(25, 135, 84, .3);
    }

    .btn-stock-alert:active {
        transform: translateY(0);
        box-shadow: 0 5px 14px rgba(25, 135, 84, .22);
    }

.stock-alert-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stock-alert-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: .85rem;
}

@media (max-width: 575.98px) {
    .stock-empty-box {
        align-items: flex-start;
        padding: 13px;
        border-radius: 13px;
    }

    .stock-empty-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 1rem;
    }

    .stock-empty-title {
        font-size: .9rem;
    }

    .stock-empty-text {
        font-size: .82rem;
    }

    .btn-stock-alert {
        padding: 10px 12px;
        border-radius: 13px;
        font-size: .9rem;
    }
}

/* =========================================================
   PRODUCTOS SIMILARES / CAROUSEL
========================================================= */

.similar-products {
    margin-top: 40px !important;
}

    .similar-products > hr {
        opacity: .08;
    }

    .similar-products > .display-5 {
        color: var(--mo-blue-dark);
        font-size: 2.1rem;
        font-weight: 800;
        margin-bottom: 28px;
    }

    .similar-products .section-products {
        background: var(--mo-bg-soft) !important;
        border: 1px solid var(--mo-border);
        border-radius: 20px;
        padding: 28px 42px !important;
        overflow: hidden;
    }

#recipeCarousel {
    position: relative;
}

    #recipeCarousel .carousel-inner {
        padding: 4px 0;
    }

    #recipeCarousel .carousel-item {
        min-height: auto !important;
        transition: transform .5s ease;
    }

        #recipeCarousel .carousel-item > div {
            padding-left: 12px;
            padding-right: 12px;
        }

.section-products .single-product {
    background: #ffffff;
    border: 1px solid var(--mo-border);
    border-radius: 18px;
    padding: 12px;
    height: 100%;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .section-products .single-product:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
    }

    .section-products .single-product .product-image-wrapper {
        position: relative;
        width: 100%;
        height: 0;
        z-index: 5;
    }

    .section-products .single-product .contenedor-etiquetas {
        position: absolute;
        top: 12px;
        left: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        max-width: calc(100% - 24px);
        z-index: 10;
        pointer-events: none;
    }

    .section-products .single-product .etiqueta {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 50%;
        overflow: hidden;
        background: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(15, 23, 42, .14);
    }

        .section-products .single-product .etiqueta img {
            width: 30px !important;
            height: 30px !important;
            object-fit: cover;
            display: block;
        }

    .section-products .single-product .product-image {
        position: relative;
        z-index: 1;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 285px;
        background: #ffffff;
        border-radius: 16px;
        overflow: hidden;
        margin-bottom: 14px;
    }

        .section-products .single-product .product-image img {
            width: 100% !important;
            height: 100% !important;
            object-fit: contain !important;
            display: block;
        }

    .section-products .single-product .part-2 {
        display: block !important;
        padding: 4px 2px 0;
        margin-top: auto;
    }

        .section-products .single-product .part-2 .product-title {
            display: block;
            min-height: 46px;
            margin-bottom: 8px;
            font-size: .98rem;
            line-height: 1.35;
            font-weight: 800;
            color: var(--mo-blue-dark);
            overflow: hidden;
        }

            .section-products .single-product .part-2 .product-title a {
                color: var(--mo-blue-dark);
                text-decoration: none;
            }

                .section-products .single-product .part-2 .product-title a:hover {
                    color: var(--mo-green-dark);
                }

        .section-products .single-product .part-2 .product-price {
            display: block;
            color: var(--mo-green-dark);
            font-size: 1.05rem;
            font-weight: 900;
            margin: 0;
        }

#recipeCarousel .carousel-control-prev,
#recipeCarousel .carousel-control-next {
    width: 42px;
    height: 42px;
    top: 45%;
    border-radius: 50%;
    background: #ffffff !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
    opacity: 1;
}

#recipeCarousel .carousel-control-prev {
    left: -4px;
}

#recipeCarousel .carousel-control-next {
    right: -4px;
}

/* =========================================================
   PRODUCTO NO DISPONIBLE
========================================================= */

#pNoHayProducto > div {
    border-radius: 20px;
    border: 1px solid var(--mo-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

#pNoHayProducto h1 {
    color: var(--mo-blue-dark);
    font-weight: 800;
}

/* =========================================================
   MODAL STOCK
========================================================= */

.btn-stock-alert {
    min-height: 44px;
    border: 1px solid rgba(25, 135, 84, .28);
    border-radius: .9rem;
    background: #edf8f2;
    color: #146c43;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    transition: all .15s ease-in-out;
}

    .btn-stock-alert:hover {
        background: #198754;
        border-color: #198754;
        color: #ffffff;
        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-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);
}

.textarea-wrapper {
    position: relative;
    width: 100%;
}

    .textarea-wrapper textarea {
        width: 100%;
        padding-bottom: 25px;
        resize: none;
    }

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: green;
    pointer-events: none;
    background: rgba(255,255,255,.9);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
}

/* =========================================================
   OTROS BLOQUES
========================================================= */

.similar-product {
    text-align: left;
}

    .similar-product .title {
        margin: 17px 0px 4px 0px;
    }

    .similar-product .price {
        font-weight: bold;
    }

.questions .icon i {
    font-size: 2rem;
}

.questions-icon {
    font-size: 2rem;
    color: var(--mo-green);
}

/* =========================================================
   RESPONSIVE CAROUSEL
========================================================= */

/* Desktop: 4 productos */
@media (min-width: 992px) {
    #recipeCarousel .carousel-item.active,
    #recipeCarousel .carousel-item-next,
    #recipeCarousel .carousel-item-prev {
        display: flex;
    }

    #recipeCarousel .carousel-item > div {
        display: block !important;
        flex: 0 0 25%;
        max-width: 25%;
    }

    #recipeCarousel .carousel-item-end.active,
    #recipeCarousel .carousel-item-next {
        transform: translateX(25%);
    }

    #recipeCarousel .carousel-item-start.active,
    #recipeCarousel .carousel-item-prev {
        transform: translateX(-25%);
    }

    #recipeCarousel .carousel-item-end,
    #recipeCarousel .carousel-item-start {
        transform: translateX(0);
    }
}

/* Tablet: 2 productos */
@media (min-width: 768px) and (max-width: 991.98px) {
    #recipeCarousel .carousel-item.active,
    #recipeCarousel .carousel-item-next,
    #recipeCarousel .carousel-item-prev {
        display: flex;
    }

    #recipeCarousel .carousel-item > div {
        display: block !important;
        flex: 0 0 50%;
        max-width: 50%;
    }

    .section-products .single-product {
        min-height: 410px;
    }

        .section-products .single-product .product-image {
            height: 260px;
        }
}

/* =========================================================
   RESPONSIVE GENERAL
========================================================= */

@media (max-width: 767.98px) {
    #pProducto {
        padding: 14px;
        border-radius: 18px;
    }

    .main-img {
        padding: 10px;
        border-radius: 16px;
        margin-bottom: 8px;
    }

    .main-description {
        padding: 0;
    }

        .main-description .product-title {
            font-size: 1.45rem;
            line-height: 1.25;
        }

    .new-price {
        font-size: 1.7rem;
    }

    #pFormProducto {
        padding: 14px;
    }

    .number-input {
        max-width: 100%;
    }

    .btn-agregar-carrito {
        width: 100%;
        margin-top: 10px !important;
    }

    .product-details {
        padding: 16px;
    }

    .previews img {
        width: 100%;
        height: auto;
    }

    .similar-products {
        margin-top: 30px !important;
    }

        .similar-products > .display-5 {
            font-size: 1.7rem;
            margin-bottom: 18px;
        }

        .similar-products .section-products {
            padding: 18px 12px !important;
        }

    #recipeCarousel .carousel-item > div {
        display: none !important;
    }

    #recipeCarousel .carousel-item.active > div:first-child {
        display: block !important;
    }

    .section-products .single-product {
        min-height: auto;
    }

        .section-products .single-product .product-image {
            height: 260px;
        }

    #recipeCarousel .carousel-control-prev,
    #recipeCarousel .carousel-control-next {
        display: none;
    }

    #pProducto > .row {
        display: flex;
        flex-direction: column;
    }

        #pProducto > .row > .col-md-5 {
            order: 2;
        }

        #pProducto > .row > .col-md-7 {
            display: contents;
        }

    #pProducto .main-description {
        display: contents;
    }

        #pProducto .main-description .category {
            order: 1;
            width: 100%;
            padding-left: calc(var(--bs-gutter-x) * .5);
            padding-right: calc(var(--bs-gutter-x) * .5);
        }

    #pProducto .main-img {
        margin-bottom: 0;
    }

    #pProducto .main-description .product-title {
        order: 3;
        width: 100%;
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
        margin-top: 10px !important;
    }

    #pProducto .price-area {
        order: 4;
        width: calc(100% - var(--bs-gutter-x));
        margin-left: calc(var(--bs-gutter-x) * .5);
        margin-right: calc(var(--bs-gutter-x) * .5);
        padding: 14px 16px;
        border-radius: 16px;
    }

    #upFormProducto {
        order: 5;
        width: 100%;
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }

    #pProducto > .row > .row.mt-4 {
        order: 6;
    }

    .category .breadcrumb {
        margin-bottom: 10px;
        padding: 12px !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    }

    .category .breadcrumb-item {
        font-size: .82rem;
        line-height: 1.45;
    }

    .new-price {
        font-size: 1.65rem;
    }
}
.number-input {
    display: flex;
    align-items: stretch;
    max-width: 230px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #dbe1e7;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

    .number-input .quantity-btn {
        width: 46px;
        min-width: 46px;
        height: 44px;
        border: 0;
        background: #ffffff;
        color: var(--mo-green-dark);
        font-size: 1.25rem;
        font-weight: 900;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background .2s ease, color .2s ease;
    }

        .number-input .quantity-btn:hover {
            background: var(--mo-green-soft);
            color: var(--mo-green-dark);
        }

        .number-input .quantity-btn:active {
            background: var(--mo-green);
            color: #ffffff;
        }

    .number-input .quantity-input,
    .number-input .form-control {
        flex: 1 1 auto;
        min-width: 0;
        height: 44px;
        border: 0;
        border-left: 1px solid #eef2f6;
        border-right: 1px solid #eef2f6;
        border-radius: 0;
        text-align: center;
        font-weight: 800;
        color: var(--mo-blue-dark);
        background: #ffffff;
        box-shadow: none;
        padding: 0 8px;
    }

        .number-input .quantity-input:focus,
        .number-input .form-control:focus {
            border-color: #eef2f6;
            box-shadow: inset 0 0 0 2px rgba(0, 152, 70, .12);
        }

        .number-input .quantity-input::-webkit-outer-spin-button,
        .number-input .quantity-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .number-input .quantity-input[type=number] {
            -moz-appearance: textfield;
        }