/* ==========================================================================
   TAB SECTION COMPONENT
   ========================================================================== */

.tabsection-container {
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.tabsection-header {
    margin-bottom: 30px;
}

.tabsection-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--professional-primary, #5949ff);
    margin: 0;
    line-height: 1.2;
}

/* ==========================================================================
   TABS NAVIGATION
   ========================================================================== */

.tabsection-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabsection-tabs::-webkit-scrollbar {
    display: none;
}

.tabsection-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    color: var(--professional-text-muted, #6c757d);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    position: relative;
}

.tabsection-tab:hover {
    color: var(--professional-primary, #5949ff);
    background-color: var(--professional-bg-light, #f8f9fa);
}

.tabsection-tab.active {
    color: var(--professional-primary, #5949ff);
    border-bottom-color: var(--professional-primary, #5949ff);
    background-color: var(--professional-bg-light, #f8f9fa);
}

.tabsection-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--professional-primary-light, rgba(89, 73, 255, 0.2));
}

/* ==========================================================================
   CONTENT PANELS
   ========================================================================== */

.tabsection-content {
    position: relative;
    min-height: 200px;
}

.tabsection-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Transición suave para cambios de contenido */
.tabsection-panel {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel[style*="opacity: 0"] {
    transition: opacity 0.2s ease;
}

.tabsection-panel.fade-enter-active {
    transition: opacity 0.3s ease;
}

.tabsection-panel.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.tabsection-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px 20px;
    color: var(--professional-text-muted, #6c757d);
}

.tabsection-loading i {
    font-size: 24px;
    color: var(--professional-primary, #5949ff);
}

.tabsection-loading span {
    font-size: 16px;
    font-weight: 500;
}

/* ==========================================================================
   ERROR STATES
   ========================================================================== */

.tabsection-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--professional-danger-light, #f8d7da);
    color: var(--professional-danger, #dc3545);
    border: 1px solid var(--professional-danger-border, #f5c6cb);
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Fade Animation */
.tabsection-panel.fade-enter {
    opacity: 0;
    transform: translateY(10px);
}

.tabsection-panel.fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel.fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.tabsection-panel.fade-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Slide Left Animation */
.tabsection-panel.slide-left-enter {
    opacity: 0;
    transform: translateX(30px);
}

.tabsection-panel.slide-left-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel.slide-left-exit {
    opacity: 1;
    transform: translateX(0);
}

.tabsection-panel.slide-left-exit-active {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Slide Right Animation */
.tabsection-panel.slide-right-enter {
    opacity: 0;
    transform: translateX(-30px);
}

.tabsection-panel.slide-right-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel.slide-right-exit {
    opacity: 1;
    transform: translateX(0);
}

.tabsection-panel.slide-right-exit-active {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Scale Animation */
.tabsection-panel.scale-enter {
    opacity: 0;
    transform: scale(0.95);
}

.tabsection-panel.scale-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tabsection-panel.scale-exit {
    opacity: 1;
    transform: scale(1);
}

.tabsection-panel.scale-exit-active {
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .tabsection-title {
        font-size: 1.5rem;
    }
    
   
    
    .tabsection-tab {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .tabsection-content {
        min-height: 150px;
    }
    
    .tabsection-loading {
        padding: 30px 15px;
    }
    
    .tabsection-loading i {
        font-size: 20px;
    }
    
    .tabsection-loading span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tabsection-header {
        margin-bottom: 20px;
    }
    
    .tabsection-title {
        font-size: 1.25rem;
    }
    
  
    
    .tabsection-tab {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .tabsection-content {
        min-height: 120px;
    }
    
    .tabsection-loading {
        padding: 20px 10px;
        gap: 10px;
    }
    
    .tabsection-loading i {
        font-size: 18px;
    }
    
    .tabsection-loading span {
        font-size: 13px;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.tabsection-tab[aria-selected="true"] {
    color: var(--professional-primary, #5949ff);
    border-bottom-color: var(--professional-primary, #5949ff);
    background-color: var(--professional-bg-light, #f8f9fa);
}

.tabsection-panel[aria-hidden="false"] {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tabsection-panel[aria-hidden="true"] {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* Focus visible para navegación por teclado */
.tabsection-tab:focus-visible {
    outline: 2px solid var(--professional-primary, #5949ff);
    outline-offset: 2px;
}

/* ==========================================================================
   INTEGRATION WITH EXISTING COMPONENTS
   ========================================================================== */

/* Asegurar que los componentes anidados funcionen correctamente */
.tabsection-panel .slider-container,
.tabsection-panel .loop-container {
    width: 100%;
}

.tabsection-panel .product-card,
.tabsection-panel .category-card,
.tabsection-panel .blog-card {
    margin-bottom: 0; /* Reset margin para evitar espacios extra */
}

/* Animaciones suaves para contenido dinámico */
.tabsection-panel .slider-container,
.tabsection-panel .loop-container {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   GRID LAYOUT FOR LOOP WITHOUT SLIDER
   ========================================================================== */

/* Grid container cuando se usa loop sin slider */
.tabsection-panel .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Grid items */
.tabsection-panel .grid-item {
    width: 100%;
    opacity: 1;
    visibility: visible;
}

/* Responsive grid */
@media (max-width: 1024px) {
    .tabsection-panel .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .tabsection-panel .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .tabsection-panel .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
