/*
Theme Name: Teccenter
Theme URI: https://www.acmethemes.com/themes/online-shop
Description: Child theme for Online Shop - Teccenter customizations
Author: Teccenter
Author URI: https://www.acmethemes.com/
Template: online-shop
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teccenter
*/

/* ==========================================================================
   Poppins Font Override - Reemplaza Open Sans y Oswald del tema padre
   ========================================================================== */

/* Aplicar Poppins a todo el sitio */
body,
button,
input,
select,
optgroup,
textarea {
    font-family: 'Poppins', sans-serif !important;
}

/* Títulos y encabezados */
h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.entry-title,
.widget-title {
    font-family: 'Poppins', sans-serif !important;
}

/* Menús y navegación */
.main-navigation,
.main-navigation a,
.top-header-menu,
.footer-menu {
    font-family: 'Poppins', sans-serif !important;
}

/* Botones y formularios */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.btn {
    font-family: 'Poppins', sans-serif !important;
}

/* WooCommerce elementos */
.woocommerce .button,
.woocommerce-page .button,
.woocommerce input.button,
.woocommerce a.button,
.woocommerce button.button {
    font-family: 'Poppins', sans-serif !important;
}

/* ==========================================================================
   Categories Menu Dropdown
   ========================================================================== */

/* Categories menu button styling */
.teccenter-categories-menu-item {
    position: relative;
}

.teccenter-categories-menu-item>a {
    background-color: #ff6600;
    color: #fff !important;
    padding: 12px 20px !important;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.teccenter-categories-menu-item>a:hover {
    background-color: #e55a00;
}

.teccenter-categories-menu-item>a i {
    margin-right: 8px;
}

/* Categories dropdown menu */
.teccenter-categories-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    margin: 0;
    padding: 10px 0;
}

/* Show dropdown on hover */
.teccenter-categories-menu-item:hover>.teccenter-categories-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Category items styling */
.teccenter-categories-menu .menu-item {
    position: relative;
    list-style: none;
    border-bottom: 1px solid #f0f0f0;
}

.teccenter-categories-menu .menu-item:last-child {
    border-bottom: none;
}

.teccenter-categories-menu .menu-item>a {
    display: block;
    padding: 12px 20px;
    color: #333 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.teccenter-categories-menu .menu-item>a:hover {
    background-color: #f8f8f8;
    color: #ff6600 !important;
    padding-left: 25px;
}

/* Product count badge */
.teccenter-categories-menu .count {
    float: right;
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

/* Subcategories styling */
.teccenter-categories-menu .menu-item-has-children>a::after {
    content: "\f105";
    font-family: FontAwesome;
    float: right;
    margin-left: 10px;
}

.teccenter-categories-menu .sub-menu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 250px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    padding: 10px 0;
    margin: 0;
}

.teccenter-categories-menu .menu-item-has-children:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Nested subcategories */
.teccenter-categories-menu .sub-menu .menu-item>a {
    padding-left: 25px;
}

.teccenter-categories-menu .sub-menu .sub-menu .menu-item>a {
    padding-left: 35px;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .teccenter-categories-menu-item {
        display: none;
    }
}

/* Sticky menu support */
.online-shop-enable-sticky-menu.sticky .teccenter-categories-menu-item>a {
    padding: 10px 18px !important;
}

/* Aquí puedes agregar tus estilos personalizados adicionales */

/* ==========================================================================
   Mobile Categories Button
   ========================================================================== */

/* Container hidden on desktop */
.teccenter-mobile-cat-container {
    display: none;
}

/* Touch active support for dropdown visibility (matches JS logic) */
.teccenter-categories-menu-item.touch-active>.teccenter-categories-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive styles */
@media screen and (max-width: 768px) {

    /* Show container on mobile - inside navbar */
    .teccenter-mobile-cat-container {
        display: block;
        float: left;
        /* Align to left */
        margin-left: 15px;
        /* Spacing from edge */
        margin-top: 10px;
        /* Vertical alignment */
        margin-bottom: 10px;
        position: relative;
        z-index: 1001;
        width: auto;
        /* Allow it to take only needed width */
    }

    /* Adjust navbar height or clear floats if needed */
    .main-navigation {
        min-height: 50px;
    }

    /* Override global hide rule for the mobile button wrapper */
    .teccenter-categories-menu-item.mobile-categories-btn {
        display: block !important;
        /* Force show */
        width: auto;
        display: inline-block;
    }

    /* Ensure the existing rule still hides the one in the menu if needed (list item) */
    .main-navigation li.teccenter-categories-menu-item {
        display: none !important;
    }

    /* Button specific styling for mobile context */
    .teccenter-categories-menu-item.mobile-categories-btn>a {
        display: inline-flex;
        align-items: center;
        background-color: #ff6600;
        /* Primary color */
        color: #fff !important;
        padding: 8px 15px;
        /* Slightly smaller padding for navbar */
        border-radius: 4px;
        font-weight: 500;
        font-size: 14px;
    }

    /* Icon spacing */
    .teccenter-categories-menu-item.mobile-categories-btn>a i {
        margin-right: 8px;
    }

    /* Dropdown positioning for mobile - adjust to screen width */
    .teccenter-categories-menu-item.mobile-categories-btn .teccenter-categories-menu {
        left: 0;
        top: 100%;
        width: 300px;
        max-width: 90vw;
        margin-top: 5px;
    }
}

/* Fix for whitespace when menu is collapsed on tablet/mobile */
@media screen and (max-width: 992px) {
    .header-main-menu {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    /* Ensure the container doesn't force height */
    .main-navigation .header-main-menu .wrapper {
        min-height: 0 !important;
    }
}

/* ==========================================================================
   Header Layout - Buscador y Carrito en línea
   ========================================================================== */

/* Hacer que el wrapper del header use flexbox para alinear elementos */
.site-header .wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

/* Logo a la izquierda */
.site-header .site-logo {
    flex: 0 0 auto;
}

/* Área de widgets (buscador) - ocupa espacio flexible */
.site-header .teccenter-header-right-widgets {
    flex: 1 1 auto;
    max-width: 600px;
    margin: 0 20px;
}

/* Carrito pequeño a la derecha del buscador */
.site-header .center-wrapper-mx-width {
    flex: 0 0 auto;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Asegurar que el carrito esté compacto */
.site-header .center-wrapper-mx-width .cart-section {
    margin: 0;
    padding: 0;
}

.site-header .center-wrapper-mx-width .wc-cart-wrapper {
    display: inline-block;
}

/* Ocultar elementos extra del header ads si los hay */
.site-header .center-wrapper-mx-width .header-ads-adv-search {
    display: none;
}

/* Responsive - en móvil apilar verticalmente */
@media screen and (max-width: 768px) {
    .site-header .wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .site-header .teccenter-header-right-widgets {
        max-width: 100%;
        margin: 10px 0;
        order: 2;
    }

    .site-header .center-wrapper-mx-width {
        order: 3;
        text-align: right;
    }

    .site-header .site-logo {
        order: 1;
    }
}

/* ==========================================================================
   WhatsApp Floating Button
   ========================================================================== */

.teccenter-whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

.teccenter-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: #20bd5a;
}

.teccenter-whatsapp-float:active {
    transform: scale(1.05);
}

.teccenter-whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

/* Pulse animation */
.teccenter-whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25D366;
    z-index: -1;
    animation: whatsappPulse 2s ease-out infinite;
}

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

/* Responsive - smaller on mobile */
@media screen and (max-width: 768px) {
    .teccenter-whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .teccenter-whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
    WhatsApp Checkout Button
    ========================================================================== */

.teccenter-checkout-whatsapp-wrapper {
    background: linear-gradient(135deg, #f8fff8 0%, #f0fff0 100%);
    border: 2px solid #25D366;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.15);
    position: relative;
    overflow: hidden;
}

/* Add subtle background pattern */
.teccenter-checkout-whatsapp-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.teccenter-checkout-whatsapp-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.teccenter-whatsapp-title {
    color: #128C7E;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.teccenter-whatsapp-title i {
    font-size: 1.2em;
    color: #25D366;
}

.teccenter-whatsapp-description {
    color: #667785;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.teccenter-checkout-whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    min-width: 250px;
}

/* Add shimmer effect */
.teccenter-checkout-whatsapp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.teccenter-checkout-whatsapp-btn:hover::before {
    left: 100%;
}

.teccenter-checkout-whatsapp-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #20bd5a 0%, #0f7a67 100%);
}

.teccenter-checkout-whatsapp-btn:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.teccenter-checkout-whatsapp-btn i {
    font-size: 1.2em;
    animation: whatsappBounce 2s ease-in-out infinite;
}

@keyframes whatsappBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* Loading state */
.teccenter-checkout-whatsapp-btn.loading {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.8;
}

.teccenter-checkout-whatsapp-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Hover state animation */
.teccenter-checkout-whatsapp-btn.hover {
    animation: buttonGlow 0.3s ease-in-out;
}

@keyframes buttonGlow {
    0% {
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(37, 211, 102, 0.5),
                    0 0 30px rgba(37, 211, 102, 0.2);
    }
    100% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .teccenter-checkout-whatsapp-wrapper {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .teccenter-whatsapp-title {
        font-size: 1.1em;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .teccenter-whatsapp-description {
        font-size: 0.9em;
        margin-bottom: 18px;
    }
    
    .teccenter-checkout-whatsapp-btn {
        padding: 12px 20px;
        font-size: 0.9em;
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

@media screen and (max-width: 480px) {
    .teccenter-checkout-whatsapp-wrapper {
        padding: 15px 12px;
        margin: 0 -10px 20px -10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .teccenter-checkout-whatsapp-btn {
        width: 100%;
        max-width: none;
        padding: 14px 25px;
    }
}

/* Dark mode support if needed */
@media (prefers-color-scheme: dark) {
    .teccenter-checkout-whatsapp-wrapper {
        background: linear-gradient(135deg, #1a2e1a 0%, #0d1f0d 100%);
        border-color: #25D366;
    }
    
    .teccenter-whatsapp-title {
        color: #4caf50;
    }
    
    .teccenter-whatsapp-description {
        color: #b0bec5;
    }
}