:root {
    --bg: #f9fafb;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --text-primary: #0c111f;
    --text-secondary: #3f4b62;
    --text-tertiary: #7f8ea3;
    --border: #d1d7e0;
    --border-hover: #8a98ad;
    --border-focus: #3b82f6;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --whatsapp: #25d366;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-height: 70px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #334155;
    --border-hover: #475569;
    --border-focus: #60a5fa;
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
}

*,
*::before,
*::after {
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    /* Allow content to flow naturally */
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    letter-spacing: -0.01em;
    transition: background .3s ease, color .3s ease;
    /* Removed min-height: 100vh from body to let wrapper handle it */
    width: 100%;
}

#pego-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* Modo Shortcode: No forzar altura ni padding de navbar si el tema ya tiene uno */
#pego-wrapper.is-shortcode {
    min-height: 100vh;
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

#pego-wrapper.is-shortcode #pego-main-container {
    flex: 1;
}

#pego-wrapper.is-shortcode header {
    position: sticky;
    top: 0;
}

.container {
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        padding: 0 5px !important;
    }
}

header>.container {
    max-width: 100%;
    padding: 0 1rem;
    height: 100%;
}

@media (max-width: 768px) {

    .container,
    header>.container {
        padding: 0 5px !important;
    }

    .grid {
        padding: 0;
    }
}

header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    height: var(--navbar-height);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
    padding: 0;
    position: relative;
}

.control {
    height: 50px;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 1rem;
    font-weight: 600;
    font-size: .875rem;
    transition: var(--transition-fast);
    gap: .6rem;
    color: var(--text-primary);
    white-space: nowrap;
    cursor: pointer;
}

.control:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.logo-selector {
    padding: 0.6rem 1rem;
    overflow: visible;
    background: linear-gradient(135deg, #f8f9fb 0%, #f3f4f7 100%);
    border-color: #dde1e8;
    position: relative;
    justify-content: center;
    text-decoration: none;
}

.logo-selector:hover {
    background: linear-gradient(135deg, #f8f9fb 0%, #f3f4f7 100%);
    border-color: #dde1e8;
    transform: none;
}

[data-theme="dark"] .logo-selector {
    background: linear-gradient(135deg, #1a202e 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .logo-selector:hover {
    background: linear-gradient(135deg, #1a202e 0%, #1e293b 100%);
    border-color: #334155;
}

.logo-circles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--radius-md);
}

.logo-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    overflow: visible;
}

.logo-circles .circle {
    position: absolute;
    display: block;
    bottom: -30px;
    animation: floatCircle linear infinite;
}

.logo-circles .circle:nth-child(1) {
    left: 10%;
    width: 25px;
    height: 25px;
    animation-delay: 0s;
    animation-duration: 10s;
    background: rgba(59, 130, 246, 0.08);
}

.logo-circles .circle:nth-child(2) {
    left: 40%;
    width: 18px;
    height: 18px;
    animation-delay: 3s;
    animation-duration: 14s;
    background: rgba(139, 92, 246, 0.1);
}

.logo-circles .circle:nth-child(3) {
    left: 65%;
    width: 30px;
    height: 30px;
    animation-delay: 1s;
    animation-duration: 12s;
    background: rgba(236, 72, 153, 0.07);
}

.logo-circles .circle:nth-child(4) {
    left: 82%;
    width: 22px;
    height: 22px;
    animation-delay: 5s;
    animation-duration: 9s;
    background: rgba(99, 102, 241, 0.09);
}

[data-theme="dark"] .logo-circles .circle:nth-child(1) {
    background: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .logo-circles .circle:nth-child(2) {
    background: rgba(167, 139, 250, 0.18);
}

[data-theme="dark"] .logo-circles .circle:nth-child(3) {
    background: rgba(244, 114, 182, 0.13);
}

[data-theme="dark"] .logo-circles .circle:nth-child(4) {
    background: rgba(129, 140, 248, 0.16);
}

@keyframes floatCircle {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.8;
        border-radius: 0%;
    }

    50% {
        opacity: 1;
        transform: translateY(-50px) rotate(360deg) scale(1.2);
        border-radius: 30%;
    }

    100% {
        transform: translateY(-100px) rotate(720deg) scale(0.8);
        opacity: 0;
        border-radius: 50%;
    }
}

.logo-label .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1.5;
    display: flex;
    align-items: center;
    overflow: visible;
}

.logo-label .logo-text .pe {
    color: var(--text-primary);
}

.logo-label .logo-text .go {
    letter-spacing: -0.06em;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.15rem;
    display: inline-block;
}

.location-selector {
    width: auto;
    min-width: auto;
    justify-content: space-between;
}

.location-label {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.location-label i,
.location-selector .chevron {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    stroke: var(--text-secondary);
}

.location-label span {
    font-size: .875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.location-selector .chevron {
    width: 16px;
    height: 16px;
    transition: transform .25s;
}

.location-selector:hover .chevron {
    transform: rotate(180deg);
}

.navbar-center {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1;
    min-width: 0;
}

.search-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
}

.search-input-wrapper {
    cursor: text;
    position: relative;
}

.search-input-wrapper:focus-within {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12) !important;
    background: var(--bg) !important;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: .9rem;
    font-weight: 500;
    outline: none;
    width: 100%;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
    position: relative;
}

.btn-publish {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    height: 50px;
    padding: 0 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
    transition: all .3s ease;
    text-decoration: none;
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, .4);
}

/* BOTÓN DE CUENTA */
.account-menu-wrapper {
    position: relative;
}

.btn-account {
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.btn-account::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    opacity: 0;
    transition: opacity .3s ease;
}

.btn-account:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .15);
}




.btn-account.active::before {
    opacity: 0.12;
}

.btn-account.active {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-account svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
    position: relative;
    z-index: 1;
}

/* DROPDOWN ESCRITORIO */
.account-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 280px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2001;
    overflow: hidden;
}

.account-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: var(--bg);
    border-left: 1.5px solid var(--border);
    border-top: 1.5px solid var(--border);
    transform: rotate(45deg);
    z-index: 1;
}

/* MODAL MÓVIL */
.account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    backdrop-filter: blur(8px);
}

.account-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.account-modal {
    background: var(--bg);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
    transform: scale(.92) translateY(20px);
    transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1.5px solid var(--border);
    margin: 1rem;
}

.account-modal-overlay.active .account-modal {
    transform: scale(1) translateY(0);
}

[data-theme="dark"] .account-modal {
    box-shadow: 0 25px 70px rgba(0, 0, 0, .6);
}

/* CONTENIDO */
.account-content-header {
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-secondary) 100%);
    border-bottom: 1.5px solid var(--border);
    position: relative;
}

[data-theme="dark"] .account-content-header {
    background: var(--bg-secondary);
}

.account-content-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.account-content-header p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.5;
}

.modal-close-btn {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all .25s ease;
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-weight: 300;
    line-height: 1;
}

.modal-close-btn:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.account-content-body {
    padding: 1rem;
}

.account-section {
    margin-bottom: 0.75rem;
}

.account-section:last-child {
    margin-bottom: 0;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--text-primary);
    text-decoration: none;
}

.account-item:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .account-item:hover {
    background: #334155;
}

.account-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    stroke-width: 2;
}

.account-item span {
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

.account-item.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
}

.account-item.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .25);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.account-item.primary svg {
    color: white;
}

.account-item.logout {
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.02);
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.account-item.logout svg {
    color: #ef4444;
}

.account-item.logout:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.account-item.logout:hover svg {
    color: white;
}

[data-theme="dark"] .account-item.logout {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .account-item.logout:hover {
    background: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.account-divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

.theme-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
}

[data-theme="dark"] .theme-toggle-item {
    background: #334155;
    border-color: #475569;
}

.theme-toggle-item .label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.theme-toggle-item .label svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    stroke-width: 2;
}

.theme-toggle-item .label span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-switch {
    position: relative;
    width: 38px;
    height: 20px;
    background: var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.theme-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-switch {
    background: var(--primary);
}

[data-theme="dark"] .theme-switch::before {
    transform: translateX(18px);
}

@media (max-width: 768px) {
    .account-dropdown {
        display: none !important;
    }

    .account-modal-overlay {
        display: flex;
    }
}

@media (min-width: 769px) {
    .account-modal-overlay {
        display: none !important;
    }

    .account-dropdown {
        display: block;
    }
}

.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    background: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: .35rem .65rem;
    font-size: .75rem;
    font-weight: 500;
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    transition: .3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    pointer-events: none;
    white-space: nowrap;
}

.tooltip .tooltip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-bottom-color: #1e293b;
}

.tooltip:hover .tooltip-text,
.tooltip.show .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.close-search {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.close-search:hover {
    background: var(--border-hover);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }

    .control,
    .logo-selector {
        height: 46px;
    }

    .logo-label .logo-text {
        font-size: 1.4rem;
    }

    .btn-publish {
        display: none;
    }

    #locationTooltip {
        display: none;
    }

    .btn-account {
        height: 46px;
        width: 46px;
    }
}

@media (max-width: 550px) {
    :root {
        --navbar-height: 56px;
    }

    .navbar {
        gap: 0.6rem;
    }

    .control,
    .logo-selector {
        height: 44px;
        padding: 0 .85rem;
    }

    .logo-label .logo-text {
        font-size: 1.3rem;
    }

    .location-label span,
    .location-selector .chevron {
        display: none;
    }

    .btn-account {
        height: 44px;
        width: 44px;
    }
}

@media (max-width: 400px) {
    :root {
        --navbar-height: 54px;
    }

    .navbar {
        gap: 0.5rem;
    }

    .logo-selector {
        height: 40px;
        padding: 0.4rem 0.9rem 0.4rem 1rem;
        border-radius: 10px;
        margin-right: 0.5rem;
    }

    .logo-label .logo-text {
        font-size: 1.2rem;
    }

    .control {
        height: 40px;
        padding: 0 .7rem;
        font-size: .8rem;
        border-radius: 10px;
    }

    .location-selector {
        width: 40px;
        min-width: 40px;
        padding: 0;
        justify-content: center;
    }

    .search-input-wrapper {
        height: 40px;
        padding: 0 .7rem;
    }

    .search-input {
        font-size: .85rem;
    }

    .btn-account {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    body .navbar.search-expanded .logo-selector,
    body .navbar.search-expanded .location-selector,
    body .navbar.search-expanded .navbar-right {
        display: none !important;
    }

    body .navbar.search-expanded .navbar-center {
        flex: 1 !important;
        max-width: 100% !important;
    }

    body .navbar.search-expanded .search-input-wrapper {
        width: 100% !important;
        padding: 0 3rem 0 1rem !important;
        border-color: var(--border-focus) !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .12) !important;
        background: var(--bg) !important;
    }

    body .navbar.search-expanded .search-input {
        font-size: .9rem !important;
    }

    body .navbar.search-expanded .search-icon {
        color: var(--primary) !important;
    }
}

.fab {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, .15);
    z-index: 999;
    align-items: center;
    justify-content: center;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .2);
}

.fab:active {
    transform: translateY(0px) scale(0.96);
    box-shadow: 0 2px 6px rgba(59, 130, 246, .15);
}

.fab svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .fab {
        display: none;
    }
}

@media (max-width: 400px) {
    .fab {
        width: 56px;
        height: 56px;
        bottom: 90px;
        right: 1rem;
    }

    .fab svg {
        width: 24px;
        height: 24px;
    }
}

#pego-main-container {
    flex: 1;
    /* Pushes footer down */
    margin-top: calc(2rem - 7px);
    padding-bottom: 3rem;
    width: 100%;
}

@media (max-width: 768px) {
    #pego-main-container {
        padding-bottom: 100px; /* Suficiente para limpiar el bottom-nav de 64px + margen de elegancia */
    }
}

.categories-scroll {
    margin: 0 0 1.75rem !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    user-select: none !important;
    min-height: 90px !important;
    height: 90px !important;
    padding-bottom: 5px !important;
    position: relative !important;
}

.categories-scroll.dragging {
    cursor: grabbing !important;
    user-select: none !important;
}

.categories-scroll.dragging * {
    cursor: grabbing !important;
    user-select: none !important;
    pointer-events: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .categories-scroll {
        display: none !important;
    }
}

.categories-container {
    display: flex !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    justify-content: center !important;
    min-width: max-content !important;
    box-sizing: border-box !important;
}

/* Location Chips Bar */
/* Location Chips Bar */
/* Location Chips Bar */
.location-chips-bar {
    display: flex;
    overflow-x: auto;
    padding: 0 !important;
    gap: 0.5rem;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.location-chips-bar::-webkit-scrollbar {
    display: none;
}

.location-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    /* More compact */
    background: transparent;
    border: 1px solid var(--border);
    /* Subtle neutral border */
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.78rem;
    /* Smaller font */
    font-weight: 500;
    color: var(--text-tertiary);
}

.location-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.03);
}

.location-chip.active {
    background: var(--color-bg, rgba(59, 130, 246, 0.1));
    color: var(--primary);
    border-color: var(--primary);
    /* Text is blue, not white background */
    font-weight: 600;
}

.location-chip i,
.location-chip svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
    color: inherit;
}

.location-chip.active i,
.location-chip.active svg {
    color: var(--primary);
}

.location-chip.more-btn {
    border-style: dotted;
    opacity: 0.7;
}

.location-chip.more-btn:hover {
    border-style: dashed;
    border-color: var(--primary);
    color: var(--primary);
    opacity: 1;
}


.category-item {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 24px !important;
    border-radius: 10px !important;
    width: 120px !important;
    min-width: 120px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;

    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}


.category-item i,
.category-item svg {
    display: inline-block !important; /* Respect dimensions while loading <i> tag */
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    color: #334155 !important;
    /* Darker as requested */
    transition: color .2s ease;
    stroke-width: 2 !important;
}

.category-item span {
    font-size: 13px !important;
    /* 0.8125rem */
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    transition: color .2s ease;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    display: block !important;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.9);
}

.category-item:hover i,
.category-item:hover span {
    color: var(--text-primary) !important;
}

.category-item.active {
    background: rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.category-item.active i,
.category-item.active svg {
    color: var(--primary) !important;
    stroke-width: 2.2 !important;
}

.category-item.active span {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

[data-theme="dark"] .category-item {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .category-item:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(71, 85, 105, 0.7);
}

[data-theme="dark"] .category-item.active {
    background: rgba(96, 165, 250, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 1px 3px rgba(96, 165, 250, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: nowrap;
}

.results-info {
    margin: 0;
    line-height: 1.2;
    font-size: clamp(1.1rem, 5vw, 1.35rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.03em;
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 2vw, 0.75rem);
    white-space: nowrap;
}

.results-info .zap-svg {
    width: clamp(22px, 5vw, 28px);
    height: clamp(22px, 5vw, 28px);
    stroke: url(#zap-gradient);
    stroke-width: 2.5;
    fill: none;
}

.results-info .badge-new {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    font-size: clamp(0.55rem, 2vw, 0.65rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: clamp(0.2rem, 1vw, 0.25rem) clamp(0.4rem, 2vw, 0.6rem);
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .3);
}

@media (max-width: 480px) {
    .results-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: space-between;
    }
    .results-info {
        margin-bottom: 0;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    backdrop-filter: blur(8px);
    padding: 1.5rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 82vh;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
    transform: scale(.92) translateY(20px);
    transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1.5px solid var(--border);
    position: relative;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

[data-theme="dark"] .modal {
    box-shadow: 0 25px 70px rgba(0, 0, 0, .6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1.5px solid var(--border);
    background: var(--bg);
    position: relative;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    stroke-width: 2.5;
}

#locationBackBtn {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    height: 40px;
    padding: 0 14px;
    margin-right: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

#locationBackBtn:hover {
    background: var(--border-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateX(-3px);
}

#locationBackBtn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.modal-close {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all .25s ease;
    flex-shrink: 0;
    font-weight: 300;
    line-height: 1;
}

.modal-close:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.modal-body {
    padding: 1.25rem;
    max-height: calc(82vh - 90px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.location-search-wrapper {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.location-search-wrapper i {
    color: var(--text-tertiary);
    width: 18px;
    height: 18px;
}

.location-search-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    font-weight: 500;
}

.location-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.location-option {
    padding: 0.85rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    position: relative;
    user-select: none;
}

.location-option span {
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

/* Modal Choice Screen */
.choice-screen {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.choice-option {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.choice-option:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.choice-icon {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.choice-icon i,
.choice-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.choice-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.choice-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.choice-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.location-option {
    padding: 0.85rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    position: relative;
    margin-bottom: 0.5rem;
}

.location-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.location-option.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.location-option.active i,
.location-option.active svg {
    color: white;
}


.current-dept-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: 8px;
    letter-spacing: -0.01em;
}



@media (min-width: 769px) {
    .modal {
        max-width: 500px;
    }

    .location-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) and (min-width: 501px) {
    .modal-overlay {
        padding: 1.25rem;
    }

    .modal {
        max-width: 500px;
        border-radius: 18px;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .modal-title svg {
        width: 22px;
        height: 22px;
    }

    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 500px) {
    .modal-overlay {
        padding: 1rem;
    }

    .modal {
        max-width: 100%;
        max-height: 88vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 1.15rem 1.25rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-title svg {
        width: 20px;
        height: 20px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    .modal-body {
        padding: 1.25rem;
        max-height: calc(88vh - 75px);
    }

    .location-grid {
        gap: .75rem;
    }

    .location-option {
        padding: 1rem 1.1rem;
        font-size: .9rem;
        min-height: 52px;
    }
}

@media (max-width: 380px) {
    .modal-overlay {
        padding: 0.75rem;
    }

    .modal {
        border-radius: 12px;
    }

    .modal-header {
        padding: 1rem 1.15rem;
    }

    .modal-title {
        font-size: 1.05rem;
    }

    .modal-close {
        width: 34px;
        height: 34px;
    }

    .modal-body {
        padding: 1.15rem;
    }

    .location-grid {
        gap: .7rem;
    }

    .location-option {
        padding: .95rem 1rem;
        font-size: .875rem;
        min-height: 50px;
    }
}

@media (max-width: 340px) {
    .modal-overlay {
        padding: 0.6rem;
    }

    .modal {
        border-radius: 12px;
    }

    .location-grid {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .location-option {
        padding: .9rem .95rem;
        font-size: .85rem;
        min-height: 48px;
    }
}

.pro-footer {
    margin-top: 2rem;
    padding: 2.5rem 0 2rem;
    background: #0c111f;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
    font-size: 0.875rem;
    text-align: center;
}

[data-theme="dark"] .pro-footer {
    background: #0a0e17;
    border-top-color: #1e293b;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

@media (max-width: 768px) {
    .footer-content {
        padding: 0 5px !important;
    }
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    text-decoration: none;
    display: inline-flex;
}

.footer-logo .simple {
    color: #e2e8f0;
}

.footer-logo .os {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.15rem;
    display: inline-block;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    justify-content: center;
    font-weight: 600;
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem 1rem;
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .footer-links a:last-child {
        grid-column: span 2;
    }
}

.footer-links a {
    color: #94adce;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9375rem;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-bottom {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.beating-heart {
    display: inline-block;
    color: #ec4899;
    font-weight: 700;
    animation: heartbeat 2.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

svg[width="0"][height="0"] {
    position: absolute;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: none;
    z-index: 999;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(12px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    user-select: none;
}

.bottom-nav.dragging {
    cursor: grabbing !important;
    user-select: none !important;
}

.bottom-nav.dragging * {
    cursor: grabbing !important;
    user-select: none !important;
    pointer-events: none;
}

.bottom-nav::-webkit-scrollbar {
    height: 0px;
    display: none;
}

.bottom-nav::-webkit-scrollbar-track {
    background: transparent;
}

.bottom-nav::-webkit-scrollbar-thumb {
    background: transparent;
}

.bottom-nav::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

.bottom-nav {
    scrollbar-width: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: center;
        overflow: visible;
        height: 64px; /* Un pelín más bajo para el look app compacta */
        background: #ffffff;
        border-top: none;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.08);
    }
}

.bottom-nav-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    width: 100%;
    max-width: 480px;
    padding: 0 4px;
    position: relative;
    height: 100%;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 0;
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    position: relative;
    border: none;
    text-decoration: none;
}

/* Botón Central - TAMAÃO Y ESTILO PANEL EXACTO */
.bottom-nav-item.center-fab {
    z-index: 20;
    height: 100%;
}

.bottom-nav-item.center-fab .fab-circle {
    width: 58px;
    height: 58px;
    background: #4285f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -32px; /* Bajada ligeramente de -36px a -32px */
    border: 4px solid #fff; 
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(66, 133, 244, 0.2); /* Shadow equilibrado y elegante */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .bottom-nav-item.center-fab .fab-circle {
    border-color: #cbd5e1;
}

.bottom-nav-item.center-fab i {
    color: #ffffff !important; /* Blanco puro para contraste */
    width: 34px;
    height: 34px;
    stroke-width: 2.2 !important; /* Un pelÃn más de grosor para que destaque */
}

.bottom-nav-item.center-fab i svg,
.bottom-nav-item.center-fab svg,
.bottom-nav-item.center-fab svg path {
    stroke: #ffffff !important; /* Forzado total a blanco */
}

.bottom-nav-item.center-fab span {
    display: none;
}

.bottom-nav-item:active .fab-circle {
    transform: scale(0.94);
}

/* Iconos y Texto - ESTILO PANEL FINO */
.bottom-nav-item i {
    width: 24px;
    height: 24px;
    color: #70757a; /* El gris suave caracterÃstico */
    transition: all 0.2s ease;
    stroke-width: 1.5; /* Trazo extra fino */
}

.bottom-nav-item span {
    font-size: 10px; /* Fuente pequeña y limpia */
    font-weight: 500;
    color: #70757a;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.bottom-nav-item.active i {
    color: #4285f4; /* Azul activo */
    stroke-width: 1.8;
}

.bottom-nav-item.active span {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .bottom-nav {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
    border-top: none;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.3);
}

/* Favorites button - static by default */
.fav-local-btn {
    overflow: hidden;
    position: relative;
    transform-origin: left center;
    /* Static state: locked */
    width: 120px;
    min-width: 120px;
    opacity: 1;
    transform: scale(1);
    margin-right: 0;
    transition: none !important;
}

/* Fluid Animation State - Unlocks transitions */
.fav-local-btn.fav-appear-anim {
    animation: favBtnAppear 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    /* Allow properties to be animated */
    min-width: 0 !important;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* When the button should animate OUT (last favorite removed) */
.fav-local-btn.removing {
    animation: favBtnDisappear 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes favBtnAppear {
    0% {
        opacity: 0;
        transform: scale(0.6);
        width: 0;
        min-width: 0;
        margin-right: -10px;
        padding-left: 0;
        padding-right: 0;
    }

    100% {
        opacity: 1;
        transform: scale(1);
        width: 120px;
        /* Animate to fixed width */
        min-width: 120px;
        margin-right: 0;
        padding-left: 1.25rem;
        /* Match .category-item padding */
        padding-right: 1.25rem;
    }
}

@keyframes favBtnDisappear {
    0% {
        opacity: 1;
        transform: scale(1);
        width: 120px;
        min-width: 120px;
        margin-right: 0;
    }

    100% {
        opacity: 0;
        transform: scale(0.6);
        width: 0;
        min-width: 0;
        margin-right: -10px;
        padding-left: 0;
        padding-right: 0;
    }
}

/* =============================================
   CATEGORIES MODAL (Bottom Sheet)
   ============================================= */
.categories-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.categories-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.categories-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.categories-modal-overlay.active .categories-modal {
    transform: translateY(0);
}

[data-theme="dark"] .categories-modal {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    border-top: 1px solid var(--border);
}

.categories-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.categories-modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.categories-modal-title i,
.categories-modal-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    stroke-width: 2.2;
}

.categories-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.categories-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.categories-modal-body {
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.categories-modal-body::-webkit-scrollbar {
    width: 0;
}

.cat-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--color-bg, rgba(59, 130, 246, 0.06));
    border: 1.5px solid transparent;
    position: relative;
    overflow: hidden;
}

.cat-modal-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cat-modal-item:hover::before {
    opacity: 1;
}

.cat-modal-item:active {
    transform: scale(0.95);
}

.cat-modal-item .cat-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg, rgba(59, 130, 246, 0.1));
    transition: all 0.25s ease;
}

.cat-modal-item .cat-modal-icon i,
.cat-modal-item .cat-modal-icon svg {
    width: 22px;
    height: 22px;
    color: var(--cat-color, var(--primary));
    stroke-width: 2;
    transition: color 0.2s ease;
}

.cat-modal-item span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.cat-modal-item.active {
    border-color: var(--cat-color, var(--primary));
    background: var(--color-bg, rgba(59, 130, 246, 0.1));
}

.cat-modal-item.active .cat-modal-icon {
    background: var(--cat-color, var(--primary));
}

.cat-modal-item.active .cat-modal-icon i,
.cat-modal-item.active .cat-modal-icon svg {
    color: white;
}

.cat-modal-item.active span {
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .cat-modal-item {
    background: rgba(30, 41, 59, 0.5);
}

[data-theme="dark"] .cat-modal-item.active {
    background: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .cat-modal-item .cat-modal-icon {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cat-modal-item.active .cat-modal-icon {
    background: var(--cat-color, var(--primary));
}

/* Desktop: center modal instead of bottom sheet */
@media (min-width: 769px) {
    .categories-modal {
        position: absolute;
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.92);
        border-radius: 20px;
        max-width: 420px;
        width: 90%;
        max-height: 75vh;
    }

    .categories-modal-overlay.active .categories-modal {
        transform: translate(-50%, -50%) scale(1);
    }

    .categories-modal-body {
        grid-template-columns: repeat(3, 1fr);
    }
}