/* ============================================================
   PALETTE 2 — GOLDEN + CHARCOAL
   Premium layout with depth, shimmer & staggered animations
   ============================================================ */

/* ---------- Entrance + effect keyframes ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes goldPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 195, 0, 0.55); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 195, 0, 0); }
}
@keyframes shineSweep {
    0%   { left: -120%; }
    100% { left: 120%; }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes growWidth {
    from { width: 0; opacity: 0.4; }
    to   { width: 100%; opacity: 1; }
}

/* ---------- Page Header (animated gradient + glow) ---------- */
.page-header {
    background: linear-gradient(
        135deg,
        var(--accent-navy-dark) 0%,
        var(--accent-navy) 40%,
        var(--accent-navy-light) 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 14s ease-in-out infinite;
    color: var(--white);
    padding: 3.5rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(255, 195, 0, 0.15);
}
.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 195, 0, 0.14) 0%, transparent 65%);
    transform: translateX(-50%);
    pointer-events: none;
    animation: floatY 6s ease-in-out infinite;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary) 50%,
        transparent 100%);
    opacity: 0.65;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--white);
    position: relative;
    animation: fadeInUp 0.6s ease-out both;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.page-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    margin: 0.9rem auto 0;
    border-radius: 3px;
    background: var(--primary-gradient);
    animation: growWidth 0.9s ease-out 0.2s both;
}

.page-subtitle {
    font-size: 0.98rem;
    opacity: 0.92;
    max-width: 540px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.88);
    animation: fadeInUp 0.6s ease-out 0.15s both;
    line-height: 1.55;
}

/* ---------- Search Section (elevated card) ---------- */
.search-section {
    background: linear-gradient(180deg, var(--white) 0%, var(--surface) 100%);
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
    margin: 0 auto 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 -1px 0 rgba(0, 0, 0, 0.03) inset,
        0 10px 40px rgba(26, 26, 26, 0.08),
        0 2px 8px rgba(26, 26, 26, 0.04);
    max-width: 1200px;
    border: 1px solid var(--border-warm);
    position: relative;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.85rem;
    border: 1.5px solid var(--medium-gray);
    border-radius: 12px;
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--text-primary);
}
.search-input::placeholder { color: var(--text-light); }

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.18);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent),
                0 6px 20px rgba(255, 195, 0, 0.18);
    background: var(--white);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-dark);
    font-size: 1rem;
    transition: transform 0.25s ease, color 0.25s ease;
    pointer-events: none;
}
.search-input:focus + .search-icon,
.search-box:focus-within .search-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

/* ---------- Alphabet Navigation (pill style) ---------- */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-warm);
    margin-bottom: 1.25rem;
}

.alphabet-letter {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid var(--medium-gray);
    border-radius: 10px;
    text-decoration: none;
    color: var(--accent-navy);
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.35s ease-out both;
}

.alphabet-letter:hover {
    background: var(--primary);
    color: var(--text-on-gold);
    transform: translateY(-2px) scale(1.05);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(255, 195, 0, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.08);
}

.alphabet-letter.active {
    background: var(--primary-gradient);
    color: var(--text-on-gold);
    border-color: var(--primary-dark);
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(255, 195, 0, 0.5),
                0 1px 3px rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

.alphabet-all {
    background: var(--accent-navy);
    color: var(--primary);
    border-color: var(--accent-navy);
    width: auto;
    padding: 0 0.9rem;
    font-weight: 700;
}
.alphabet-all:hover {
    background: var(--accent-navy-dark);
    border-color: var(--accent-navy-dark);
    color: var(--primary-on-dark);
}
.alphabet-all.active {
    background: var(--accent-navy-dark);
    color: var(--primary-on-dark);
}

/* Stagger letters on entrance */
.alphabet-letter:nth-child(1) { animation-delay: 0.00s; }
.alphabet-letter:nth-child(2) { animation-delay: 0.02s; }
.alphabet-letter:nth-child(3) { animation-delay: 0.04s; }
.alphabet-letter:nth-child(4) { animation-delay: 0.06s; }
.alphabet-letter:nth-child(5) { animation-delay: 0.08s; }
.alphabet-letter:nth-child(6) { animation-delay: 0.10s; }
.alphabet-letter:nth-child(7) { animation-delay: 0.12s; }
.alphabet-letter:nth-child(8) { animation-delay: 0.14s; }
.alphabet-letter:nth-child(9) { animation-delay: 0.16s; }
.alphabet-letter:nth-child(10) { animation-delay: 0.18s; }
.alphabet-letter:nth-child(n+11) { animation-delay: 0.20s; }

/* ---------- Main Container ---------- */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ---------- Stores Grid ---------- */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.1rem;
    margin-top: 1.5rem;
}
@media (min-width: 768px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.35rem;
    }
}
@media (min-width: 992px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 1.5rem;
    }
}

/* ---------- Store Card (premium hover) ---------- */
.store-card {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(26, 26, 26, 0.05),
        0 4px 12px rgba(26, 26, 26, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    border: 1.5px solid var(--border-warm);
    height: 100%;
    position: relative;
    isolation: isolate;
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* gold shine sweep on hover */
.store-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 100%
    );
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.store-card:hover::after {
    opacity: 1;
    animation: shineSweep 0.85s ease-out;
}

.store-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 2px 4px rgba(26, 26, 26, 0.06),
        0 18px 40px rgba(26, 26, 26, 0.16),
        0 0 0 1px var(--primary) inset,
        0 0 24px rgba(255, 195, 0, 0.25);
    border-color: var(--primary);
}

.store-image-container {
    position: relative;
    height: 110px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-warm);
}
@media (min-width: 768px) {
    .store-image-container { height: 120px; }
}

.store-image {
    width: 78%;
    height: 78%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.06));
}
.store-card:hover .store-image {
    transform: scale(1.12) rotate(-2deg);
}

/* Top-store badge with gentle pulse */
.store-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-gradient);
    color: var(--text-on-gold);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 3;
    box-shadow: 0 3px 10px rgba(255, 195, 0, 0.5),
                0 1px 2px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--primary-dark);
    animation: goldPulse 2.6s ease-in-out infinite;
}
.store-badge i {
    color: var(--accent-navy-dark);
    font-size: 0.62rem;
}

.store-content {
    padding: 0.85rem 0.75rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.store-name {
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--accent-navy);
    margin-bottom: 0.5rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.25s ease;
}
.store-card:hover .store-name {
    color: var(--primary-dark);
}

.store-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    background: var(--surface-alt);
    border-radius: 20px;
    transition: background 0.25s ease, color 0.25s ease;
}
.store-card:hover .store-meta {
    background: rgba(255, 195, 0, 0.15);
    color: var(--accent-navy);
}

.store-meta i {
    color: var(--primary-dark);
    font-size: 0.7rem;
}

/* ---------- Stats Bar (shimmering gold ribbon) ---------- */
.stats-bar {
    background: linear-gradient(
        110deg,
        var(--primary-dark) 0%,
        var(--primary) 35%,
        var(--primary-light) 60%,
        var(--primary) 85%,
        var(--primary-dark) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 8s linear infinite;
    color: var(--text-on-gold);
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.87rem;
    font-weight: 600;
    box-shadow:
        0 6px 18px rgba(255, 195, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 -2px 6px rgba(204, 138, 0, 0.3) inset;
    border: 1px solid var(--primary-dark);
    animation: shimmer 8s linear infinite, fadeInUp 0.5s ease-out 0.15s both;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.25s ease;
}
.stat-item:hover {
    transform: translateY(-1px);
}
.stat-item i {
    font-size: 0.95rem;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ---------- Active Filters (animated chips) ---------- */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 32px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-gradient);
    color: var(--text-on-gold);
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.79rem;
    font-weight: 700;
    box-shadow:
        0 3px 10px rgba(255, 195, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-dark);
    animation: slideInLeft 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.filter-remove {
    background: rgba(26, 26, 26, 0.18);
    border: none;
    color: var(--text-on-gold);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0;
    transition: all 0.2s ease;
}
.filter-remove:hover {
    background: var(--accent-navy-dark);
    color: var(--primary-on-dark);
    transform: rotate(90deg) scale(1.1);
}

/* ---------- Letter Section ---------- */
.letter-section {
    margin-bottom: 2.25rem;
    animation: fadeIn 0.4s ease-out both;
}

.letter-header {
    padding: 0.85rem 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
}
.letter-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2.5px;
    width: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg,
        var(--primary) 0%,
        var(--primary-light) 40%,
        rgba(255, 195, 0, 0.1) 100%);
    animation: growWidth 0.7s ease-out both;
}

.letter-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--accent-navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    letter-spacing: -0.01em;
}
.letter-title > i {
    color: var(--primary-dark);
    font-size: 1.15rem;
    filter: drop-shadow(0 1px 3px rgba(255, 195, 0, 0.4));
}

.letter-count {
    background: var(--accent-navy);
    color: var(--primary);
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid var(--accent-navy-dark);
    box-shadow: 0 2px 6px rgba(26, 26, 26, 0.2);
}

/* ---------- No Results ---------- */
.no-results {
    text-align: center;
    padding: 3.5rem 1.25rem;
    background: linear-gradient(180deg, var(--white) 0%, var(--surface) 100%);
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 1.5px dashed var(--border-warm);
    animation: fadeInUp 0.5s ease-out both;
    box-shadow: 0 6px 24px rgba(26, 26, 26, 0.05);
}
.no-results-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
    animation: floatY 3s ease-in-out infinite;
    display: inline-block;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-custom {
    background: var(--surface);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-warm);
    font-size: 0.88rem;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.04);
    animation: fadeIn 0.4s ease-out both;
}
.breadcrumb-custom a {
    color: var(--accent-navy);
    font-weight: 500;
    transition: color 0.2s ease;
}
.breadcrumb-custom a:hover {
    color: var(--primary-dark);
}

/* ---------- Pagination ---------- */
.pagination {
    margin-top: 2.5rem;
    animation: fadeInUp 0.5s ease-out both;
}
.pagination .page-link {
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    border-radius: 8px;
    color: var(--accent-navy);
    border-color: var(--border-warm);
    background: var(--white);
    transition: all 0.2s ease;
    margin: 0 2px;
    font-weight: 500;
}
.pagination .page-link:hover {
    background: var(--primary);
    color: var(--text-on-gold);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 195, 0, 0.35);
}
.pagination .page-item.active .page-link {
    background: var(--accent-navy);
    border-color: var(--accent-navy);
    color: var(--primary);
    font-weight: 700;
}

/* ---------- Staggered card entrance (JS overrides on dynamic render) ---------- */
.store-card:nth-child(1)  { animation-delay: 0.02s; }
.store-card:nth-child(2)  { animation-delay: 0.06s; }
.store-card:nth-child(3)  { animation-delay: 0.10s; }
.store-card:nth-child(4)  { animation-delay: 0.14s; }
.store-card:nth-child(5)  { animation-delay: 0.18s; }
.store-card:nth-child(6)  { animation-delay: 0.22s; }
.store-card:nth-child(7)  { animation-delay: 0.26s; }
.store-card:nth-child(8)  { animation-delay: 0.30s; }
.store-card:nth-child(n+9) { animation-delay: 0.34s; }

/* ---------- Responsive ---------- */
@media (max-width: 576px) {
    .page-header {
        padding: 2.5rem 0 1.5rem;
    }
    .page-title {
        font-size: 1.5rem;
    }
    .page-title::after {
        width: 45px;
        margin-top: 0.7rem;
    }
    .search-section {
        padding: 1.15rem 1rem;
        border-radius: 14px;
    }
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.8rem;
    }
    .store-image-container {
        height: 95px;
    }
    .stats-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
        padding: 0.75rem 1rem;
        font-size: 0.82rem;
    }
    .alphabet-nav {
        gap: 0.2rem;
    }
    .alphabet-letter {
        width: 30px;
        height: 30px;
        font-size: 0.76rem;
        border-radius: 8px;
    }
}
@media (max-width: 375px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .store-card,
    .page-title,
    .page-subtitle,
    .search-section,
    .stats-bar,
    .filter-badge,
    .breadcrumb-custom,
    .no-results,
    .pagination,
    .letter-section {
        opacity: 1 !important;
        transform: none !important;
    }
}