@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --color-bg: #FFFFFF;
    --color-bg-alt: #F9F9F7;
    --color-primary: #F23D3D;
    /* Rosa Vibrante */
    --color-secondary: #40E0D0;
    /* Turquesa / Verde Agua */
    --color-accent: #E9B824;
    /* Dorado / Naranja Suave */
    --color-text: #2C3E50;
    --color-text-light: #7F8C8D;

    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;

    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-diffuse: 0 15px 45px rgba(0, 0, 0, 0.08);
    --border-radius-lg: 20px;
    --border-radius-md: 15px;
    --border-radius-sm: 10px;
}

body {
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
.section-title {
    font-family: var(--font-serif);
}

/* Navbar Modernizada */
.navbar-custom {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
}

.nav-search-container {
    background: #F1F3F4;
    border-radius: 30px;
    padding: 2px 15px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.nav-search-container input {
    background: transparent;
    border: none;
    padding: 8px;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

/* Hero Banner (1/3 Viewport) */
.hero-banner {
    position: relative;
    height: 33.3vh;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F2EFDF;
    /* Fondo Crema */
    overflow: hidden;
    margin-bottom: 3rem;
    /* Espacio para evitar que pise el contenido */
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Centrado sin deformar */
}

.glass-container {
    background: rgba(0, 0, 0, 0.45);
    /* Fondo oscuro semi-transparente para contraste */
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem !important;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    /* Texto blanco sobre fondo oscuro */
}

.glass-container h2 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.glass-container p {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/************************************************************************/
/*************************************************************************/
/**************************************************************************/
/**************************************************************************/
/*************************************************************************/
/************************************************************************/
@media (max-width: 768px) {
    .glass-container {
        padding: 1.5rem !important;
        max-width: 90%;
    }

    .glass-container h2 {
        font-size: 1.5rem !important;
    }
}

/* Botones con Curvatura Pronunciada */
.btn {
    border-radius: 30px;
    padding: 0.8rem 2rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary-custom {
    background: var(--color-primary);
    color: white;
}

.btn-primary-custom:hover {
    background: #D83434;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 61, 61, 0.3);
    color: white;
}

.btn-secondary-custom {
    background: var(--color-secondary);
    color: white;
}

.btn-accent-custom {
    background: var(--color-accent);
    color: white;
}

/* Tarjetas Estilo Mercado Libre (4 columnas desktop) */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    padding: 12px;
    height: 100%;
    position: relative;
    border: none;
    display: flex;
    flex-direction: column;
}

.product-img-container {
    aspect-ratio: 1;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.product-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img-container img {
    transform: scale(1.08);
}

.product-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    color: var(--color-text);
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Badges */
.badge-pre-encargo {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--color-accent);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(233, 184, 36, 0.3);
}

/************************************************************************/
/*************************************************************************/
/**************************************************************************/
/**************************************************************************/
/*************************************************************************/
/************************************************************************/
/** Mobile 2 Columns (Tablet y Celular) */

@media (max-width: 992px) {
    .catalog-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .product-card {
        width: calc(50% - 6px);
        min-width: 140px;
        padding: 10px;
        border-radius: 15px;
        /* UI: Bordes de 15px */
    }

    /* FRONTEND: Estilos de cards responsivas - Botón compacto en móvil */
    .product-card .btn span {
        display: none !important;
    }

    .product-card .btn i::before {
        content: "\F527";
        /* bi-plus-lg */
        font-size: 1.2rem;
    }

    .product-card .btn {
        padding: 0.5rem !important;
        border-radius: 12px;
    }

    .hero-banner {
        height: 40vh;
    }

    /* UI: Modal responsivo con imagen 1:1 */
    .modal-custom-size .col-img {
        aspect-ratio: 1/1;
        width: 100%;
    }

    .modal-custom-size .col-img img {
        width: 100%;
        height: 100% !important;
        object-fit: cover;
        border-radius: 15px 15px 0 0 !important;
    }
}

/* Universal Modal CSS */
.modal-custom-size .modal-content {
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-custom-size .modal-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-custom-size .row.g-0 {
    flex-grow: 1;
    overflow: hidden;
}

.modal-custom-size .col-img {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-bg-alt);
    overflow: hidden;
}

.modal-custom-size .col-img img {

    width: 100%;
    object-fit: contain;
}

.modal-custom-size .col-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.modal-custom-size .content-scroll {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

.modal-custom-size .footer-fixed {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

/************************************************************************/
/*************************************************************************/
/**************************************************************************/
/**************************************************************************/
/*************************************************************************/
/************************************************************************/
@media (min-width: 992px) {
    .modal-dialog.modal-custom-size {
        max-width: 70vw;
    }

    .modal-dialog.modal-custom-size .modal-content {
        max-height: 900px;
    }

    .modal-custom-size .col-img img {
        max-height: calc(900px - 2rem);
    }
}

/************************************************************************/
/*************************************************************************/
/**************************************************************************/
/**************************************************************************/
/*************************************************************************/
/************************************************************************/
@media (max-width: 768px) {
    .modal-custom-size .col-img {
        width: 100% !important;
        padding: 0 !important;
        max-height: 350px !important;
        overflow: hidden;
    }

    .modal-custom-size .col-img img {
        width: 100% !important;
        height: 350px !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 15px 15px 0 0 !important;
    }

    .modal-custom-size .row.g-0 {
        flex-direction: column;
    }

    .modal-content {
        border-radius: 15px !important;
        max-height: 90vh !important;
        overflow: hidden !important;
    }

    .modal-body {
        overflow-y: auto !important;
    }

    .btn-close {
        z-index: 9999 !important;
        background-color: rgba(255, 255, 255, 0.8) !important;
        border-radius: 50% !important;
        padding: 0.8rem !important;
    }
}

/* Dashboard Admin Moderno */
.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Formularios Centrados */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-diffuse);
    width: 100%;
    max-width: 450px;
}

.form-control {
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    border: 1px solid #E0E0E0;
    background: #F9F9F9;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(242, 61, 61, 0.1);
    border-color: var(--color-primary);
}

/************************************************************************/
/*************************************************************************/
/**************************************************************************/
/**************************************************************************/
/*************************************************************************/
/************************************************************************/
/* --- Refuerzo Responsive (iPhone 16 Pro & Mobile) --- */
@media (max-width: 480px) {
    .table-responsive {
        border: 0;
    }

    .table td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem;
    }

    .table td.ps-4 {
        padding-left: 0.75rem !important;
    }

    .table td.pe-4 {
        padding-right: 0.75rem !important;
    }

    h1,
    .h1 {
        font-size: 1.75rem !important;
    }

    h2,
    .h2 {
        font-size: 1.5rem !important;
    }

    .metric-card {
        padding: 1.2rem;
        flex-direction: column;
        text-align: center;
    }

    .metric-icon {
        margin: 0 auto 0.5rem;
    }
}

/* Custom Scrollbar for better UI */
.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

#modalTable {
    font-size: 0.9rem;
}

#monthlyDetailModal .modal-content {
    border-radius: 25px;
}