/* ===== FAV STORES MODAL - v2.0 ===== */
/* Archivo separado para evitar bloqueo del componente bottom-nav */

/* ===== OVERLAY ===== */
.fav-stores-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.fav-stores-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MODAL ===== */
.fav-stores-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.fav-stores-modal.active {
    transform: translateY(0);
}

.fav-stores-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15), 0 -2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
}

.fav-stores-drag-handle {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
    cursor: grab;
}
.fav-stores-drag-bar {
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s;
}
.fav-stores-drag-handle:active .fav-stores-drag-bar {
    background: #94a3b8;
}

.fav-stores-header {
    padding: 8px 20px 16px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.fav-stores-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.fav-stores-header-icon i {
    color: white;
    font-size: 22px;
}
.fav-stores-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.3px;
}
.fav-stores-header p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}

.fav-stores-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px 24px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.fav-stores-scroll::-webkit-scrollbar {
    width: 4px;
}
.fav-stores-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.fav-stores-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* ===== LOADING STATE ===== */
.fav-stores-loading {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* ===== EMPTY STATE ===== */
.fav-stores-empty {
    text-align: center;
    padding: 40px 20px;
}
.fav-stores-empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.fav-stores-empty-icon i {
    font-size: 32px;
    color: #94a3b8;
}
.fav-stores-empty h4 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: #334155;
}
.fav-stores-empty p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
}
.fav-stores-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.fav-stores-empty-btn:active {
    transform: scale(0.97);
}

/* ===== STORE CARD ===== */
.fav-store-card {
    background: #ffffff;
    border-radius: 20px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: favStoreCardEnter 0.4s ease-out forwards;
}
.fav-store-card:nth-child(1) { animation-delay: 0.05s; }
.fav-store-card:nth-child(2) { animation-delay: 0.12s; }
.fav-store-card:nth-child(3) { animation-delay: 0.19s; }
.fav-store-card:nth-child(4) { animation-delay: 0.26s; }
.fav-store-card:nth-child(5) { animation-delay: 0.33s; }
.fav-store-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes favStoreCardEnter {
    to { opacity: 1; transform: translateY(0); }
}
.fav-store-card:active {
    transform: scale(0.985);
}
.fav-store-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.fav-store-banner {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}
.fav-store-banner-placeholder {
    width: 100%;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fav-store-banner-placeholder i {
    font-size: 28px;
    color: rgba(255,255,255,0.4);
}

.fav-store-info {
    padding: 14px 16px 16px;
    position: relative;
}

.fav-store-logo-wrap {
    position: absolute;
    top: -28px;
    left: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fav-store-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fav-store-logo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fav-store-logo-placeholder i {
    font-size: 20px;
    color: rgba(255,255,255,0.8);
}

.fav-store-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: 64px;
    margin-bottom: 6px;
}
.fav-store-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.fav-store-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.fav-store-status-badge.open {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.fav-store-status-badge.open::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
    animation: favStorePulse 2s infinite;
}
.fav-store-status-badge.close {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.fav-store-status-badge.close::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
}
@keyframes favStorePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.fav-store-desc {
    font-size: 12.5px;
    color: #64748b;
    margin: 0 0 12px 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-left: 64px;
}

.fav-store-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    margin-left: 64px;
    flex-wrap: wrap;
}
.fav-store-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.fav-store-stat i {
    font-size: 13px;
    color: #94a3b8;
}
.fav-store-stat.new-products {
    color: #ea580c;
    font-weight: 600;
}
.fav-store-stat.new-products i {
    color: #f97316;
}

.fav-store-last-product {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-left: 64px;
}
.fav-store-last-product-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}
.fav-store-last-product-info {
    flex: 1;
    min-width: 0;
}
.fav-store-last-product-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.fav-store-last-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-store-last-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #059669;
    flex-shrink: 0;
}

.fav-store-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: favStoreNewBadgeBounce 0.5s ease-out;
    z-index: 5;
}
.fav-store-new-badge i {
    font-size: 10px;
}
@keyframes favStoreNewBadgeBounce {
    0% { transform: scale(0) rotate(-10deg); }
    60% { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.fav-stores-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 16px;
    transition: all 0.2s;
    z-index: 10;
}
.fav-stores-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #334155;
}
.fav-stores-close-btn:active {
    transform: scale(0.9);
}

/* ===== SKELETON ===== */
.fav-store-skeleton {
    background: #ffffff;
    border-radius: 20px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}
.fav-store-skeleton-banner {
    width: 100%;
    height: 90px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: favStoreSkeletonShimmer 1.5s infinite;
}
.fav-store-skeleton-body {
    padding: 14px 16px 16px;
    position: relative;
}
.fav-store-skeleton-logo {
    position: absolute;
    top: -28px;
    left: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: favStoreSkeletonShimmer 1.5s infinite;
    border: 3px solid #ffffff;
}
.fav-store-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: favStoreSkeletonShimmer 1.5s infinite;
    border-radius: 6px;
    margin-left: 64px;
    margin-bottom: 8px;
}
.fav-store-skeleton-line.short { width: 60%; }
.fav-store-skeleton-line.thin { height: 10px; width: 40%; }
@keyframes favStoreSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
    .fav-stores-modal {
        left: 50%;
        right: auto;
        transform: translate(-50%, 100%);
        width: 100%;
        max-width: 480px;
    }
    .fav-stores-modal.active {
        transform: translate(-50%, 0);
    }
  }
