/* css/style.css */

/* Design Variables */
:root {
    --fk-blue: #2874f0;
    --fk-yellow: #ffe500;
    --fk-assured-blue: #008cff;
    --rating-green: #388e3c;
    --text-primary: #212121;
    --text-secondary: #878787;
    --text-green: #388e3c;
    --border-light: #f0f0f0;
    --bg-light: #ffffff;
    --shadow-subtle: 0 1px 5px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
    --font-stack: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-viewport-width: 480px;
}

/* Base resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    -webkit-tap-highlight-color: transparent;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
}

body {
    background-color: #e0e0e0;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Desktop Web container (shells mobile viewport) */
.mobile-viewport-shell {
    width: 100%;
    max-width: var(--max-viewport-width);
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    overflow: visible;
}

.mobile-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-bottom: 60px; /* Space for sticky bottom nav */
}

/* Brand Tabs Header Section */
.brand-tabs-header {
    width: 100%;
    background-color: #5CAFFF;
    padding: 12px 14px 4px 14px;
    display: flex;
    flex-direction: column;
}

/* Sticky Top Header Container (Search Bar + Category Menu) */
.sticky-header-container {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-section-header {
    background: linear-gradient(180deg, #5CAFFF 0%, #8fd0ff 50%, #ffffff 100%);
    padding: 8px 14px 12px 14px;
    display: flex;
    flex-direction: column;
}

/* Brand Tabs Toggle (Flipkart vs. Travel) */
.toggle-tabs {
    display: flex;
    gap: 12px;
}

.toggle-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#tab-flipkart {
    background-color: #ffd814;
    border-radius: 14px;
}

#tab-travel {
    background-color: #ffffff !important;
    border-radius: 14px;
}

/* Active & Inactive Visual States */
.toggle-tab.active {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.toggle-tab:not(.active) {
    box-shadow: none;
}

.toggle-tab .tab-icon,
.toggle-tab .tab-icon img,
.brand-tab-logo-img {
    opacity: 1 !important;
    filter: none !important;
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    margin-bottom: 2px;
}

.brand-tab-logo-img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

#tab-travel .brand-tab-logo-img {
    height: 22px;
}

.tab-label {
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    color: #212121;
    letter-spacing: -0.2px;
}

/* Search bar */
.search-section {
    width: 100%;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-radius: 12px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #4ea0ff;
    box-sizing: border-box;
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14.5px;
    color: #212121;
    font-family: inherit;
    padding: 0;
}

#search-input::placeholder {
    color: #000000;
    opacity: 1;
    font-weight: 400;
}

/* Categories Bar (Horizontally Scrollable Row) - Primary State */
.categories-bar {
    background-color: #ffffff;
    padding: 8px 14px 0 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 99;
    transition: all 0.2s ease;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.category-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.category-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.category-item.active .category-icon-wrapper {
    background: linear-gradient(180deg, #cde3fc 0%, #ffffff 100%);
}

.category-label {
    font-size: 11px;
    font-weight: 500;
    color: #494949;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: all 0.2s ease;
}

.category-item.active .category-label {
    color: #0c1a30;
    font-weight: 700;
}

.active-indicator {
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 4px;
    background-color: #2874f0;
    border-radius: 2px;
    display: none;
    transition: all 0.2s ease;
}

.category-item.active .active-indicator {
    display: block;
}

/* ==========================================================================
   SCROLLED STICKY STATE (Text Only Menu & Semi-Transparent Glass Effect)
   ========================================================================== */
.sticky-header-container.scrolled {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sticky-header-container.scrolled .search-section-header {
    background: linear-gradient(180deg, rgba(92, 175, 255, 0.85) 0%, rgba(143, 208, 255, 0.85) 50%, rgba(255, 255, 255, 0.85) 100%) !important;
}

.sticky-header-container.scrolled .categories-bar {
    background-color: transparent !important;
    padding: 0 14px;
    gap: 4px;
}

.sticky-header-container.scrolled .category-item {
    flex: 0 0 auto;
    padding: 12px 14px;
    gap: 0;
}

.sticky-header-container.scrolled .category-icon-wrapper {
    display: none !important;
}

.sticky-header-container.scrolled .category-icon-img {
    display: none !important;
}

.sticky-header-container.scrolled .category-label {
    font-size: 13.5px;
    color: #666666;
    width: auto;
    overflow: visible;
    text-overflow: clip;
}

.sticky-header-container.scrolled .category-item.active .category-label {
    color: #212121;
    font-weight: 700;
}

.sticky-header-container.scrolled .active-indicator {
    left: 12px;
    right: 12px;
    height: 3.5px;
}

/* Main Content Area */
.app-content {
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Promotional Banners Slider */
.promo-carousel {
    position: relative;
    width: calc(100% - 30px);
    aspect-ratio: 392 / 191;
    margin: 10px auto;
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.carousel-track {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background-color 0.2s, width 0.2s;
}

.indicator.active {
    background-color: #fff;
    width: 14px;
    border-radius: 3px;
}

/* Live Sale Countdown Bar */
.live-sale-timer-bar {
    background-color: #fff;
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 18px;
    font-weight: 700;
}

.live-sale-text {
    color: #212121;
}

.live-sale-time {
    color: #ff5722;
    margin-left: 2px;
}

/* Products Grid (2-column layout matching screenshot) */
.products-grid {
    background-color: #f1f3f6;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    margin-top: 0;
}

/* Product Card styling */
.product-card {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    padding: 12px;
    transition: transform 0.1s ease;
    position: relative;
}

.product-card:active {
    background-color: #fafafa;
}

.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* square ratio */
    margin-bottom: 10px;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.wishlist-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    color: #c2c2c2;
    z-index: 5;
    transition: color 0.2s, transform 0.1s;
}

.wishlist-btn:active {
    transform: scale(0.9);
}

.wishlist-btn.liked {
    color: #ff4343;
}

.wishlist-btn.liked svg {
    fill: #ff4343;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.product-title {
    font-size: 12px;
    font-weight: 400;
    color: #3f3f3f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 33px; /* reserve space for 2 lines */
}

.product-tagline {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-green);
    margin: 2px 0;
}

.product-price-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.product-original-price {
    font-size: 11px;
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Flipkart Assured Badge */
.f-assured-logo-img {
    height: 15px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
}

.product-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.rating-container {
    background-color: var(--rating-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rating-star {
    font-size: 8px;
}

.ratings-count {
    font-size: 10px;
    color: var(--text-secondary);
}

.product-delivery {
    font-size: 10px;
    color: #717478;
    margin-top: auto;
}

/* Empty State / No Results */
.no-results-card {
    grid-column: span 2;
    background-color: #fff;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-emoji {
    font-size: 40px;
}

.no-results-card h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.no-results-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

.reset-search-btn {
    background-color: var(--fk-blue);
    color: #fff;
    border: none;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(40,116,240,0.2);
}

/* Sticky Bottom Navigation */
.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-viewport-width);
    height: 56px;
    background-color: #fff;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
    flex: 1;
    height: 100%;
    justify-content: center;
    transition: color 0.15s ease;
}

.nav-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    transition: transform 0.2s ease;
}

.nav-icon {
    width: 28px;
    height: 28px;
    transition: all 0.15s ease;
}

.nav-icon path {
    stroke: #707070;
    transition: stroke 0.15s ease, fill 0.15s ease;
}

.nav-text {
    font-size: 10px;
    font-weight: 500;
}

.nav-link.active {
    color: var(--fk-blue);
    font-weight: 600;
}

.nav-link.active .nav-icon-wrapper {
    transform: scale(1.15);
}

.nav-link.active .nav-icon path {
    stroke: var(--fk-blue) !important;
}

/* Home active path gets solid blue fill */
.nav-link.active .home-path {
    fill: var(--fk-blue) !important;
}

/* Homepage Exclusive Loader Overlay */
.home-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.home-loader-spinner-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-loader-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3.5px solid #e2e8f0;
    border-top-color: #2874f0;
    border-right-color: #2874f0;
    border-radius: 50%;
    animation: homeLoaderSpin 0.85s linear infinite;
    box-sizing: border-box;
}
.home-loader-favicon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    z-index: 2;
    animation: homeFaviconPulse 1.8s ease-in-out infinite;
}
.home-loader-text {
    margin-top: 22px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #2874f0;
    letter-spacing: 0.2px;
    animation: homeTextPulse 1.5s ease-in-out infinite alternate;
}
@keyframes homeLoaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes homeFaviconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
@keyframes homeTextPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}
.home-loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
