/* ===== JOINET TOPNAV PLUGIN STYLES ===== */

/* Reset y estilos base */
.secondary-menu-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.secondary-menu-container {
    position: relative;
    z-index: 100000;
    width: 100%;
}

.secondary-main-nav {
    background: transparent;
    position: relative;
}

.secondary-nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    min-height: 50px;
}

/* Sección izquierda - Texto animado + Redes sociales */
.left-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Texto animado de envíos */
.shipping-text {
    font-size: 14px;
    color: #312f2f;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.shipping-text::before {
    content: '🚚';
    margin-right: 6px;
    animation: truck-move 3s ease-in-out infinite;
}

.shipping-text span {
    display: inline-block;
    animation: text-glow 4s ease-in-out infinite;
}

@keyframes truck-move {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

@keyframes text-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; color: #FF0000; }
}

/* Redes sociales */
.social-media-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e9ecef;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Colores oficiales de redes sociales */
.social-icon.facebook {
    color: #1877F2;
}

.social-icon.facebook:hover {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}

.social-icon.instagram {
    color: #E4405F;
}

.social-icon.instagram:hover {
    background: linear-gradient(45deg, #F56040, #E4405F, #C13584, #833AB4);
    color: #fff;
    border-color: #E4405F;
}

.social-icon.tiktok {
    color: #000;
}

.social-icon.tiktok:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.social-icon.youtube {
    color: #FF0000;
}

.social-icon.youtube:hover {
    background: #FF0000;
    color: #fff;
    border-color: #FF0000;
}

/* Menú central */
.center-menu-section {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Menú hamburguesa para móviles */
.secondary-hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    position: absolute;
    left: 20px;
}

.secondary-hamburger span {
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.secondary-hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.secondary-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.secondary-hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.secondary-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.secondary-menu-item {
    position: relative;
    margin: 0;
}

.secondary-menu-link {
    display: block;
    padding: 12px 16px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.secondary-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #FF0000;
    transition: left 0.3s ease;
    z-index: -1;
}

.secondary-menu-link:hover {
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.secondary-menu-link:hover::before {
    left: 0;
}

/* Sección derecha - Usuario y Lista de deseos */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Icono de usuario */
.user-account-section {
    position: relative;
}

.user-icon-button {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: transparent;
    border: 2px solid #494848;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #494848;
    min-width: 110px;
    justify-content: flex-start;
    height: 38px;
}

.user-icon-button:hover {
    background: #FF0000;
    border-color: #FF0000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 0, 0, 0.3);
}

.user-icon {
    font-size: 16px;
    margin-right: 6px;
    flex-shrink: 0;
}

.user-text {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Saludo horizontal */
.user-greeting-horizontal {
    font-weight: 500;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-greeting-horizontal .greeting {
    color: inherit;
}

.user-greeting-horizontal .user-name {
    font-weight: 600;
    text-transform: capitalize;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Botón Lista de deseos más compacto */
.wishlist-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #494848;
    color: #494848;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}

.wishlist-button:hover {
    background: #FF0000;
    border-color: #FF0000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 0, 0, 0.3);
}

/* Dropdown del usuario */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999999;
    overflow: hidden;
    border: 1px solid #eee;
}

/* Asegurar que siempre esté encima */
.user-account-section {
    position: relative;
    z-index: 999998;
}

.user-account-section:hover {
    z-index: 999999;
}

.user-account-section:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 25px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
}

.user-dropdown-header {
    background: #ff0000;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.user-dropdown-item {
    margin: 0;
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    cursor: pointer;
}

.user-dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: #FF0000;
    transition: width 0.3s ease;
    opacity: 0.1;
}

.user-dropdown-link:hover {
    color: #FF0000 !important;
    background-color: #fff;
    border-left-color: #FF0000;
    text-decoration: none;
    transform: translateX(5px);
}

.user-dropdown-link:hover::before {
    width: 100%;
}

.user-dropdown-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Logout especial */
.user-dropdown-link.logout {
    border-top: 1px solid #eee;
    margin-top: 5px;
    color: #dc3545;
}

.user-dropdown-link.logout:hover {
    color: #fff !important;
    background: #dc3545;
    border-left-color: #dc3545;
}

/* ===== POPUPS MODERNOS ===== */

/* Overlay general para popups */
.joinet-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.joinet-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor del popup */
.joinet-popup {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.7) translateY(-50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.joinet-popup-overlay.active .joinet-popup {
    transform: scale(1) translateY(0);
}

/* Header del popup */
.joinet-popup-header {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #fff;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    position: relative;
    text-align: center;
}

.joinet-popup-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.joinet-popup-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 5px 0 0 0;
    font-weight: 400;
}

/* Botón cerrar */
.joinet-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

.joinet-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* Contenido del popup */
.joinet-popup-content {
    padding: 30px;
}

/* Formularios */
.joinet-form-group {
    margin-bottom: 20px;
}

.joinet-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.joinet-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.joinet-form-input:focus {
    outline: none;
    border-color: #ff0000;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.joinet-form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.joinet-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff0000;
}

/* Botones */
.joinet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
    min-height: 48px;
}

.joinet-btn-primary {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.joinet-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.joinet-btn-secondary {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #e9ecef;
}

.joinet-btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.joinet-btn-full {
    width: 100%;
}

/* Estados de carga */
.joinet-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.joinet-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mensajes de alerta */
.joinet-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.joinet-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.joinet-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tabs para login/registro */
.joinet-tabs {
    display: flex;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 4px;
}

.joinet-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6c757d;
}

.joinet-tab.active {
    background: #fff;
    color: #ff0000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.joinet-tab-content {
    display: none;
}

.joinet-tab-content.active {
    display: block;
}

/* Información de rastreo */
.joinet-tracking-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.joinet-tracking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.joinet-tracking-item:last-child {
    border-bottom: none;
}

.joinet-tracking-label {
    font-weight: 600;
    color: #2c3e50;
}

.joinet-tracking-value {
    color: #6c757d;
}

.joinet-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.joinet-status-completed {
    background: #d4edda;
    color: #155724;
}

.joinet-status-processing {
    background: #fff3cd;
    color: #856404;
}

.joinet-status-pending {
    background: #f8d7da;
    color: #721c24;
}

/* ===== MI CUENTA PERSONALIZADA ===== */

.joinet-account-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.joinet-account-header {
    text-align: center;
    margin-bottom: 40px;
}

.joinet-account-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.joinet-account-subtitle {
    font-size: 16px;
    color: #6c757d;
}

.joinet-account-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-top: 40px;
}

/* Navegación lateral */
.joinet-account-nav {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.joinet-account-nav-item {
    display: block;
    padding: 15px 25px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.joinet-account-nav-item:hover,
.joinet-account-nav-item.active {
    color: #ff0000;
    background: #fff5f5;
    border-left-color: #ff0000;
    transform: translateX(5px);
    text-decoration: none;
}

.joinet-account-nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.joinet-account-nav-item svg {
    margin-right: 12px;
    width: 20px;
    vertical-align: middle;
}

/* Contenido principal */
.joinet-account-content {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .secondary-nav-wrapper {
        padding: 0 15px;
    }
    
    .secondary-menu-link {
        padding: 18px 15px;
        font-size: 13px;
    }
    
    .joinet-account-grid {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }
}

/* TABLET ESPECÍFICO (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .secondary-nav-wrapper {
        padding: 0 15px;
        min-height: 55px;
    }

    /* Ocultar solo el texto de envíos en tablet, mantener redes sociales */
    .shipping-text {
        display: none;
    }

    .left-section {
        gap: 15px;
    }

    /* Reducir tamaño de iconos sociales en tablet */
    .social-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Ajustar menú central */
    .secondary-menu-link {
        padding: 15px 12px;
        font-size: 12px;
    }

    /* Ajustar sección de usuario */
    .user-section {
        gap: 12px;
    }

    .user-icon-button {
        min-width: 100px;
        padding: 8px 10px;
        height: 36px;
    }

    .user-text {
        font-size: 11px;
    }

    .user-greeting-horizontal {
        font-size: 11px;
    }

    .user-greeting-horizontal .user-name {
        max-width: 50px;
    }

    .wishlist-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* MÓVIL (768px y menos) */
@media (max-width: 768px) {
    .secondary-hamburger {
        display: flex;
    }

    .secondary-nav-wrapper {
        justify-content: space-between;
        position: relative;
    }

    /* Ocultar toda la sección izquierda en móvil */
    .left-section {
        display: none;
    }

    .center-menu-section {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .secondary-menu-list {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        transition: left 0.4s ease;
        overflow-y: auto;
        padding-top: 80px;
        z-index: 1001;
    }

    .secondary-menu-list.active {
        left: 0;
    }

    .secondary-menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .secondary-menu-link {
        padding: 18px 25px;
        font-size: 16px;
        border: none;
        width: 100%;
        text-align: left;
        color: #fff;
    }

    .secondary-menu-link::before {
        display: none;
    }

    .user-section {
        gap: 10px;
    }

    .user-icon-button {
        padding: 10px 12px;
        border-color: #494848;
    }

    .user-text {
        display: none;
    }

    .user-dropdown {
        right: 0;
        min-width: 200px;
    }

    .wishlist-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Overlay para cerrar menú */
    .secondary-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    .secondary-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Popups en móvil */
    .joinet-popup {
        max-width: 350px;
        margin: 20px;
    }

    .joinet-popup-content {
        padding: 20px;
    }

    /* Mi cuenta responsive */
    .joinet-account-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .joinet-account-nav {
        position: static;
        order: 2;
    }

    .joinet-account-content {
        order: 1;
    }
}