/* 
   PALLET WORLD - Secondary UI (Cart, Chat, Legal, Product Detail, Cookies, Blog)
   ===========================================================================
*/

/* --- CARRITO --- */
.cart-icon-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: transform var(--transition);
}

.cart-icon-container:hover {
    transform: scale(1.1);
}

.ui-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--brand-orange);
    color: white;
    border-radius: var(--radius-full);
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.cart-dropdown {
    position: absolute !important;
    top: 100%;
    right: 0;
    width: 360px;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: none;
    z-index: 5000;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.cart-dropdown.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.cart-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-navy);
}

@media (max-width: 480px) {
    .cart-dropdown {
        width: 280px;
        padding: 15px;
    }
}

/* --- CHAT VIVA MODERNO --- */
.chat-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
}

.chat-toggle-btn {
    background: var(--brand-cyan);
    color: var(--brand-navy);
    border: none;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(13, 217, 217, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--brand-orange);
    box-shadow: 0 15px 30px rgba(242, 92, 5, 0.4);
}

.chat-window {
    width: 380px;
    height: 550px;
    max-height: 70vh;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    transition: var(--transition-modern);
    transform-origin: bottom right;
}

@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        margin-bottom: 0;
        height: 80vh;
    }
    .chat-body {
        height: calc(80vh - 150px);
    }
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    background: rgba(12, 112, 242, 0.9);
    backdrop-filter: blur(5px);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-info span:first-child {
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.chat-body {
    padding: 15px;
    background: transparent;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--brand-navy);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.chat-input-area input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 12px 18px;
    color: var(--text-dark);
    font-size: 0.95rem;
    flex: 1;
    transition: var(--transition-modern);
}

.chat-input-area input:focus {
    background: white;
    border-color: var(--brand-cyan);
    box-shadow: 0 5px 15px rgba(13, 217, 217, 0.2);
    outline: none;
}

.chat-send-btn {
    background: var(--brand-orange);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-modern);
    box-shadow: 0 5px 15px rgba(242, 92, 5, 0.3);
}

.chat-send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    background: var(--brand-navy);
    box-shadow: 0 8px 20px rgba(12, 112, 242, 0.3);
}

/* --- DETALLE DE PRODUCTO --- */
.detalle-contenedor {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin: 30px 10px;
}

.detalle-columna img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-description h2 {
    font-size: 2.2rem;
    color: var(--brand-navy);
}

.precio {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-orange);
    margin: 20px 0;
}

@media (max-width: 768px) {
    .detalle-contenedor {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
        margin: 15px auto;
        border-radius: 0; /* Full width on mobile looks cleaner */
    }

    .product-image img {
        width: 100%;
        height: auto;
        border-radius: 12px;
    }

    .product-description h2 {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .precio {
        font-size: 2rem;
        margin: 15px 0;
    }

    .botones-compra {
        flex-direction: column;
        gap: 15px;
    }

    .btn-wsp-det, .btn-carrito-det {
        width: 100%;
        justify-content: center;
    }

    .comparativa-card {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .comparativa-card div:nth-child(2) {
        transform: rotate(90deg);
        margin: 5px 0;
    }
}

/* --- LEGAL --- */
.legal-card {
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    border-radius: var(--radius-lg);
    padding: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--text-dark);
}

.legal-header {
    border-bottom: 3px solid var(--brand-cyan);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.legal-header h1 { color: var(--brand-navy); }

/* --- COOKIES --- */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 500px;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    z-index: 10000;
    box-shadow: var(--glass-shadow);
}

/* --- TESTIMONIOS --- */
.testimonio-card {
    border-radius: var(--radius-md);
    padding: 25px;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

@media (max-width: 768px) {
    .testimonio-card {
        padding: 15px;
    }
    .grev-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .grev-userinfo {
        gap: 2px;
    }
}

.grev-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.grev-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.grev-userinfo { display: flex; flex-direction: column; }

.grev-name {
    font-weight: 700;
    color: var(--brand-navy);
    font-size: 0.95rem;
    line-height: 1.2;
}

.grev-local {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.grev-stars {
    margin-bottom: 12px;
    display: flex;
    gap: 3px;
}

.grev-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 18px;
    font-style: italic;
}

.grev-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.grev-verified {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--brand-navy);
    font-weight: 600;
}

/* --- LOGIN Y REGISTRO --- */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg-gradient);
    min-height: calc(100vh - 100px);
}

.login-card {
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    padding: 50px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 450px;
}

.login-card h2 { color: var(--brand-navy); text-align: center; margin-bottom: 30px; }

.login-card input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
}

/* --- DETALLE DE ARTÍCULO (BLOG) --- */
.detalle-contenedor-articulo {
    max-width: 900px;
    margin: 120px auto 60px;
    padding: 40px;
    background: var(--glass-bg-card);
    backdrop-filter: var(--blur);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

#articulo-contenido img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

#articulo-contenido h1 {
    font-size: 2.8rem;
    color: var(--brand-navy);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.contenido-rico {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.contenido-rico p { margin-bottom: 20px; }
.contenido-rico h2, .contenido-rico h3 { color: var(--brand-navy); margin: 30px 0 15px; }
.contenido-rico ul, .contenido-rico ol { margin-bottom: 20px; padding-left: 20px; }
.contenido-rico li { margin-bottom: 10px; }

@media (max-width: 768px) {
    .detalle-contenedor-articulo {
        margin-top: 100px;
        padding: 20px;
        border-radius: 0;
    }
    #articulo-contenido h1 { font-size: 1.8rem; }
}