/**
 * Toyota Mega Menu - Frontend Styles
 * Version: 1.0.0
 */

/* ==========================================================================
   Reset y Base
   ========================================================================== */
.tmm-mega-menu * {
    box-sizing: border-box;
}

.tmm-mega-menu {
    position: relative;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.tmm-menu-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
}

/* ==========================================================================
   Logo
   ========================================================================== */
.tmm-logo {
    flex-shrink: 0;
    margin-right: 40px;
}

.tmm-logo-img {
    max-height: 50px;
    width: auto;
}

.tmm-site-name {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    text-decoration: none;
}

/* ==========================================================================
   Menu Items
   ========================================================================== */
.tmm-menu-items {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 10px;
}

.tmm-menu-item {
    position: relative;
}

.tmm-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.tmm-menu-link:hover {
    color: #e30613;
}

.tmm-dropdown-arrow {
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.tmm-menu-item:hover .tmm-dropdown-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   Dropdown / Mega Menu
   ========================================================================== */
.tmm-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background-color: #f8f8f8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.tmm-menu-item:hover > .tmm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tmm-mega-dropdown {
    left: 0;
    right: 0;
    width: auto;
    max-width: 1200px;
    margin: 0 auto;
}

.tmm-dropdown-inner {
    display: flex;
    padding: 30px;
    gap: 30px;
}

/* ==========================================================================
   Sidebar de Subcategorías
   ========================================================================== */
.tmm-dropdown-sidebar {
    flex-shrink: 0;
    width: 250px;
    border-right: 1px solid #e0e0e0;
    padding-right: 30px;
}

.tmm-subcategories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tmm-subcategory-item {
    margin-bottom: 5px;
}

.tmm-subcategory-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #333333;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.tmm-subcategory-item a:hover {
    background-color: #ffffff;
    color: #e30613;
}

.tmm-subcategory-item.active a {
    background-color: #ffffff;
    color: #e30613;
    font-weight: 600;
}

.tmm-arrow {
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tmm-subcategory-item:hover .tmm-arrow,
.tmm-subcategory-item.active .tmm-arrow {
    opacity: 1;
}

/* ==========================================================================
   Contenido del Dropdown
   ========================================================================== */
.tmm-dropdown-content {
    flex-grow: 1;
    position: relative;
}

.tmm-category-section {
    display: none;
}

.tmm-category-section.active,
.tmm-category-section:first-child {
    display: block;
}

/* ==========================================================================
   Grid de Vehículos
   ========================================================================== */
.tmm-vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.tmm-vehicle-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tmm-vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.tmm-vehicle-image {
    margin-bottom: 15px;
}

.tmm-vehicle-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tmm-vehicle-info {
    padding: 10px 0;
}

.tmm-vehicle-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #000000;
}

.tmm-vehicle-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tmm-vehicle-name a:hover {
    color: #e30613;
}

.tmm-vehicle-price {
    margin: 10px 0;
    color: #666666;
}

.tmm-price-subtitle {
    display: block;
    font-size: 12px;
    color: #999999;
    margin-bottom: 5px;
}

.tmm-price-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #e30613;
}

.tmm-vehicle-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 20px;
    background-color: transparent;
    border: 2px solid #e30613;
    color: #e30613;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tmm-vehicle-link:hover {
    background-color: #e30613;
    color: #ffffff;
}

/* ==========================================================================
   Botones CTA
   ========================================================================== */
.tmm-cta-buttons {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
    margin-left: 20px;
}

.tmm-cta-button {
    padding: 12px 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tmm-cta-button.secondary {
    background-color: #ffffff;
    border: 2px solid #e30613;
    color: #e30613;
}

.tmm-cta-button.secondary:hover {
    background-color: #e30613;
    color: #ffffff;
}

.tmm-cta-button.primary {
    background-color: #e30613;
    border: 2px solid #e30613;
    color: #ffffff;
}

.tmm-cta-button.primary:hover {
    background-color: #c10511;
    border-color: #c10511;
}

/* ==========================================================================
   Mobile Toggle
   ========================================================================== */
.tmm-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.tmm-hamburger {
    width: 100%;
    height: 3px;
    background-color: #333333;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.tmm-mobile-toggle.active .tmm-hamburger:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.tmm-mobile-toggle.active .tmm-hamburger:nth-child(2) {
    opacity: 0;
}

.tmm-mobile-toggle.active .tmm-hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .tmm-menu-container {
        padding: 15px 20px;
    }
    
    .tmm-menu-link {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .tmm-cta-buttons {
        gap: 10px;
    }
    
    .tmm-cta-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .tmm-vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */
@media screen and (max-width: 768px) {
    .tmm-menu-container {
        flex-wrap: wrap;
    }
    
    .tmm-mobile-toggle {
        display: flex;
    }
    
    .tmm-menu-items {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        margin-top: 20px;
    }
    
    .tmm-menu-items.active {
        display: flex;
    }
    
    .tmm-menu-item {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .tmm-menu-link {
        width: 100%;
        justify-content: space-between;
    }
    
    .tmm-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .tmm-menu-item.active > .tmm-dropdown {
        max-height: 2000px;
    }
    
    .tmm-dropdown-inner {
        flex-direction: column;
        padding: 15px;
    }
    
    .tmm-dropdown-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    .tmm-vehicles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tmm-cta-buttons {
        display: none;
        width: 100%;
        order: 4;
        flex-direction: column;
        margin: 15px 0 0 0;
    }
    
    .tmm-cta-buttons.active {
        display: flex;
    }
    
    .tmm-cta-button {
        width: 100%;
        text-align: center;
    }
    
    .tmm-category-section {
        display: block !important;
    }
}

/* ==========================================================================
   Utilidades
   ========================================================================== */
.tmm-hidden {
    display: none !important;
}

.tmm-visible {
    display: block !important;
}

/* ==========================================================================
   Animaciones
   ========================================================================== */
@keyframes tmm-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tmm-slideDown {
    from {
        max-height: 0;
    }
    to {
        max-height: 2000px;
    }
}

