/* 
 * Estilos Dinámicos - Ferretería Dorrego
 * Diseño Antigravity: Vibrante, dinámico y moderno
 */

/* ========== Variables CSS ========== */
:root {
    /* Paleta de Naranjas Vibrantes */
    --orange-1: #FF6B35;
    /* Naranja brillante */
    --orange-2: #FF8C42;
    /* Naranja medio */
    --orange-3: #FFA560;
    /* Naranja suave */
    --orange-4: #FFB775;
    /* Naranja claro */
    --orange-5: #FFCC9E;
    /* Naranja pastel */
    --primary: #D84315;
    /* Rojo-naranja principal */
    --primary-dark: #BF360C;
    /* Rojo oscuro */
    --secondary: #F57C00;
    /* Naranja cálido */
    --accent: #FFA726;
    /* Amarillo-naranja */

    /* Colores de apoyo */
    --success: #43A047;
    --warning: #FB8C00;
    --danger: #E53935;
    --info: #1E88E5;

    /* Grises y fondos */
    --dark: #1a1a1a;
    --gray-dark: #2d2d2d;
    --gray: #757575;
    --gray-light: #e0e0e0;
    --bg-light: #faf8f5;
    --white: #FFFFFF;

    /* Tipografía */
    --font-primary: 'Roboto', 'Arial', sans-serif;
    --font-heading: 'Roboto Slab', serif;

    /* Sombras dinámicas */
    --shadow-sm: 0 2px 8px rgba(216, 67, 21, 0.1);
    --shadow-md: 0 4px 16px rgba(216, 67, 21, 0.15);
    --shadow-lg: 0 8px 32px rgba(216, 67, 21, 0.2);
    --shadow-xl: 0 16px 48px rgba(216, 67, 21, 0.25);
    --glow-orange: 0 0 20px rgba(255, 107, 53, 0.4);

    /* Transiciones */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Reset y Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--dark);
    background: var(--bg-light);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(216, 67, 21, 0.02) 35px, rgba(216, 67, 21, 0.02) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(245, 124, 0, 0.02) 35px, rgba(245, 124, 0, 0.02) 70px);
    line-height: 1.6;
    overflow-x: hidden;
    /* Protección de contenido */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ========== Animaciones ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.animate-on-scroll {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

/* ========== Layout ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

.col,
[class*="col-"] {
    padding: 0 1rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-8 {
    flex: 0 0 66.666%;
    max-width: 66.666%;
}

.col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
}

/* ========== Header Dinámico ========== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--orange-2) 100%);
    color: var(--white);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideInLeft 0.6s ease;
}

.header-top {
    background: linear-gradient(90deg, var(--primary-dark) 0%, rgba(191, 54, 12, 0.8) 100%);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info a,
.social-links a {
    color: var(--white);
    margin-right: 1rem;
    transition: var(--transition-fast);
    text-decoration: none;
}

.contact-info a:hover,
.social-links a:hover {
    color: var(--orange-4);
    transform: translateY(-2px);
}

.header-main {
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* animation: float 3s ease-in-out infinite; */
}

.logo img {
    height: 100px;
    width: auto;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
}

.logo img:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
    transform: translateY(-2px);
}

.logo i {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========== Navegación ========== */
.nav {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav a {
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-fast);
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========== Categorías Dinámicas ========== */
.categorias {
    padding: 4rem 0;
}

.categorias h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--orange-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease;
    position: relative;
}

.categorias h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--orange-1), var(--orange-3));
    border-radius: 2px;
}

.categoria-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.categoria-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--orange-1), var(--orange-3));
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.categoria-card:hover::before {
    opacity: 1;
}

.categoria-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--glow-orange);
    border-color: var(--orange-2);
}

.categoria-card i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--orange-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    filter: drop-shadow(0 4px 8px rgba(216, 67, 21, 0.2));
}

.categoria-card:hover i {
    transform: scale(1.2) rotate(5deg);
    -webkit-text-fill-color: white;
    filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.4));
}

.categoria-card h4 {
    color: var(--dark);
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.categoria-card:hover h4 {
    color: var(--white);
    transform: scale(1.02);
}

/* Efecto shimmer en hover */
.categoria-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

/* ========== Productos Cards ========== */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(216, 67, 21, 0.1);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
    border-color: var(--orange-2);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: #fbfbfb;
    padding: 10px;
    transition: var(--transition);
}

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

.producto-card {
    position: relative;
    overflow: hidden;
}

.producto-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--danger), #FF6B6B);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 10;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
    font-weight: 700;
}

.card-text {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.producto-precio {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--orange-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.producto-precio-anterior {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* ========== Botones Dinámicos ========== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--orange-2));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--glow-orange);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ========== Footer ========== */
.footer {
    background: linear-gradient(135deg, var(--dark), var(--gray-dark));
    color: var(--gray-light);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer h4 {
    color: var(--orange-3);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer a {
    color: var(--gray-light);
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--orange-2);
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

/* ========== WhatsApp Float ========== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    transition: var(--transition);
    animation: whatsappPulse 2s infinite;
    text-decoration: none;
}

@keyframes whatsappPulse {

    0%,
    100% {
        box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
        transform: scale(1.05);
    }
}

.whatsapp-float:hover {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(37, 211, 102, 0.6);
    animation: none;
}

/* ========== Utilidades ========== */
.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-4 {
    margin-top: 2rem;
}

.pt-4 {
    padding-top: 2rem;
}

.pt-5 {
    padding-top: 3rem;
}

.pb-4 {
    padding-bottom: 2rem;
}

.pb-5 {
    padding-bottom: 3rem;
}

/* ========== Responsive - MOBILE FIRST ========== */

/* Tablets y móviles grandes (hasta 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1rem;
    }

    .categoria-card i {
        font-size: 3rem;
    }

    .producto-precio {
        font-size: 1.5rem;
    }
}

/* Tablets (hasta 768px) */
@media (max-width: 768px) {

    /* Header optimizado para móvil */
    .header-main {
        padding: 0.75rem 0;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo img {
        height: 60px;
    }

    .logo i {
        font-size: 2rem !important;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    /* Navegación móvil mejorada */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }

    .nav.active {
        display: flex;
    }

    .nav li {
        width: 100%;
    }

    .nav a {
        display: block;
        padding: 1rem;
        text-align: center;
        font-size: 1.1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    .nav-toggle {
        display: block;
        padding: 0.75rem;
        font-size: 1.5rem;
    }

    /* Grillas responsivas */
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-7,
    .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Títulos más pequeños */
    .categorias h2,
    .section-title {
        font-size: 1.75rem;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Cards de categoría optimizadas */
    .categoria-card {
        padding: 1.5rem 1rem;
    }

    .categoria-card i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .categoria-card h4 {
        font-size: 1.1rem;
    }

    /* Cards de producto optimizadas */
    .card-img {
        height: 200px;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.9rem;
    }

    /* Botones más grandes para touch */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        /* Tamaño mínimo recomendado para touch */
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }

    .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    /* WhatsApp button más visible */
    .whatsapp-float {
        width: 56px;
        height: 56px;
        font-size: 28px;
        bottom: 20px;
        right: 20px;
    }

    /* Footer más compacto */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer h4 {
        font-size: 1.25rem;
    }

    /* Espaciados reducidos */
    .pt-5 {
        padding-top: 2rem;
    }

    .pb-5 {
        padding-bottom: 2rem;
    }

    .mb-4 {
        margin-bottom: 1.5rem;
    }

    .mb-5 {
        margin-bottom: 2rem;
    }
}

/* Móviles (hasta 480px) */
@media (max-width: 480px) {

    /* Typography aún más pequeña */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    /* Header más compacto */
    .header-top {
        font-size: 0.75rem;
        padding: 0.375rem 0;
    }

    .header-top .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .contact-info,
    .social-links {
        width: 100%;
        justify-content: center;
    }

    .contact-info a {
        margin: 0 0.5rem;
    }

    /* Categorías en una sola columna en móviles pequeños */
    .categoria-card {
        margin-bottom: 1rem;
    }

    /* Productos con imágenes más pequeñas */
    .card-img {
        height: 180px;
    }

    /* Precios más visibles */
    .producto-precio {
        font-size: 1.5rem;
    }

    .producto-precio-anterior {
        font-size: 0.9rem;
    }

    /* Badges de descuento ajustados */
    .producto-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Botones full width en móvil pequeño */
    .btn-lg {
        width: 100%;
        padding: 1rem;
    }

    /* Formularios más usables */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px;
        /* Evita zoom en iOS */
        min-height: 48px;
    }

    /* WhatsApp button */
    .whatsapp-float {
        width: 52px;
        height: 52px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }

    /* Sidebar sticky deshabilitado en móvil */
    .card[style*="position: sticky"] {
        position: static !important;
    }
}

/* Landscape móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .header-main {
        padding: 0.5rem 0;
    }

    .logo i {
        font-size: 1.75rem !important;
    }

    .logo-text {
        font-size: 1.1rem;
    }
}

/* Muy pequeños (320px) */
@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* ========== Modals ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #eee;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.discount-badge-float {
    position: fixed;
    left: 30px;
    bottom: 30px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--orange-1), var(--orange-3));
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(216, 67, 21, 0.3);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    animation: float 4s ease-in-out infinite;
}

.discount-badge-float:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 30px rgba(216, 67, 21, 0.5);
}