/* Basic Reset & Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f1f3f6; /* Flipkart page background */
    color: #212121; /* Default text color */
    line-height: 1.4;
    font-size: 14px; /* Base font size */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block; /* Prevent bottom space */
    height: auto;
}

/* Main Container */
.header-container, .category-container, .main-content, .footer-content {
     max-width: 1248px; /* Standard max width */
     margin: 0 auto; /* Center content */
     padding-left: 15px;
     padding-right: 15px;
}


/* Header */
.main-header {
    background-color: #fff;
    color: #000;
    padding: 10px 0; /* Adjusted padding */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    height: 56px; /* Standard Flipkart header height */
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; /* Ensure container takes full width */
}

/* Header Left - Logo */
.header-left {
    flex-shrink: 0;
    margin-right: 12px;
}

.logo-container {
    display: flex;
}

.logo-img {
    width: 75px; /* Slightly smaller */
    object-fit: contain;
}


/* Header Center - Search */
.header-center {
    flex-grow: 1;
    max-width: 580px; /* Adjusted width */
    margin: 0 12px; /* Adjusted margin */
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #f0f5ff; /* Lighter blue background */
    border-radius: 8px;
    height: 36px; /* Standard height */
    position: relative;
    padding-left: 45px; /* More space for the left icon */
    padding-right: 115px; /* Space for the right icons group */
}

.search-container .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #2874f0;
    font-size: 16px;
    pointer-events: none;
}

.search-container input[type="text"] {
    border: none;
    background: none;
    font-size: 14px;
    flex-grow: 1;
    outline: none;
    color: #212121;
    width: 100%;
    height: 100%;
    padding: 0 10px 0 0; /* Adjust right padding if needed */
}
.search-container input::placeholder {
    color: #878787;
}

.search-icons-right {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px; /* Space between icons */
}

.search-bar-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    color: #2874f0; /* Icons blue like search icon */
    line-height: 1;
    transition: color 0.2s ease;
}
.search-bar-icon-btn:hover {
    color: #172337; /* Darker blue/black on hover */
}
.search-bar-icon-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}
/* Style mic icon when listening */
.search-bar-icon-btn.listening i.fa-microphone {
    color: #ff6161; /* Red when listening */
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1);}
    100% { opacity: 0.6; transform: scale(1); }
}


/* Header Right - Links/Buttons */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px; /* Reduced gap */
    flex-shrink: 0;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #212121;
    font-size: 15px; /* Adjusted size */
    font-weight: 500;
    padding: 5px;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.header-link:hover {
    color: #2874f0; /* Blue hover for most links */
}

.header-link i {
    font-size: 18px;
}

.user-account {
    background-color: transparent; /* No blue bg initially */
    color: #212121;
    padding: 6px 8px;
    border-radius: 8px;
    gap: 5px;
    border: 1px solid transparent;
}
.user-account:hover {
    /* Maybe add subtle background on hover */
    /* background-color: #f0f5ff; */
    color: #2874f0;
}
.user-account i.far, .user-account i.fas {
    font-size: 18px; /* User icon size */
}
.user-account .dropdown-arrow {
    font-size: 12px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}
.user-account:hover .dropdown-arrow {
     transform: rotate(180deg);
}

.cart-link {
    position: relative;
}
.cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background-color: #ff6161;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
    line-height: 1;
    padding: 0 4px;
}

.seller-link {
     display: none; /* Hide by default on smaller viewports */
}
@media (min-width: 992px) { /* Show seller link on larger screens */
   .seller-link {
       display: flex;
   }
}
@media (min-width: 1100px) { /* Reduce gap on very large screens */
   .header-right {
      gap: 25px;
   }
}


.more-options i {
    font-size: 20px;
}

/* Scribble Pad Styles */
.scribble-pad-container {
    position: fixed;
    top: 60px; /* Below header */
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    padding: 15px 20px 20px;
    width: 440px;
    max-width: 90%;
}
.scribble-pad-container h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
    color: #555;
}

#scribble-canvas {
    border: 1px dashed #aaa;
    cursor: crosshair;
    touch-action: none; /* Prevent page scroll on touch devices */
    width: 100%; /* Make canvas responsive */
    height: 150px; /* Fixed height */
    display: block; /* Remove extra space below */
    border-radius: 4px;
}

.scribble-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.scribble-controls button {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.scribble-controls #clear-scribble-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
}
.scribble-controls #search-scribble-btn {
    background-color: #fb641b; /* Flipkart Orange */
    color: white;
    border: none;
}
.scribble-controls #close-scribble-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    line-height: 1;
    padding: 0 5px;
}
.scribble-controls #close-scribble-btn:hover {
    color: #333;
}

/* Category Navigation */
.category-nav {
    background-color: white;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    padding: 10px 0;
    margin-bottom: 10px; /* Space below nav */
    overflow: hidden; /* Prevent accidental scrollbars if container slightly too small */
}
.category-container {
    display: flex;
    justify-content: space-between; /* Distribute items */
    align-items: flex-start;
    overflow-x: auto; /* Allow horizontal scrolling on smaller screens */
    scrollbar-width: none; /* Hide scrollbar for firefox */
    -ms-overflow-style: none;  /* Hide scrollbar for IE/Edge */
    padding: 5px 0; /* Padding inside for scroll */
}
.category-container::-webkit-scrollbar { /* Hide scrollbar for Webkit */
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px; /* Min width ensures items aren't too squished */
    padding: 5px 8px;
    flex-shrink: 0; /* Prevent items shrinking */
}
.category-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 5px; /* Reduced space */
}
.category-item span {
    font-size: 13px; /* Slightly smaller text */
    font-weight: 500;
    color: #333;
    line-height: 1.2;
}
.category-item:hover span {
    color: #2874f0; /* Blue text on hover */
}


/* Main Content */
.main-content {
    padding-top: 10px; /* Space below category nav/header */
    padding-bottom: 20px;
    min-height: 400px; /* Ensure footer isn't too high on empty pages */
}

/* Hero Banner/Carousel */
.hero-banner {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    background-color: #e0e0e0; /* Placeholder background */
    border-radius: 4px; /* Slight rounding */
    min-height: 150px; /* Prevent collapse before image load */
}
.hero-banner img {
    width: 100%;
    display: block;
    aspect-ratio: 1600 / 270; /* Maintain aspect ratio like Flipkart */
    object-fit: cover; /* Cover the area */
}

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    width: 47px; /* Flipkart's arrow size */
    height: 104px;
    font-size: 24px;
    color: #878787;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease;
}
.banner-arrow:hover {
    background-color: #fff;
}
.left-arrow {
    left: 0px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.right-arrow {
    right: 0px;
     border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 11; /* Above image */
}
.banner-dots .dot {
    width: 8px;
    height: 8px;
    background-color: #fff; /* White dots */
    opacity: 0.5;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
}
.banner-dots .dot.active {
    opacity: 1;
}


/* Products Section */
.products-section {
    background-color: white;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: 4px;
}
.products-section h2 {
    margin-bottom: 20px;
    font-size: 20px; /* Adjusted size */
    font-weight: 500;
    padding-bottom: 5px;
    color: #212121;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Responsive grid */
    gap: 15px; /* Slightly reduced gap */
}

.product-card {
    display: flex;
    flex-direction: column;
    min-height: 340px;
    height: 100%;
    border: 1px solid transparent;
    padding: 15px 10px;
    text-align: center;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    position: relative;
    background-color: white;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.product-link {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-link:hover {
    text-decoration: none;
}

.product-card img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    margin-bottom: 15px;
    align-self: center;
    flex-shrink: 0;
}

.product-card h3 {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
    height: 3.2em;
    line-height: 1.4em;
    overflow: hidden;
    color: #333;
    flex-grow: 1;
}

.product-card .price {
    font-weight: 500;
    color: #212121;
    margin-bottom: 15px;
    font-size: 16px;
    margin-top: auto;
    padding-top: 10px;
}

.add-to-cart-btn {
    background-color: #ff9f00;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.2s ease;
    display: block;
    margin-top: auto;
    text-transform: uppercase;
    width: 100%;
    border: none;
    cursor: pointer;
}

.add-to-cart-btn:hover {
    background-color: #f09500;
}

/* Footer */
.main-footer {
    background-color: #172337; /* Dark Footer Blue */
    color: #ccc;
    padding: 25px 0; /* More padding */
    margin-top: 30px;
    font-size: 13px; /* Smaller footer text */
    line-height: 1.6;
}
.footer-content {
    text-align: center;
}
/* Add more footer styling (columns, links etc.) here later */


/* Login Popup Overlay & Content */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); /* Slightly darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    opacity: 0; /* Start hidden */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.popup-overlay.active { /* Class to show popup */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}


/* Updated Popup Content Style */
.popup-content {
    background-color: #fff;
    border-radius: 4px;
    position: relative;
    width: 680px; /* Wider popup */
    max-width: 95%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    padding: 0;
    overflow: hidden; /* Prevents content overflow */
    transform: scale(0.9); /* Start slightly small */
    transition: transform 0.3s ease;
}
.popup-overlay.active .popup-content {
     transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 10px; /* Adjusted position */
    right: 10px;
    font-size: 26px;
    color: #878787; /* Grey close button */
    background: none;
    border: none;
    z-index: 10;
    line-height: 1;
    padding: 5px;
}
.popup-close:hover {
    color: #333;
}

.popup-left {
    background-color: #2874f0;
    padding: 35px 30px;
    color: #fff;
    width: 40%;
    display: flex; /* Flex column for centering */
    flex-direction: column;
    justify-content: space-between;
}
.popup-left h2 {
    font-size: 24px; /* Adjusted */
    font-weight: 500;
    margin-bottom: 15px;
}
.popup-left p {
    font-size: 16px; /* Adjusted */
    line-height: 1.4;
    color: #dbdbdb;
}
.login-graphic {
    width: 100%;
    max-width: 150px;
    margin: 30px auto 0;
    display: block;
}


.popup-right {
    padding: 45px 35px 24px; /* Adjusted padding */
    width: 60%;
    display: flex;
    flex-direction: column;
}

.popup-right form {
    flex-grow: 1;
}

.popup-right form input[type="text"] {
    width: 100%;
    padding: 10px 5px;
    margin-bottom: 15px; /* Space */
    border: none;
    border-bottom: 1px solid #e0e0e0;
    font-size: 15px;
    color: #212121;
}
.popup-right form input[type="text"]:focus {
    outline: none;
    border-bottom: 2px solid #2874f0;
}

/* Add styles for OTP, Password fields if needed later */

.popup-action-btn {
    background-color: #fb641b;
    color: white;
    padding: 12px 20px;
    width: 100%;
    border-radius: 2px;
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
    margin-top: 20px; /* Space above */
    margin-bottom: 24px;
}
.popup-action-btn:hover {
    opacity: 0.9;
}

.popup-footer-link {
    text-align: center;
    margin-top: auto; /* Push to bottom */
    padding-top: 20px; /* Space above link */
}
.popup-footer-link a {
    color: #2874f0;
    font-weight: 500;
    font-size: 14px;
}


/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Start off-screen */
    width: 380px;
    max-width: 95%;
    height: 100%;
    background-color: #f1f3f6; /* Match page background */
    box-shadow: -3px 0 6px rgba(0,0,0,0.1);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease-in-out;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px; /* Adjusted */
    background-color: #fff; /* White header like main */
    color: #212121;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.cart-header h2 {
    font-size: 18px;
    font-weight: 500;
}
.cart-close-btn {
    font-size: 26px;
    color: #878787;
    background: none;
    border: none;
    line-height: 1;
}
.cart-close-btn:hover {
    color: #333;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f1f3f6;
}

.cart-item {
    display: flex;
    align-items: flex-start; /* Align to top for longer titles */
    margin-bottom: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    border-radius: 2px;
}
.cart-item img {
    width: 70px; /* Adjusted */
    height: 70px;
    object-fit: contain;
    margin-right: 15px;
    flex-shrink: 0;
}
.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-item-details h4 {
    font-size: 14px;
    font-weight: 400; /* Regular */
    line-height: 1.3;
    color: #333;
    /* Limit lines (optional) */
    /* max-height: 2.6em;
    overflow: hidden; */
}
.cart-item-details .price {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 0;
    color: #212121;
}
.cart-item-quantity {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-top: 5px; /* Space */
}
.cart-item-quantity button {
    background-color: #fff;
    border: 1px solid #c2c2c2;
    width: 28px;
    height: 28px;
    font-weight: bold;
    font-size: 18px;
    margin: 0;
    border-radius: 50%;
    color: #555;
    line-height: 26px; /* Center + / - vertically */
    text-align: center;
    transition: background-color 0.2s ease;
}
.cart-item-quantity button:hover {
    background-color: #f5f5f5;
}
.cart-item-quantity span.item-qty {
    border: 1px solid #c2c2c2;
    padding: 0 10px; /* Sideways padding */
    display: inline-block;
    min-width: 40px;
    text-align: center;
    height: 28px;
    line-height: 26px;
    margin: 0 8px; /* Space around */
    font-size: 14px;
    border-radius: 2px;
}

.remove-item-btn {
    font-size: 13px;
    color: #555;
    margin-top: 10px;
    font-weight: 500;
    text-transform: uppercase;
    align-self: flex-start;
    padding: 5px 0; /* Click area */
}
.remove-item-btn:hover {
    color: #c0392b; /* Darker red */
    text-decoration: none;
}


.empty-cart-message {
    text-align: center;
    color: #888;
    margin-top: 30px;
    font-size: 16px;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
}

.cart-footer {
    padding: 15px;
    border-top: 1px solid #d0d0d0;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.cart-summary {
     /* Container for total and button */
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px; /* Adjusted size */
    font-weight: 500;
    margin-bottom: 15px;
    color: #212121;
}
.cart-total span:last-child {
    font-weight: 700; /* Bold total price */
}

.checkout-btn {
    background-color: #fb641b;
    color: white;
    width: 100%;
    padding: 12px; /* Adjusted */
    font-size: 16px;
    font-weight: 500;
    border-radius: 2px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
}
.checkout-btn:hover {
    opacity: 0.9;
}


/* Fly-to-Cart Animation Item */
.fly-item {
    position: absolute;
    width: 40px; /* Slightly larger flying item */
    height: 40px;
    /* Use a background color or image */
    background-color: rgba(255, 159, 0, 0.7); /* Semi-transparent orange */
    /* If using image: */
     background-size: contain;
     background-repeat: no-repeat;
     background-position: center;
    border-radius: 50%;
    z-index: 1500; /* Above everything */
    transition: all 0.7s cubic-bezier(0.3, 0.88, 0.58, 1.3); /* Adjusted Bezier */
    opacity: 1;
    pointer-events: none; /* Don't interact with it */
}

/* AI Search Popup Styles */
.ai-search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-search-popup.active {
    opacity: 1;
    visibility: visible;
}

.ai-search-content {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(40, 116, 240, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 2001; /* Higher than the popup background */
    -webkit-backdrop-filter: none;
    backdrop-filter: none; /* Ensure content is not blurred */
}

.ai-search-popup.active .ai-search-content {
    transform: scale(1);
}

.ai-search-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(40, 116, 240, 0.1) 0%, rgba(40, 116, 240, 0) 70%);
    animation: ambientLight 8s infinite alternate;
    z-index: -1;
}

@keyframes ambientLight {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.ai-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ai-search-header h2 {
    font-size: 24px;
    color: #2874f0;
    margin: 0;
}

.ai-search-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #878787;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ai-search-close:hover {
    color: #333;
}

.ai-search-input-container {
    position: relative;
    margin-bottom: 20px;
}

.ai-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #2874f0;
    font-size: 20px;
}

#ai-search-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#ai-search-input:focus {
    outline: none;
    border-color: #2874f0;
    box-shadow: 0 0 15px rgba(40, 116, 240, 0.2);
}

.ai-search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

/* Remove the body blur class since we're handling it in the popup */
body.blur-background {
    transition: none;
}

/* New Features Button */
.new-features {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #2874f0;
    font-weight: 500;
    transition: all 0.2s ease;
}

.new-features:hover {
    color: #172337;
}

.new-features i {
    font-size: 18px;
}

/* New Features Popup */
.new-features-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.new-features-popup.active {
    opacity: 1;
    visibility: visible;
}

.new-features-content {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(40, 116, 240, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 2001;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.new-features-popup.active .new-features-content {
    transform: scale(1);
}

.new-features-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.new-features-header h2 {
    font-size: 24px;
    color: #2874f0;
    margin: 0;
}

.new-features-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #878787;
    cursor: pointer;
    transition: color 0.2s ease;
}

.new-features-close:hover {
    color: #333;
}

.new-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-item i {
    font-size: 24px;
    color: #2874f0;
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 18px;
    color: #212121;
    margin: 0 0 10px 0;
}

.feature-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Shop by Story Scroll Journey */
.shop-by-story-section {
    background: #fff;
    margin: 30px auto;
    padding: 30px 0 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(40,116,240,0.07);
    max-width: 900px;
}
.shop-by-story-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: #2874f0;
    font-weight: 700;
}
.story-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-height: 600px;
    overflow-y: auto;
    padding: 0 20px;
}
.story-scene {
    position: relative;
    background: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(40,116,240,0.08);
    padding: 30px 20px 60px 20px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.story-bg {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    margin-bottom: 18px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(40,116,240,0.10);
}
.story-caption {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 18px;
    font-weight: 500;
    text-align: center;
}
.story-products {
    display: flex;
    gap: 18px;
    justify-content: center;
}
.story-product {
    background: linear-gradient(90deg, #2874f0 60%, #00c6ff 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(40,116,240,0.13);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    outline: none;
}
.story-product:hover {
    background: linear-gradient(90deg, #00c6ff 0%, #2874f0 100%);
    transform: translateY(-2px) scale(1.05);
}

/* Mystery Box Unboxing UI */
.mystery-box-section {
    background: #fff;
    margin: 30px auto;
    padding: 30px 0 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(40,116,240,0.07);
    max-width: 900px;
    text-align: center;
}
.mystery-box-section h2 {
    font-size: 2rem;
    color: #fb641b;
    font-weight: 700;
    margin-bottom: 20px;
}
.mystery-box-btn {
    background: linear-gradient(90deg, #fb641b 60%, #ffb347 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(251,100,27,0.13);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    outline: none;
    margin-bottom: 20px;
}
.mystery-box-btn:hover {
    background: linear-gradient(90deg, #ffb347 0%, #fb641b 100%);
    transform: scale(1.05);
}
.mystery-box-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}
.mystery-box-modal.active {
    display: flex;
    opacity: 1;
}
.mystery-box-content {
    background: #fff;
    border-radius: 18px;
    padding: 40px 30px 30px 30px;
    box-shadow: 0 8px 32px rgba(40,116,240,0.18);
    position: relative;
    min-width: 340px;
    max-width: 95vw;
    text-align: center;
    overflow: visible;
}
.close-mystery-box {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    z-index: 10;
}
.mystery-box-animation {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 30px auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.box-lid {
    position: absolute;
    top: 0;
    left: 50%;
    width: 120px;
    height: 40px;
    background: linear-gradient(90deg, #fb641b 60%, #ffb347 100%);
    border-radius: 12px 12px 30px 30px;
    transform: translateX(-50%) rotate(0deg);
    box-shadow: 0 2px 8px rgba(251,100,27,0.13);
    z-index: 2;
    transition: transform 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}
.mystery-box-modal.unboxed .box-lid {
    transform: translateX(-50%) rotate(-60deg) translateY(-60px);
}
.box-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 120px;
    height: 80px;
    background: linear-gradient(90deg, #fb641b 60%, #ffb347 100%);
    border-radius: 0 0 18px 18px;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(251,100,27,0.13);
    z-index: 1;
}
.box-shadow {
    position: absolute;
    bottom: -18px;
    left: 50%;
    width: 90px;
    height: 18px;
    background: radial-gradient(ellipse at center, #fb641b33 0%, #fff0 100%);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 0;
}
.box-effect {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 60px;
    height: 60px;
    pointer-events: none;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 3;
    background: radial-gradient(circle, #fffbe6 0%, #fff0 80%);
    transition: opacity 0.5s;
}
.mystery-box-modal.unboxed .box-effect {
    opacity: 1;
    animation: boxEffectGlow 1.2s;
}
@keyframes boxEffectGlow {
    0% { opacity: 0; transform: scale(0.5) translateX(-50%); }
    60% { opacity: 1; transform: scale(1.2) translateX(-50%); }
    100% { opacity: 0; transform: scale(1.5) translateX(-50%); }
}
.mystery-box-result {
    min-height: 40px;
    font-size: 1.2rem;
    color: #2874f0;
    font-weight: 600;
    margin: 20px 0 0 0;
}
.unbox-action-btn {
    background: linear-gradient(90deg, #fb641b 60%, #ffb347 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(251,100,27,0.13);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    outline: none;
    margin-top: 18px;
}
.unbox-action-btn:hover {
    background: linear-gradient(90deg, #ffb347 0%, #fb641b 100%);
    transform: scale(1.05);
}

/* Mode Toggle Buttons */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 30px 0 20px 0;
}
.mode-toggle-btn {
    background: linear-gradient(90deg, #2874f0 60%, #00c6ff 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(40,116,240,0.13);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, color 0.2s;
    outline: none;
}
.mode-toggle-btn.active, .mode-toggle-btn:focus {
    background: linear-gradient(90deg, #00c6ff 0%, #2874f0 100%);
    color: #fff;
    transform: scale(1.07);
}
.mode-toggle-btn:hover {
    background: linear-gradient(90deg, #00c6ff 0%, #2874f0 100%);
    color: #fff;
}

/* Reel Mode Horizontal Scroll */
.reel-scroll {
    display: flex;
    flex-direction: row;
    gap: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    max-width: 100vw;
}
.story-scene {
    min-width: 340px;
    max-width: 400px;
    scroll-snap-align: center;
    margin-bottom: 0;
}

/* Hide sections by default, show only active mode (handled by JS) */
#normal-mode-section, #reel-mode-section, #mystery-mode-section {
    display: none;
}
#normal-mode-section.active, #reel-mode-section.active, #mystery-mode-section.active {
    display: block !important;
}

/* Mode Toggle Segmented Control */
.mode-toggle-segmented {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f5f5;
    border-radius: 32px;
    margin: 30px auto 24px auto;
    max-width: 420px;
    box-shadow: 0 2px 8px rgba(40,116,240,0.07);
    padding: 6px;
    gap: 0;
}
.mode-segment {
    flex: 1 1 0;
    background: none;
    border: none;
    color: #2874f0;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 12px 0;
    border-radius: 24px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    margin: 0 2px;
    outline: none;
    box-shadow: none;
}
.mode-segment-active, .mode-segment:focus {
    background: linear-gradient(90deg, #2874f0 60%, #00c6ff 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(40,116,240,0.13);
    z-index: 1;
}
.mode-segment:hover:not(.mode-segment-active) {
    background: #e3f0ff;
    color: #2874f0;
}