@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&family=Noto+Serif+JP:wght@200..900&display=swap');

body {
    margin: 0;
    padding: 0;
}

.header {
    width: 100%;    
    height: 7vh;    
    padding: 10px;
    z-index: 101;
    box-sizing: border-box;
    background-color: #1d2b47;
    display: flex;
    align-items: center; 
    
    /* NEW CONSTRAINT: Keeps the header block from flattening out on low screen heights */
    min-height: 50px; 
    /* Amazon-style floor: Stops layout from collapsing into mush on narrow screens */
    min-width: 850px; 
}

.header-logo {
    height: 100%;
    width: auto;         
}

.main-btn {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    height: 105%; 
    margin-top: 1vh;
    margin-left: 0.8vw;
    flex-shrink: 0; 
}

/* Overall button container */
.location-btn {
    background: transparent;
    border: none;
    padding: 1%;               
    cursor: pointer;
    display: inline-flex;
    margin-left: 0.7vw;
    width: 100%;
    margin-bottom: 0.007vh;
    
    max-width: 9vw;
    min-width: 130px; 
    flex-shrink: 0; 
}

/* Vertical layout container */
.location-div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;               
    pointer-events: none;
    overflow: hidden;
}

.location-text {
    color: #ffffff;
    font-family: sans-serif;
    text-align: left;
    font-size: 2.5vh; 
}

/* "Deliver To" text */
.top-text {
    font-size: 70%;            
    opacity: 0.8;
    margin-left: 0.9vw;
}

.bottom-text {
    font-size: 90%;            
    margin-top: 0.1vh;
    display: flex;
    align-items: center;
    width: 100%;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Icon style scaled using percentages */
.pin-icon {
    height: 1.1em;             
    width: auto;               
    margin-right: 1%;          
    filter: invert(1);
    flex-shrink: 0;
}

/* The main unified container bar */
.search-container {
    display: flex;
    align-items: center;
    background-color: #1a1a1a; 
    border-radius: 8px;        
    height: 75%;              
    width: 100%;
    flex: 1;                   
    max-width: 1815px;         
    overflow: hidden;
    box-sizing: border-box;

    /* NEW CONSTRAINT: Ensures the search input field remains usable if vh drops */
    min-height: 35px;
}

.search-container:focus-within {
    outline: 2px solid #c83b26;        /* Your theme's reddish-orange accent color */
    box-shadow: 0 0 10px rgba(200, 59, 38, 0.5);
    position: relative;
    z-index: 101;                     /* Lifts the search bar above the dark overlay */
}

/* 2. The Dim Overlay Screen */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6); /* Adjust the 0.6 to make it darker or lighter */
    z-index: 100;                     /* Sits right below the active search bar */
    opacity: 0;
    pointer-events: none;             /* Allows clicking through it when hidden */
    transition: opacity 0.2s ease;    /* Smooth fade in/out animation */
}

/* 3. Show Overlay When Search Bar is Focused */
body:has(.search-container:focus-within) .search-overlay {
    opacity: 1;
    pointer-events: auto;             /* Blocks background clicks while active */
}

/* 1. Left Dropdown Styling */
.search-dropdown {
    background-color: #2b2b2b; 
    color: #ffffff;
    border: none;
    height: 100%;
    padding: 0 15px;
    font-size: 89%;            
    cursor: pointer;
    outline: none;
    width: 8%; 
    min-width: 75px;           
    flex-shrink: 0;
}

/* 2. Middle Input Text Field */
.search-input {
    flex: 1;                   
    background: transparent;   
    border: none;
    width: 150%;               
    padding: 0 15px;
    color: #ffffff;
    font-size: 100%;           
    outline: none;             
    font-family: Noto Serif JP;
}

.search-input::placeholder {
    color: #888888;
}

/* 3. Right Search Icon Button */
.search-btn {
    background-color: #c83b26; 
    border: none;
    height: 100%;
    width: 3vw;                
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;            
    cursor: pointer;
    transition: background-color 0.2s ease;
    
    min-width: 45px;           
    flex-shrink: 0;
}

.search-btn:hover {
    background-color: #b0301e;
}

.account-div {
    display: block;
    color: white;
    text-decoration: none;    
    margin: 1.6%;
    flex-shrink: 0;
}

.account-text {
    display: block;
    font-family: sans-serif;
    white-space: nowrap;
    font-size: 105%;       
}

.cart-block {
    display: flex;
    align-items: flex-end;         /* Keeps text sitting flat inline with the cart bottom */
    cursor: pointer;
    gap: 0.5vw;                    
    flex-shrink: 0;
    font-size: 105%;         
    margin-right: 1.2%;  
}

.cart-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.6%;
}

.cart-icon {
    height: 2.vh;                 /* Perfectly balanced with the 7vh header */
    width: auto;
    filter: invert(1);
}

.cart-text {
    color: white;
    margin-bottom: 0.2vh;          
    font-family: sans-serif;
    font-size: 110%;             
    font-weight: 400;
}

.cart-count {
    position: absolute;
    bottom: 57%;                      
    left: 83%;                     
    
    color: #c83b26;                /* Your custom Raku red matching the search button */
    font-family: sans-serif;
    font-size: 90%;                /* Balanced text size so it nests cleanly inside the lines */
    font-weight: 900;
    text-align: center;
    line-height: 1;
}

/* The Sidebar panel styling */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;                     
    max-width: 85vw;                  
    height: 100vh;
    background-color: #0d0d0d;        /* Dark slate-black background */
    color: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
    z-index: 1000;                    
    
    transform: translateX(100%);      
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.cart-drawer.open {
    transform: translateX(0);
}

/* Header Panel Layout */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #1a1a1a; /* Clean divider layout */
}

.drawer-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-bag-icon {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.drawer-header h2 {
    margin: 0;
    font-family: Noto Serif JP;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-count {
    color: #888888;
    font-weight: 400;
    font-size: 16px;
    margin-left: 4px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #888888;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ffffff;
}

/* Centered Empty State Container */
.drawer-content-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.empty-icon-wrapper {
    margin-bottom: 24px;
    color: #444444;                   /* Subdued icon color matching interface style */
}

.empty-bag-icon {
    width: 64px;
    height: 64px;
}

.drawer-content-empty h3 {
    margin: 0 0 10px 0;
    font-family: Noto Serif JP;
    font-size: 18px;
    font-weight: 600;
}

.drawer-content-empty p {
    margin: 0 0 30px 0;
    font-family: Noto Serif JP;
    font-size: 14px;
    color: #888888;                   /* Subtext color style */
    line-height: 1.5;
    max-width: 280px;
}

/* Pill Shaped Interaction Button */
.start-shopping-btn {
    background-color: #e5e5e5;        /* Light gray off-white look */
    color: #000000;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;              /* Soft rounded pill style */
    font-family: Noto Serif JP;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-shopping-btn:hover {
    background-color: #ffffff;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;                     
    max-width: 85vw;                  
    height: 100vh;
    background-color: #1d2b47;        
    color: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
    z-index: 1002;                    /* One layer higher than the header/overlay layers */
    
    transform: translateX(100%);      
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.cart-drawer.open {
    transform: translateX(0);
}

.site-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6); 
    z-index: 999;                         
    
    /* The Fade Engine combo */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    
    /* Animates both opacity and visibility together */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.site-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;             
}

/* --- STATE B: When Search is Active --- */
.site-overlay.search-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; 
}

.categories-nav {
    background-color: #34445c; /* Matches the dark slate blue color */
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.categories-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px; /* Space between categories */
    align-items: center;
    overflow-x: auto; /* Allows scrolling on mobile screens */
}

.categories-nav li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap; /* Prevents text wrapping to a new line */
    transition: opacity 0.2s ease;
}

.categories-nav li a:hover {
    opacity: 0.8;
}

.categories-nav .menu-icon {
    margin-right: 4px;
}

/* Container block holding the whole header block together */
.header-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 101;
}

/* Sets up the sub-nav horizontal line layout and centers the content */
.sub-nav {
    width: 100%;
    background-color: #243556; /* Accent color matching your header bar theme */
    display: flex;
    align-items: center;
    justify-content: center; /* NEW: Centers the buttons and links perfectly inline */
    padding: 0 15px;
    height: 42px;
    box-sizing: border-box;
    gap: 15px;
    min-width: 850px;
}

/* The inline "All" box button layout */
.sub-nav-btn {
    background: transparent;
    border: 1px solid #ffffff;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

/* Row links layout styles */
.sub-nav-link {
    color: #ffffff;
    text-decoration: none;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.sub-nav-link:hover {
    opacity: 1;
}

.hero-section {
    width: 100%;
    height: 35vh; 
    min-height: 300px;
    background: rgba(20, 32, 53, 0.85);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 1%; /* CHANGED: Shrunk left padding perfectly down to 1.2vw to strip away the massive blank gap */
    box-sizing: border-box;
}

.hero-content {
    max-width: 25vw; 
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0.5vw; /* OPTIONAL ADJUSTMENT: Finely tunes the alignment with the 'All' button box right above it */
}

/* Tiny effortless ordering pill badge */
.hero-badge {
    background-color: #c83b26; 
    color: #ffffff;
    font-family: Noto Serif JP;
    
    /* 1. Stop the text from shrinking: Use a fixed size instead of vw */
    font-size: 12px; 
    font-weight: 700;
    
    /* 2. Use padding that scales with the text size */
    padding: 6px 10px; 
    border-radius: 4px;
    text-transform: lowercase;
    margin-bottom: 1.5vh; 
    letter-spacing: 0.5px;

    /* 3. Let the red box tightly hug the text on multiple lines */
    display: inline-block; 
    width: max-content;
}

/* Main Heading Title */
.hero-title {
    color: #ffffff;
    font-family: Noto Serif JP;
    font-size: 200%; 
    font-weight: 800;
    line-height: 1.15; 
    margin: 0 0 1.5vh 0; 
    
    /* Prevents wrapping and cuts off */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Subtext description */
.hero-text {
    color: #e5e5e5;
    font-family: Noto Serif JP;
    font-size: 100%; 
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    opacity: 0.9;
    
    /* Prevents wrapping and cuts off */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Puts a clean space between the icon and text */
    background-color: #5865F2; /* Official Discord Blurple */
    color: #ffffff;
    text-decoration: none; /* Removes the default underline from links */
    font-family: inherit;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.discord-btn:hover {
    background-color: #4752C4; /* Darkens slightly on hover */
}

.discord-btn:active {
    transform: scale(0.98); /* Slight click effect */
}

.copyright {
    color: white;
    font-family: Noto Serif JP;
    font-size: 75%;
    text-align: center;
    margin: 0.75%;
}

/* Costco Variant Image Squares Gallery Row */
.costco-thumbs-gallery-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* Individual Little Square Box */
.costco-thumb-square {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.costco-thumb-square:hover {
    border-color: #005da4;
}

/* Focused active square state outline */
.costco-thumb-square.active-thumb {
    border: 2px solid #005da4; /* Costco blue border for selected option */
    padding: 1px;
}

.costco-thumb-square img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}