:root {
    --primary: #E50914; /* Ridestone Red */
    --primary-hover: #b8050e;
    --dark: #0a0a0a;
    --darker: #000000;
    --light: #ffffff;
    --gray: #e0e0e0;
    --card-bg: #141414;
    --border: #333333;
    --accent: #ffd700;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --text-light: #f4f4f4;
    --text-gray: #aaaaaa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    line-height: 1.6;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="12" fill="none" stroke="%23111" stroke-width="8" stroke-dasharray="4 1"/><circle cx="16" cy="16" r="7" fill="none" stroke="%23ccc" stroke-width="2"/><path d="M16 9v14M9 16h14M11 11l10 10M11 21l10-10" stroke="%23aaa" stroke-width="1.5"/><circle cx="16" cy="16" r="3" fill="%23ffd700"/></svg>') 16 16, auto;
}

a, button, .nav-link, .desktop-toggle, .hamburger, .dropdown-link {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="12" fill="none" stroke="%23111" stroke-width="8" stroke-dasharray="4 1"/><circle cx="16" cy="16" r="7" fill="none" stroke="%23ccc" stroke-width="2"/><path d="M16 9v14M9 16h14M11 11l10 10M11 21l10-10" stroke="%23aaa" stroke-width="1.5"/><circle cx="16" cy="16" r="3" fill="%23e60000"/></svg>') 16 16, pointer !important;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--darker);
    border-right: 1px solid #222;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #222;
}

.sidebar.collapsed .sidebar-header {
    padding: 2rem 0;
    justify-content: center;
}

.sidebar-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.sidebar-logo .logo-subtitle {
    color: var(--text-light);
    display: block;
    font-size: 1.2rem;
    letter-spacing: 5px;
    font-weight: 400;
    margin-top: -5px;
}

.logo-icon {
    display: none;
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

.sidebar.collapsed .logo-icon {
    display: block;
}

.desktop-toggle {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.desktop-toggle:hover {
    color: var(--accent);
}

.sidebar.collapsed .desktop-toggle {
    display: none;
}

.nav-menu {
    list-style: none;
    padding: 1.5rem 0;
    flex-grow: 1;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar.collapsed .nav-link {
    padding: 1rem 0;
    justify-content: center;
}

.nav-icon {
    min-width: 24px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.nav-text {
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-light);
    background-color: rgba(230, 0, 0, 0.05);
    border-left-color: var(--primary);
}

.nav-link:hover .nav-icon svg {
    stroke: var(--accent);
}

/* Dropdown Styles */
.dropdown-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #0f0f0f;
}

.nav-item.open .dropdown-container, .sidebar.collapsed .nav-item:hover .dropdown-container {
    max-height: 200px;
}

/* Behavior for collapsed sidebar */
.sidebar.collapsed .dropdown-container {
    position: absolute;
    left: var(--sidebar-collapsed-width);
    top: 0;
    width: 200px;
    border-left: 2px solid var(--primary);
    background-color: var(--darker);
    z-index: 1001;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    max-height: 0;
}

.dropdown-list {
    list-style: none;
    padding: 0;
}

.dropdown-link {
    display: block;
    padding: 0.8rem 1.5rem 0.8rem 4.5rem;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.sidebar.collapsed .dropdown-link {
    padding-left: 1.5rem;
}

.dropdown-link::before {
    content: "•";
    position: absolute;
    left: 3.5rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar.collapsed .dropdown-link::before {
    left: 0.5rem;
}

.dropdown-link:hover, .dropdown-link.active {
    color: var(--accent);
    padding-left: 4.7rem;
}

.sidebar.collapsed .dropdown-link:hover, .sidebar.collapsed .dropdown-link.active {
    padding-left: 1.7rem;
}

.dropdown-link:hover::before, .dropdown-link.active::before {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    font-size: 0.8rem;
    color: #555;
    text-align: center;
    border-top: 1px solid #222;
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

/* Mobile Hamburger Menu */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--darker);
    z-index: 999;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #222;
}

.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

.mobile-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: bold;
    margin: 0;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    margin-left: calc(var(--sidebar-width) + 2rem);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .container {
    margin-left: calc(var(--sidebar-collapsed-width) + 2rem);
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .container, .sidebar.collapsed ~ .container {
        margin-left: auto;
        padding-top: 80px;
    }
    .mobile-header {
        display: flex;
    }
    .overlay.open {
        display: block;
        opacity: 1;
    }
    .desktop-toggle {
        display: none !important;
    }
}

.filters {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--light);
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(229,9,20,0.3);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 15px rgba(229,9,20,0.2);
    border-color: var(--primary);
}

.card-image-container {
    height: 300px;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 1rem;
}

/* Máscara para ocultar el bloque de contacto/teléfonos original de las imágenes */
.card-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 155px;
    height: 85px;
    background-color: #1a1a1a;
    z-index: 1;
    border-bottom-right-radius: 8px;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    right: auto;
    color: white;
    font-family: 'Oswald', sans-serif;
    width: auto;
    min-width: 130px;
    padding: 0.4rem 1rem;
    height: auto;
    min-height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    z-index: 10;
    white-space: nowrap;
}

.card-badge.right-side {
    left: auto;
    right: 15px;
    top: 15px;
    width: auto;
    height: auto;
    padding: 0.3rem 0.8rem;
    font-size: 1.2rem;
}

.card-badge.disponible {
    background-color: #2e7d32;
}

.card-badge.pocas {
    background-color: #e67e22;
}

.card-badge.ultimas {
    background-color: #d32f2f;
}

.card-badge.agotado {
    background-color: #555;
}


.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-code {
    font-family: 'Oswald', sans-serif;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-model {
    font-size: 1.1rem;
    color: var(--light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.card-price {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light);
}

.btn-whatsapp {
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
    text-align: center;
}

.btn-whatsapp:hover {
    background-color: #1ebe57;
}

.btn-mayorista {
    background-color: #ffd700;
    color: #000;
    border: none;
    text-decoration: none;
    padding: 0.6rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-mayorista:hover {
    background-color: #e5c100;
    color: #000;
}

.btn-whatsapp.disabled, .btn-mayorista.disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
    pointer-events: none;
}

.footer {
    background-color: var(--darker);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p {
    margin: 0.5rem 0;
    color: var(--gray);
}

@media (max-width: 768px) {
    .logo {
        font-size: 2.2rem;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    .container {
        padding: 1rem;
    }
}
