/**
 * Estilos principales del sitio
 */

:root {
    /* Colores principales */
    --primary: #4e54c8;
    --primary-light: #8f94fb;
    --primary-dark: #292e7c;
    --secondary: #ff6b6b;
    --secondary-light: #ff9e9e;
    --secondary-dark: #c83845;
    
    /* Colores neutros */
    --dark: #333333;
    --gray-dark: #555555;
    --gray: #888888;
    --gray-light: #eeeeee;
    --light: #f8f9fa;
    
    /* Colores de estado */
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
    
    /* Fuentes */
    --font-family-base: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-headings: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Tamaños de fuente */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    
    /* Border radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Sombras */
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow-md: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);
    
    /* Transiciones */
    --transition-speed: 0.3s;
}

/* ===== ESTILOS BASE ===== */

body {
    font-family: var(--font-family-base);
    color: var(--dark);
    line-height: 1.6;
    background-color: var(--light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease-in-out;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ===== UTILITIES ===== */

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

/* ===== COMPONENTES ===== */

/* Navbar */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand img {
    max-height: 40px;
}

/* Tarjetas */
.card {
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: none;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card {
    overflow: hidden;
}

.product-card .card-img-top {
    transition: transform var(--transition-speed);
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 48px;
}

/* Hero banner */
.hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
}

/* Color options */
.color-option {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-speed);
}

.color-option:hover {
    transform: scale(1.1);
}

input[type="radio"]:checked + .color-option {
    border-color: var(--dark);
    transform: scale(1.1);
}

/* Size options */
.size-option {
    cursor: pointer;
    border: 1px solid #ccc;
    transition: all var(--transition-speed);
}

.size-option:hover {
    border-color: var(--primary);
}

input[type="radio"]:checked + .size-option {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Rating stars */
.rating-stars .rating-input {
    cursor: pointer;
    font-size: 1.5rem;
    margin-right: 2px;
    color: #ffc107;
}

/* Product quantity */
.product-quantity .form-control {
    text-align: center;
    min-width: 60px;
    max-width: 80px;
}

/* Thumbnail images */
.thumbnail-image {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-speed);
}

.thumbnail-image:hover {
    border-color: var(--primary-light);
}

.thumbnail-image.active {
    border-color: var(--primary);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    color: white;
}

/* Toast notifications */
.toast {
    z-index: 1080;
}

/* ===== ANIMACIONES ===== */

/* Fade in animation */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-element.show {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll animation */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== MEDIA QUERIES ===== */

/* Dispositivos extra pequeños (teléfonos, menos de 576px) */
@media (max-width: 575.98px) {
    .hero-banner {
        padding: var(--spacing-lg) 0;
    }
    
    .product-description img {
        max-width: 100%;
        height: auto;
    }
}

/* Dispositivos pequeños (tablets verticales, 576px y más) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
}

/* Dispositivos medianos (tablets horizontales, 768px y más) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
}

/* Dispositivos grandes (desktops, 992px y más) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

/* Dispositivos extra grandes (desktops grandes, 1200px y más) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}