/* assets/css/styles.css */

:root {
    --primary-color: #dc3545;
    --secondary-color: #fd7e14;
    --success-color: #20c997;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    --gradient-secondary: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

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

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

.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline-primary-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary-custom:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    color: white;
}

/* Header & Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

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

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card {
    border-radius: 20px;
    overflow: hidden;
}

.product-card .card-body {
    padding: 1.5rem;
}

/* Spice Level Indicators */
.spice-level {
    display: flex;
    gap: 2px;
    align-items: center;
}

.spice-drop {
    width: 12px;
    height: 16px;
    background: #ddd;
    border-radius: 0 0 50% 50%;
    position: relative;
}

.spice-drop.active {
    background: var(--gradient-primary);
}

.spice-drop::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: inherit;
    border-radius: 50%;
}

/* Price Display */
.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-old {
    font-size: 1rem;
    color: #6c757d;
    text-decoration: line-through;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="chile" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23chile)"/></svg>');
}

.hero-container {
    background: rgba(50, 50, 50, 0.35);
    border-radius: 12px;
    padding: 2rem;
    height: 500px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Testimonials */
.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.testimonial-rating {
    color: #ffc107;
    margin-bottom: 1rem;
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
}

/* Blog/Recipe Cards */
.recipe-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.recipe-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem;
}

.recipe-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Cart */
.cart-item {
    border: none;
    border-bottom: 1px solid #eee;
    padding: 1.5rem 0;
}

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

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.25rem;
}

/* Admin Dashboard */
.admin-card {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.admin-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-icon {
    font-size: 3rem;
    opacity: 0.1;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

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

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Checkout Steps */
.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.checkout-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.checkout-step {
    background: white;
    border: 3px solid #e9ecef;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6c757d;
    position: relative;
    z-index: 2;
}

.checkout-step.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.checkout-step.completed {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

/* FAQ Accordion */
.accordion-button {
    background: white;
    border: none;
    box-shadow: none;
    font-weight: 500;
}

.accordion-button:not(.collapsed) {
    background: var(--light-color);
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Contact Form */
.contact-form {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.contact-info {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    padding: 3rem;
}

.contact-info h5 {
    margin-bottom: 1.5rem;
}

.contact-info .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.contact-info .contact-item i {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

/* Product Detail */
.product-gallery {
    position: sticky;
    top: 100px;
}

.main-product-image {
    border-radius: 20px;
    width: 100%;
    height: 400px;
    object-fit: cover;
    margin-bottom: 1rem;
}

.thumbnail-images {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

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

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 100px;
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Price Range */
.price-range {
    margin: 1rem 0;
}

.price-range input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Badge Customizations */
.badge-spice {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.badge-stock {
    background: var(--success-color);
    color: white;
}

.badge-out-of-stock {
    background: #6c757d;
    color: white;
}

/* Newsletter */
.newsletter-section {
    background: var(--gradient-secondary);
    color: white;
    padding: 4rem 0;
    border-radius: 0;
}

.newsletter-section .form-control {
    border-radius: 25px;
    border: none;
    padding: 0.75rem 1.5rem;
}

.newsletter-section .btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    background: white;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

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

    .contact-form,
    .contact-info {
        padding: 2rem;
    }

    .main-product-image {
        height: 300px;
    }

    .product-gallery {
        position: static;
    }

    .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .checkout-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Custom Utilities */
.rounded-custom {
    border-radius: 20px !important;
}

.shadow-custom {
    box-shadow: var(--shadow-md) !important;
}

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

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.spinner-custom {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid rgba(220, 53, 69, 0.2);
    border-top: 0.3rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success Messages */
.alert-custom {
    border: none;
    border-radius: 15px;
    padding: 1rem 1.5rem;
}

.alert-success-custom {
    background: rgba(32, 201, 151, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger-custom {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 90px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.back-to-top.show {
    display: flex;
}

/* ===== Contacto (scoped) ===== */
#contacto .contacto-card,
#contacto .contacto-side {
    border-radius: 16px;
}

#contacto .form-control {
    border-radius: 12px;
    padding: 0.7rem 1rem;
}

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

#contacto .btn-primary:hover {
    filter: brightness(0.95);
}

#contacto .btn-success {
    background: #25D366;
    border-color: #25D366;
}

#contacto .contacto-side {
    background: #fff6f3;
    /* tono suave */
}

@media (max-width: 991.98px) {
    #contacto .contacto-side {
        order: 2;
    }

    #contacto .contacto-card {
        order: 1;
    }
}


.list-ubicaciones .list-group-item {
    border-radius: 10px;
    margin-bottom: .5rem;
    cursor: pointer;
}

.list-ubicaciones .list-group-item.active {
    background: var(--secondary-color, #0d6efd);
    border-color: var(--secondary-color, #0d6efd);
}

.list-ubicaciones .small-mute {
    color: #6c757d;
    font-size: .85rem;
}

/* WhatsApp Widget Base */
.whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Main WhatsApp Button */
.whatsapp-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-button i {
    font-size: 2rem;
    color: white;
    z-index: 2;
    position: relative;
}

/* Pulse Animation */
.whatsapp-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Chat Window */
.whatsapp-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-height: 650px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.whatsapp-chat.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Chat Header */
.whatsapp-chat-header {
    background: #075E54;
    padding: 15px;
    color: white;
}

.whatsapp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.whatsapp-chat-body {
    height: 300px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #e5ddd5 0%, #d2dbdc 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="whatsapp-bg" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgba(0,0,0,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23whatsapp-bg)"/></svg>');
}

.whatsapp-messages {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Messages */
.whatsapp-message {
    max-width: 80%;
    animation: messageSlideIn 0.3s ease-out;
}

.whatsapp-message.received {
    align-self: flex-start;
}

.whatsapp-message.sent {
    align-self: flex-end;
}

.message-content {
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.whatsapp-message.received .message-content {
    background: white;
    border-bottom-left-radius: 5px;
}

.whatsapp-message.sent .message-content {
    background: #DCF8C6;
    border-bottom-right-radius: 5px;
}

.message-content p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.message-content p:last-of-type {
    margin-bottom: 0;
}

.message-time {
    font-size: 11px;
    color: #999;
    float: right;
    margin-top: 5px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Quick Options */
.quick-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.quick-option {
    background: #f0f2f5;
    border: 1px solid #e4e6ea;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 13px;
    color: #1c1e21;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quick-option:hover {
    background: #e4e6ea;
    transform: translateY(-1px);
}

/* Chat Footer */
.whatsapp-chat-footer {
    background: white;
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

.whatsapp-input {
    border-radius: 25px;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
    font-size: 14px;
}

.whatsapp-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.whatsapp-contact-options {
    margin-top: 15px;
}

/* Notification Dot */
.whatsapp-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    animation: notificationBounce 1s infinite;
}

@keyframes notificationBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

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

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-chat {
        width: 320px;
        bottom: 80px;
        right: -10px;
    }

    .whatsapp-button {
        width: 55px;
        height: 55px;
    }

    .whatsapp-button i {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .whatsapp-chat {
        width: 300px;
        max-height: 450px;
        bottom: 80px;
        right: -20px;
    }

    .whatsapp-chat-body {
        height: 250px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .whatsapp-chat {
        background: #1e1e1e;
    }

    .whatsapp-chat-body {
        background: #2d2d2d;
    }

    .whatsapp-message.received .message-content {
        background: #3d3d3d;
        color: white;
    }

    .quick-option {
        background: #404040;
        border-color: #555;
        color: white;
    }

    .quick-option:hover {
        background: #505050;
    }
}

/* Animation for new messages */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

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

    30% {
        transform: translateY(-10px);
    }
}