/* Black Friday Mobile-First CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bf-black: #000000;
    --bf-red: #ff0000;
    --bf-yellow: #ffd700;
    --bf-white: #ffffff;
    --bf-dark-gray: #1a1a1a;
    --bf-gray: #2d2d2d;
    --bf-light-gray: #4a4a4a;
    --bf-accent: #ff3333;
    --nav-height: 60px;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bf-black);
    color: var(--bf-white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    padding-bottom: var(--nav-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding-bottom: var(--nav-height);
}

/* Black Friday Header */
.bf-header {
    background: linear-gradient(135deg, var(--bf-black) 0%, var(--bf-dark-gray) 100%);
    position: relative;
    overflow: hidden;
    padding: 1.25rem 0.75rem;
    margin-bottom: 1rem;
}

.bf-header.compact {
    padding: 1.25rem 0.75rem;
}

.bf-banner {
    position: relative;
    text-align: center;
    z-index: 2;
}

.lightning-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.1) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 0, 0, 0.1) 50%, transparent 60%);
    animation: lightning 3s ease-in-out infinite;
}

@keyframes lightning {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.bf-title {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 0.35rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.bf-title-compact {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.bf-black {
    color: var(--bf-white);
    background: linear-gradient(90deg, var(--bf-white), #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bf-friday {
    color: var(--bf-red);
    background: linear-gradient(90deg, var(--bf-red), var(--bf-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bf-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--bf-yellow);
    text-transform: uppercase;
}

/* Countdown Timer */
.countdown-timer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

/* When showing sale-live message, switch to column layout */
.countdown-timer:has(.sale-live) {
    flex-direction: column;
    gap: 0.5rem;
}

.time-segment {
    background: rgba(255, 0, 0, 0.1);
    border: 1.5px solid var(--bf-red);
    border-radius: 6px;
    padding: 0.35rem;
    min-width: 50px;
    text-align: center;
}

.time-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bf-yellow);
}

.time-label {
    display: block;
    font-size: 0.5625rem;
    color: var(--bf-white);
    margin-top: 0.2rem;
    letter-spacing: 0.75px;
}

.sale-live {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--bf-yellow);
    animation: flash 1s ease-in-out infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cyber Monday Countdown */
.cyber-monday-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.cyber-label {
    font-size: 0.75rem;
    color: #00bfff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cyber-time {
    font-size: 1rem;
    font-weight: 700;
    color: #00bfff;
    font-variant-numeric: tabular-nums;
}

/* Search Section */
.search-section {
    padding: 0 0.75rem;
    margin-bottom: 0.85rem;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 0.75rem;
    background: var(--bf-dark-gray);
    border: 1.5px solid var(--bf-light-gray);
    border-radius: 10px;
    color: var(--bf-white);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--bf-red);
    background: var(--bf-gray);
}

.search-bar input::placeholder {
    color: #888;
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #888;
}

/* Filter Section */
.filter-section {
    padding: 0 0.75rem;
    margin-bottom: 0.85rem;
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 0.375rem 0.875rem;
    background: var(--bf-dark-gray);
    border: 1.5px solid var(--bf-light-gray);
    border-radius: 16px;
    color: var(--bf-white);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--bf-red);
    border-color: var(--bf-red);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    padding: 0 1rem;
    min-height: calc(100vh - 300px);
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--bf-white);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bf-light-gray);
    border-top-color: var(--bf-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bf-white);
}

.error-icon {
    width: 48px;
    height: 48px;
    color: var(--bf-red);
    margin: 0 auto 1rem;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bf-red);
    color: var(--bf-white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--bf-accent);
    transform: scale(1.05);
}

/* Store Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
}

.store-card {
    background: var(--bf-dark-gray);
    border: 1.5px solid var(--bf-light-gray);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.store-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.store-card:hover {
    border-color: var(--bf-red);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.2);
}

.deal-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0.2rem 0.6rem;
    border-radius: 14px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.75px;
    z-index: 10;
    animation: badge-pulse 2s ease-in-out infinite;
}

.deal-badge.featured {
    background: linear-gradient(135deg, var(--bf-red), #ff6666);
    color: var(--bf-white);
}

.deal-badge.new {
    background: linear-gradient(135deg, var(--bf-yellow), #ffaa00);
    color: var(--bf-black);
}

.deal-badge.trending {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: var(--bf-white);
}

.deal-badge.datafree {
    background: linear-gradient(135deg, #00e676, #00c853);
    color: var(--bf-black);
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.store-logo-container {
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.88), transparent);
    padding: 0.5rem;
}

.store-logo {
    max-width: 100%;
    max-height: 32px;
    object-fit: contain;
}

.store-info {
    padding: 0.5rem 0.6rem;
}

.store-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--bf-white);
}

.store-tagline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.store-tagline {
    font-size: 0.75rem;
    color: #aaa;
    margin: 0;
    flex: 1;
}

.store-meta {
    margin-bottom: 0.65rem;
}

.discount-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--bf-yellow);
    border-radius: 4px;
    color: var(--bf-yellow);
    font-size: 0.75rem;
    font-weight: 600;
}

.shop-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--bf-red), var(--bf-accent));
    color: var(--bf-white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.shop-now-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

.btn-icon {
    width: 14px;
    height: 14px;
}

/* Catalogues Page */
.catalogues-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-bottom: 1rem;
}

.catalogue-card {
    background: var(--bf-dark-gray);
    border: 2px solid var(--bf-light-gray);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.catalogue-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.catalogue-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem;
    position: relative;
}

.catalogue-store-logo {
    width: 140px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.35rem;
}

.cat-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.store-initial {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bf-white);
}

.catalogue-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-icon {
    width: 28px;
    height: 28px;
    color: var(--bf-white);
}

.catalogue-info {
    padding: 0.75rem;
}

.catalogue-name {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bf-white);
    line-height: 1.3;
}

.catalogue-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.625rem;
    color: #999;
}

.meta-item svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.catalogue-actions {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--bf-red);
    border-radius: 8px;
    background: var(--bf-red);
    color: var(--bf-white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    transform: scale(1.05);
}

.download-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--bf-light-gray);
    border-radius: 8px;
    background: transparent;
    color: var(--bf-white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn {
    background: var(--bf-red);
    border-color: var(--bf-red);
}

.download-btn:hover {
    background: var(--bf-accent);
    border-color: var(--bf-accent);
    transform: scale(1.05);
}

.view-btn svg,
.download-btn svg {
    width: 16px;
    height: 16px;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bf-dark-gray);
    border-top: 1px solid var(--bf-light-gray);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: #888;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item.active {
    color: var(--bf-red);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bf-red);
}

.nav-item:hover {
    color: var(--bf-yellow);
}

/* Coming Soon Styles */
.coming-soon-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bf-white);
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.store-card.coming-soon .store-logo,
.catalogue-card.coming-soon .cat-logo {
    display: none;
}

.store-card.coming-soon .shop-now-btn,
.catalogue-card.coming-soon .view-btn {
    display: none;
}

.store-card.coming-soon .store-tagline,
.catalogue-card.coming-soon .catalogue-name {
    display: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Media Queries for tablets and larger screens */
@media (min-width: 768px) {
    .bf-title {
        font-size: 4rem;
    }

    .listings-grid,
    .catalogues-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .app-container {
        max-width: 1200px;
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .listings-grid,
    .catalogues-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch feedback */
button,
a,
.filter-chip {
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0.1);
}

/* Smooth scrolling for iOS */
.app-container {
    -webkit-overflow-scrolling: touch;
}

/* Safe area insets for notched devices */
.bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

.app-container {
    padding-top: env(safe-area-inset-top);
}

/* Modal/Popup Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bf-dark-gray);
    border: 2px solid var(--bf-red);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: block;
    color: var(--bf-yellow);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bf-white);
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-message {
    font-size: 0.9375rem;
    color: #ccc;
    text-align: center;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.modal-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.modal-logo {
    display: block;
    max-width: 150px;
    max-height: 70px;
    object-fit: contain;
}

.modal-notice {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background: var(--bf-gray);
    color: var(--bf-white);
    border: 1.5px solid var(--bf-light-gray);
}

.modal-btn-cancel:hover {
    background: var(--bf-light-gray);
    transform: scale(1.05);
}

.modal-btn-cancel:focus,
.modal-btn-cancel:active {
    background: var(--bf-gray);
    color: var(--bf-white);
    outline: none;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, var(--bf-red), var(--bf-accent));
    color: var(--bf-white);
}

.modal-btn-confirm:hover {
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.4);
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}