/* Swiss-Style Color Palette */
:root {
    --color-bg-primary: #fefefe;          /* Hueso editorial */
    --color-bg-secondary: #1a1a1a;        /* Folder negro */
    --color-primary: #8B0000;             /* Vino - acento principal */
    --color-primary-light: #a52a2a;
    --color-secondary: #2c3e50;           /* Azul oscuro */
    --color-text: #333333;                /* Negro suave */
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 80px;
    
    /* Typography */
    --font-serif: 'Libre Baskerville', serif;
    --font-sans: 'Inter', sans-serif;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg-secondary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
}

h2.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Barra lateral usando Bootstrap */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-bg-secondary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1030;
    transition: all 0.3s;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    color: var(--color-primary);
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0;
    flex-grow: 1;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--color-primary);
}

.sidebar-menu a.active {
    background-color: rgba(139, 0, 0, 0.1);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.sidebar-menu i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.sidebar-footer p {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sidebar-social a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.sidebar-social a:hover {
    color: var(--color-primary);
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: var(--color-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1031;
}

.sidebar-toggle:hover {
    background-color: var(--color-primary-light);
    transform: scale(1.1);
}

/* Contenido principal */
#main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    width: calc(100% - var(--sidebar-width));
}

.sections-container {
    padding: 2rem;
}

/* Secciones base con Bootstrap */
.section-container {
    background-color: var(--color-bg-primary);
    padding: 3rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.section-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--color-primary);
}

/* Hero section usando Bootstrap */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
    padding: 0 !important;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6) blur(2px);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 4rem 1rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-section h1::after {
    display: none;
}

.hero-text {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.hero-image-container {
    margin-top: 3rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 5px solid rgba(255, 255, 255, 0.1);
}

/* Sección básica con Bootstrap */
.basic-image-container {
    position: relative;
    padding: 1rem;
}

.basic-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--color-shadow);
}

.basic-content {
    padding: 1rem;
}

.basic-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Sección columnas con Bootstrap Grid */
.columns-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.column-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--color-shadow);
    transition: transform 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.column-card:hover {
    transform: translateY(-5px);
}

.column-card.top-image .column-image-container {
    order: -1;
}

.column-card.bottom-image .column-image-container {
    order: 2;
}

.column-image-container {
    width: 100%;
    overflow: hidden;
}

.column-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s;
}

.column-card:hover .column-image {
    transform: scale(1.05);
}

.column-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.column-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

/* Carrusel con Bootstrap */
.carousel-section {
    position: relative;
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease;
    min-height: 400px;
    width: 100%;
}

.carousel-item {
    flex: 0 0 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.carousel-image-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.carousel-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--color-shadow);
}

.carousel-content {
    max-width: 800px;
    margin: 0 auto;
}

.carousel-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-border);
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background-color: var(--color-primary);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

/* Sección Clientes - Carrusel Continuo */
.clients-section {
    padding: 2rem 0;
    overflow: hidden;
    position: relative;
}

.clients-title {
    text-align: center;
    margin-bottom: 3rem;
}

.clients-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
}

.clients-track {
    display: flex;
    animation: scroll 30s linear infinite;
    width: calc(200px * 20);
}

.clients-track:hover {
    animation-play-state: paused;
}

.client-logo-container {
    flex: 0 0 200px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.client-logo {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
    padding: 10px;
}

.client-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-200px * 10));
    }
}

/* Gradientes en los bordes para efecto de desvanecimiento */
.clients-carousel::before,
.clients-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.clients-carousel::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg-primary), transparent);
}

.clients-carousel::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg-primary), transparent);
}

/* Contacto usando Bootstrap */
.contact-form .form-control {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    background-color: white;
    font-family: var(--font-sans);
}

.contact-form .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(139, 0, 0, 0.25);
}

.contact-info {
    background-color: var(--color-secondary);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    height: 100%;
}

.contact-info h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.contact-info-item {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.contact-icon {
    color: var(--color-primary);
    margin-right: 1rem;
    font-size: 1.2rem;
    min-width: 24px;
}

.contact-info-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Botones usando Bootstrap */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--color-bg-secondary);
    color: var(--color-bg-primary);
    font-size: 1.2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
    margin-right: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Polaroid effect */
.polaroid-container {
    position: relative;
    padding: 1rem 1rem 3rem 1rem;
    background-color: white;
    box-shadow: 0 4px 15px var(--color-shadow);
    transform: rotate(1deg);
    transition: transform 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
}

.polaroid-container:hover {
    transform: rotate(0deg) scale(1.02);
}

.polaroid-img {
    width: 100%;
    height: auto;
    display: block;
}

.polaroid-caption {
    text-align: center;
    margin-top: 1.5rem;
    font-family: var(--font-serif);
    color: var(--color-text);
    font-style: italic;
}

/* Responsive Design usando Bootstrap Breakpoints */
/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    #sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    #main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .section-container {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .sections-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    .carousel-image {
        height: 200px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-prev {
        left: 0.5rem;
    }
    
    .carousel-next {
        right: 0.5rem;
    }
    
    .client-logo-container {
        flex: 0 0 120px;
    }
    
    .clients-carousel::before,
    .clients-carousel::after {
        width: 30px;
    }
    
    @keyframes scroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-120px * 10));
        }
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    #sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    #main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .section-container {
        padding: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .carousel-image {
        height: 250px;
    }
    
    .client-logo-container {
        flex: 0 0 150px;
    }
    
    .clients-carousel::before,
    .clients-carousel::after {
        width: 50px;
    }
    
    @keyframes scroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-150px * 10));
        }
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    #sidebar {
        width: 280px;
    }
    
    #main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .columns-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    #sidebar {
        width: var(--sidebar-width);
    }
    
    #main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
    
    .columns-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .columns-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Sidebar states */
body.sidebar-open #sidebar {
    transform: translateX(0);
}

body.sidebar-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029;
}

body.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-header h2,
body.sidebar-collapsed .sidebar-header p,
body.sidebar-collapsed .sidebar-menu span,
body.sidebar-collapsed .sidebar-footer {
    display: none;
}

body.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0.75rem;
}

body.sidebar-collapsed .sidebar-menu i {
    margin-right: 0;
    font-size: 1.2rem;
}

body.sidebar-collapsed #main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

body.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Utilidades adicionales */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.object-fit-cover {
    object-fit: cover;
}

.z-index-1 {
    z-index: 1;
}

.z-index-2 {
    z-index: 2;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}

/* Mejoras para accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles para accesibilidad */
:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #sidebar,
    .sidebar-toggle {
        display: none;
    }
    
    #main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .section-container {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .btn-primary {
        background-color: white;
        color: black;
        border: 1px solid #000;
    }
}