/**
 * DOCHI — Main CSS
 * Reset de Storefront + paleta + tipografía + header + footer + WhatsApp
 */

/* === VARIABLES === */
:root {
    --dochi-bg: #F5F5F5;
    --dochi-card-bg: #FFFFFF;
    --dochi-card-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --dochi-text-price: #1A1A1A;
    --dochi-text-wholesale: #888888;
    --dochi-text-name: #333333;
    --dochi-text-secondary: #999999;
    --dochi-border: #E0E0E0;
    --dochi-border-light: #E8E8E8;
    --dochi-input-bg: #F0F0F0;
    --dochi-badge-offer-bg: #FFF176;
    --dochi-badge-offer-text: #333333;
    --dochi-badge-new-bg: #E8F5E9;
    --dochi-badge-new-text: #2E7D32;
    --dochi-accent: #E91E63;
    --dochi-accent-dark: #C2185B;
    --dochi-white: #FFFFFF;
    --dochi-radius: 12px;
    --dochi-radius-lg: 16px;
    --dochi-radius-pill: 24px;
    --dochi-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === RESET STOREFRONT === */
.storefront-primary-navigation,
.storefront-secondary-navigation,
.storefront-handheld-footer-bar,
.site-branding,
.woocommerce-breadcrumb,
.storefront-sorting,
.page-header,
#secondary,
.widget-area {
    display: none !important;
}

body.woocommerce,
body.woocommerce-page {
    background: var(--dochi-bg) !important;
}

.site-content,
.content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.col-full {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 !important;
}

/* === BASE === */
* {
    box-sizing: border-box;
}

body {
    background: var(--dochi-bg) !important;
    font-family: var(--dochi-font) !important;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* === HEADER === */
.dochi-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--dochi-white);
    border-bottom: 1px solid var(--dochi-border-light);
    transition: height 0.2s ease;
}

.dochi-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 56px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.dochi-header-logo {
    text-decoration: none;
    flex-shrink: 0;
}

.dochi-header-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.dochi-header-logo span {
    font-weight: 800;
    font-size: 22px;
    color: var(--dochi-text-price);
    letter-spacing: -0.5px;
}

/* Buscador */
.dochi-search-wrapper {
    flex: 1;
    position: relative;
    z-index: 100;
}

.dochi-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.dochi-search-input {
    width: 100% !important;
    padding: 10px 16px 10px 38px !important;
    background: var(--dochi-input-bg) !important;
    border: none !important;
    border-radius: var(--dochi-radius) !important;
    font-size: 14px !important;
    font-family: var(--dochi-font) !important;
    outline: none !important;
    color: var(--dochi-text-name) !important;
    transition: box-shadow 0.15s !important;
    -webkit-appearance: none;
    appearance: none;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 1;
}

.dochi-search-input::placeholder {
    color: var(--dochi-text-secondary);
}

.dochi-search-input:focus {
    box-shadow: 0 0 0 2px var(--dochi-accent);
    background: var(--dochi-white);
}

/* Resultados búsqueda */
.dochi-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--dochi-white);
    border-radius: var(--dochi-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .dochi-search-results {
        position: fixed;
        top: 60px;
        left: 8px;
        right: 8px;
        width: auto;
    }
}

.dochi-search-results.active {
    display: block;
}

.dochi-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--dochi-text-name);
    border-bottom: 1px solid var(--dochi-border-light);
    transition: background 0.1s;
}

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

.dochi-search-item:hover,
.dochi-search-item:active {
    background: var(--dochi-bg);
}

.dochi-search-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--dochi-input-bg);
    flex-shrink: 0;
}

.dochi-search-item-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

.dochi-search-item-price {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* Iconos header */
.dochi-header-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dochi-header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--dochi-text-name);
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.15s;
}

.dochi-header-icon:hover {
    background: var(--dochi-bg);
}

.dochi-cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--dochi-accent);
    color: var(--dochi-white);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    padding: 0 4px;
}

/* === FOOTER === */
.dochi-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--dochi-text-secondary);
    font-size: 13px;
    background: var(--dochi-white);
    border-top: 1px solid var(--dochi-border-light);
    margin-top: 40px;
}

.dochi-footer p {
    margin: 0;
}

/* Ocultar footer de Storefront */
.site-footer .site-info,
.site-footer .footer-widgets {
    display: none !important;
}

/* === WHATSAPP === */
.dochi-whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 997;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    text-decoration: none;
}

.dochi-whatsapp-btn:hover {
    transform: scale(1.1);
}

/* Ocultar WhatsApp cuando el cart bar está visible */
body.dochi-has-cart .dochi-whatsapp-btn {
    bottom: 84px;
}

/* === DESKTOP === */
@media (min-width: 768px) {
    .dochi-header-inner {
        height: 64px;
        gap: 16px;
    }

    .dochi-header-logo img {
        height: 36px;
    }

    .dochi-header-logo span {
        font-size: 24px;
    }

    .dochi-search-input {
        padding: 12px 16px 12px 40px;
        font-size: 15px;
    }
}
