@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ===========================
   DESIGN TOKENS
   =========================== */
:root {
    --bg-main: #f5f5f7;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #000000;
    --text-light: #94a3b8;
    --primary: #5b4fcf;
    --primary-hover: #4940c4;
    --primary-light: rgba(91, 79, 207, 0.08);
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f97316;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ===========================
   TOP INFO BAR
   =========================== */
.top-bar {
    background: #0f172a;
    padding: 7px 0;
    font-family: var(--font-body);
}

.top-bar span, .top-bar a, .top-bar button {
    color: rgba(255,255,255,0.75);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}

.top-bar a:hover, .top-bar-btn:hover {
    color: #fff !important;
}

.top-bar-sep { color: rgba(255,255,255,0.2) !important; }

.top-bar-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 2px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.top-bar-btn:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.top-bar-select {
    background: none;
    border: 0;
    color: rgba(255,255,255,0.8) !important;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0 4px;
    -webkit-appearance: auto;
    appearance: auto;
}

.top-bar-select option { color: #0f172a; background: #fff; }

/* ===========================
   MAIN HEADER
   =========================== */
.main-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    /* height: 68px; */
    min-height: 68px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.header-logo img { height: 44px; }

/* Unified Search */
.header-search {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    border: 2px solid transparent;
    overflow: visible; /* changed from hidden to allow dropdown */
    transition: all 0.25s ease;
    width: 600px; /* wider default */
    max-width: 800px; /* bigger max width */
    position: relative;
}

.header-search:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-cat-select {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0 12px 0 14px;
    height: 44px;
    min-width: 140px;
    border-right: 1px solid #e2e8f0;
    cursor: pointer;
    outline: none;
}

.search-divider { width: 1px; background: #e2e8f0; height: 22px; }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    min-width: 0;
    height: 44px;
}

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

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-btn:hover { background: var(--primary-hover); }

/* Header Action Buttons */
.header-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
}

.header-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.header-action-btn i { font-size: 1.4rem; }

.action-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: -2px;
}

.action-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

/* Mobile Hamburger */
.mobile-menu-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-menu-btn:hover { background: #f1f5f9; }
.mobile-menu-btn i { font-size: 1.6rem; color: var(--text-main); }

/* Mobile Drawer */
.mobile-drawer {
    background: #fff;
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.mobile-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 10px 16px;
}

.mobile-search-wrap i { color: var(--text-light); }

.mobile-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
}

.category-pill {
    padding: 5px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.category-pill:hover {
    background: var(--primary);
    color: #fff;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: fixed;
    top: 115px;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-width: 90vw;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    z-index: 1200;
    overflow: hidden;
}
.search-results-dropdown-mobile {
    position: absolute; 
    top: 100%;     
    left: 0;
    right: 0;
    width: 100%;      
    background: white;
    z-index: 1100;
    margin-top: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 350px; 
    overflow-y: auto;  
    display: none;    
}

.mobile-search-wrap {
    position: relative; 
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 10px 16px;
}
/* Breadcrumb Bar */
.breadcrumb-bar {
    background: var(--surface);
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 0;
}

.breadcrumb-item a {
    color: var(--text-muted) !important;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.breadcrumb-item.active { color: var(--text-main) !important; font-weight: 600; font-size: 0.75rem; }

/* ===========================
   CART OFFCANVAS
   =========================== */
.offcanvas { box-shadow: -10px 0 40px rgba(0,0,0,0.08) !important; }

/* ===========================
   BUTTONS
   =========================== */
.btn-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff !important;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.25);
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 79, 207, 0.35);
    color: #fff !important;
}

/* ===========================
   SECTION TITLES
   =========================== */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #e2e8f0, transparent);
    border-radius: 2px;
}

/* ===========================
   PRODUCT CARDS
   =========================== */
.card {
    border: none !important;
    border-radius: var(--radius-xl) !important;
    background: var(--surface);
    box-shadow: var(--card-shadow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

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

.image-container {
    height: 210px;
    overflow: hidden;
    position: relative;
    background: #f8f9fc;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .product-thumbnail { transform: scale(1.07); }

.card-body { padding: 1rem 1.1rem !important; }

.product-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
    min-height: 2.4em;
}

.description-clamp {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: auto !important;
}

/* Price Badge */
.price-tag {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}

.stock-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

/* Override old badge colors */
.badge {
    padding: 0.35em 0.75em !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
}

.bg-danger { background-color: var(--primary) !important; }
.bg-warning { background-color: rgba(16, 185, 129, 0.1) !important; color: var(--accent) !important; }

/* ===========================
   SWIPER
   =========================== */
.swiper { padding-bottom: 1rem !important; }

.swiper-button-next, .swiper-button-prev {
    width: 40px !important;
    height: 40px !important;
    background: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
    color: var(--text-main) !important;
    border: 1px solid #eee !important;
    top: 40% !important;
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 13px !important;
    font-weight: 900 !important;
}

/* ===========================
   CATEGORY CARDS (Swiper)
   =========================== */
.category-swiper-container { padding: 10px 50px !important; }

.category-card {
    text-align: center;
    text-decoration: none;
    display: block;
}

.category-img-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: var(--card-shadow);
    margin: 0 auto 0.75rem;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.category-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card:hover .category-img-wrapper {
    transform: scale(1.07);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(91, 79, 207, 0.2);
}

.category-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
}

.category-card:hover .category-name { color: var(--primary); }

/* ===========================
   WHATSAPP FLOAT
   =========================== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    z-index: 1100;
    transition: transform 0.2s;
}

.whatsapp-float:hover { transform: scale(1.1); color: white; }

/* ===========================
   FOOTER
   =========================== */
.footer {
    background-color: #fff !important;
    border-top: 1px solid #f1f5f9;
    padding: 3rem 0 !important;
    margin-top: 3rem;
}

/* ===========================
   UTILITIES
   =========================== */
.product-name-overlay, .combo-name-overlay, .category-name-overlay {
    display: none !important;
}

/* Dropdown Modern */
.dropdown-menu {
    border: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    border-radius: var(--radius-lg) !important;
}

.dropdown-item:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ===========================
   PAGE LAYOUT
   =========================== */
.page-main {
    padding: 48px 0 64px;
}

.section-block {
    margin-bottom: 56px;
}

.section-icon {
    font-size: 1.2rem;
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.4;
}

/* ===========================
   NEW PRODUCT CARDS
   =========================== */
.product-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

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

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-img {
    height: 200px;
    overflow: hidden;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.product-card-body {
    padding: 14px 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-card-name {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.product-stock {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
}

.combo-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--warning);
    background: rgba(249, 115, 22, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
}

.product-card-footer {
    padding: 8px 14px 14px;
}

.btn-add-cart {
    width: 100%;
    padding: 0.55rem 1rem;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.2);
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 79, 207, 0.3);
}

.btn-add-cart:disabled {
    opacity: 0.6;
    transform: none;
}

/* Combo image grid inside card */
.combo-grid-img {
    background: #f1f5f9;
    padding: 0;
}

.combo-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 100%;
    height: 100%;
}

.combo-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================
   CATEGORY CARDS (new)
   =========================== */
.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    padding: 8px 4px;
}

.cat-card-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0 auto;
    background: #f1f5f9;
    transition: all 0.3s ease;
}

.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-card:hover .cat-card-img {
    transform: scale(1.07);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(91, 79, 207, 0.2);
}

.cat-card-name {
    font-size: 0.76rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
    text-align: center;
    line-height: 1.2;
}

.cat-card:hover .cat-card-name {
    color: var(--primary);
}

/* Shared swiper button (categories use custom class) */
.swiper-btn-shared {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: all 0.2s;
    border: 1px solid #eee;
}

.swiper-btn-shared:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.cat-swiper-prev { left: 4px; }
.cat-swiper-next { right: 4px; }

/* ===========================
   PAGINATION MODERN STYLE
   =========================== */
.pagination {
    display: flex;
    gap: 8px;
    padding-left: 0;
    list-style: none;
    margin-top: 3rem;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: var(--surface);
    color: var(--text-main) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md) !important;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.page-link:hover {
    background: var(--primary-light);
    color: var(--primary) !important;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.3);
}

.page-item.disabled .page-link {
    background: #f1f5f9;
    color: var(--text-light) !important;
    border-color: #e2e8f0;
    cursor: not-allowed;
    transform: none;
}

.page-link svg, .page-link i {
    width: 18px;
    height: 18px;
}

/* ===========================
    CUSTOM PROFILE STYLES (Demeter)
   =========================== */

/* Sobrescribir el color azul de los items activos en el menú lateral */
#profileTabs .list-group-item.active {
    background-color: var(--primary-light) !important; /* El púrpura clarito */
    color: var(--primary) !important;                /* El púrpura #5b4fcf */
    border-left: 4px solid var(--primary) !important;
    font-weight: 600;
}

/* Color de los iconos del menú */
#profileTabs .list-group-item i {
    color: var(--text-light);
}

#profileTabs .list-group-item.active i {
    color: var(--primary);
}

/* Efecto hover para los botones del menú que no están activos */
#profileTabs .list-group-item:hover:not(.active) {
    color: var(--primary);
    background-color: #f8fafc;
}

/* Títulos con el subrayado púrpura */
.section-title::after {
    background: linear-gradient(to right, var(--primary), transparent) !important;
}

/* Ajuste de las sombras y bordes para que coincidan con el diseño */
.card.shadow-sm {
    box-shadow: var(--card-shadow) !important;
    border-radius: var(--radius-lg) !important;
}
