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

:root {
    --primary-color: #ff0000;
    --secondary-color: #ffffff;
    --accent-color: #b30000;
    --dark-color: #2d3142;
    --light-color: #f5f5f5;
    --text-color: #333;
    --card-shadow: 0 8px 16px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

header {
    background: #ff0000;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 70px;
    width: auto;
    border-radius: 8px;
    margin-right: 15px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-right: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

nav a.active {
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid white;
}

#cart-icon {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

#cart-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

#cart-count {
    background-color: var(--secondary-color);
    color: rgb(0, 0, 0);
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
}

.search-container {
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(to bottom, #f9f9f9, #f0f0f0);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.05);
}

.search-title {
    font-size: 2.8em;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 700;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.search-options {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    justify-content: center;
}

.search-option {
    padding: 0.8rem 2.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    background: transparent;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.search-option:hover,
.search-option.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.search-box {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 1rem 0;
    transition: var(--transition);
    outline: none;
}

.search-box:focus {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 50vh;
    display: none;
    opacity: 0;
    transition: all 0.5s ease;
}

.section.active {
    display: block;
    opacity: 1;
}

#productos, #servicios {
    background: var(--light-color);
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
    font-weight: 700;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

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

.card {
    border: none;
    border-radius: 12px;
    text-align: left;
    background: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    animation: fadeSlideUp 0.5s ease forwards;
    opacity: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

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

.card h3 {
    color: var(--dark-color);
    margin: 1rem 0;
    font-size: 1.3rem;
    padding: 0 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.card p {
    color: #555;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    padding: 0 1rem;
    flex-grow: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.card .precio {
    color: black;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.card button {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    transition: var(--transition);
    width: 80%;
    margin: 1rem auto;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    display: block;
    
}

.card button:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#servicios .card button {
    background: var(--accent-color);
    color: white;
}

#servicios .card button:hover {
    background: #3db9b1;
}

.section-divider {
    height: 100px;
    background: linear-gradient(to right bottom, #f5f7fa 49.9%, #e0c3fc 50%);
    margin: -50px 0;
    position: relative;
    z-index: 1;
}

.content-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--light-color);
}

.slide-transition {
    animation: slideTransition 0.5s ease forwards;
}

@keyframes slideTransition {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out {
    animation: slideOut 0.5s ease forwards;
}

@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 2.5rem;
    max-width: 550px;
    width: 90%;
    margin: 5% auto;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-70px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.8rem;
}

.cart-items-horizontal {
    display: flex;
    flex-wrap: nowrap; 
    overflow-x: auto; 
    padding: 10px; 
}

.cart-items-horizontal div {
    flex: 0 0 auto; 
    margin-right: 15px; 
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    white-space: nowrap; 
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

input, textarea {
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.modal button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.modal button:hover {
    background: #3a5a8c;
    transform: translateY(-2px);
}

#close-cart, #close-service {
    background: #e0e0e0;
    color: #666;
    margin-top: 1rem;
}

#close-cart:hover, #close-service:hover {
    background: #d0d0d0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    animation: fadeIn 0.3s ease;
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
}

.quantity-controls button {
    padding: 0.3rem 0.6rem;
    margin: 0 0.5rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.quantity-controls button:hover {
    background: #f0f0f0;
    transform: translateY(0);
}

#cart-total {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: right;
    margin: 1rem 0;
    color: var(--primary-color);
}

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

.results-container {
    margin-top: 2rem;
    min-height: 300px;
}

#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: var(--transition);
    z-index: 1000;
}

#back-to-top:hover {
    background: #3a5a8c;
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
    .search-container {
        padding: 2rem 1rem 1.5rem;
    }
    
    .search-title {
        font-size: 2rem;
    }
    
    .search-options {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 1rem;
    }
    
    .search-option {
        width: 100%;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .logo-img {
        height: 50px;
    }
    
    nav {
        padding: 0.5rem;
    }
    
    .nav-links a {
        margin-right: 0.5rem;
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .card h3 {
        font-size: 1.1rem;
    }
    
    .section h2 {
        font-size: 2rem;
    }
}

/* Estilos actualizados para el carrusel de imágenes */
.image-slider {
    position: relative;
    width: 100%;
  
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    
}

.image-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease, transform 0.4s ease;
    cursor: grab;
}

.image-slider img:active {
    cursor: grabbing;
    transform: scale(1.02);
}

.image-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.indicator:hover {
    transform: scale(1.3);
    opacity: 0.8;
}

.active-indicator {
    background: var(--primary-color);
    transform: scale(1.3);
    opacity: 1;
}

/* Mejora la apariencia de los carruseles en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .image-slider::after {
        content: '';
        position: absolute;
        bottom: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        opacity: 0.8;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='none' stroke='%23333' stroke-width='2' d='M5,12 L19,12 M12,5 L19,12 L12,19'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        pointer-events: none;
    }
}

/* Animación para cambio de imágenes */
@keyframes fadeImage {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.image-slider img {
    animation: fadeImage 0.4s ease-in-out;
}

/* Para dispositivos muy pequeños */
@media (max-width: 480px) {
    .logo-img {
        height: 40px;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .card h3 {
        font-size: 1rem;
    }
    
    .card p {
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* Mejoras para las descripciones de los productos */
.card p.descripcion {
    max-height: none;
    overflow: visible;
    display: -webkit-box;
    -webkit-line-clamp: initial;
    -webkit-box-orient: vertical;
    text-overflow: initial;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}