/* FILE: skins/mobile1/css/layout.css */

/* --- APP HEADER --- */
.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    align-items: center;
    /* Logo pushes right content to the end */
    justify-content: flex-start; 
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto; /* This pushes the search/cart/menu group to the right */
}

/* --- HEADER CONTROLS --- */

/* 1. Hide desktop nav links */
.main-nav {
    display: none !important;
}

.header-nav-group {
    display: none !important;
}

/* 2. Search & Cart Wrapper */
.header-bottom-row {
    display: flex !important;
    align-items: center;
    /* Even spacing between Search and Cart */
    gap: 12px; 
    /* Even spacing between Cart and Hamburger Menu */
    margin-right: 12px; 
    margin-top: 0;
}

/* Style the Search Bar */
.header-item-search {
    display: flex;
    align-items: center;
}

.header-search-input {
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 6px 8px;
    font-size: 0.9rem;
    width: 100px; /* Compact start width */
    height: 36px;
    transition: width 0.2s ease;
}

.header-search-input:focus {
    width: 140px; /* Expand on focus */
    border-color: var(--primary-color);
    outline: none;
}

.header-search-button {
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #555;
    border-radius: 0 4px 4px 0;
    padding: 0 10px;
    cursor: pointer;
    height: 36px;
    border-left: none;
    line-height: 1;
}

/* Cart Button & Badge */
.header-cart-button {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 1.4rem; /* Larger icon */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px; /* Square target */
    padding: 0;
}

.cart-item-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #B12704;
    color: #fff;
    border-radius: 10px; /* Pill shape if >1 digit */
    padding: 2px 5px;
    min-width: 18px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid #fff; /* White border makes it pop */
    z-index: 10;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: block;
    font-size: 1.6rem;
    color: var(--dark-text);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    height: 36px;
    width: 36px;
    line-height: 36px;
    text-align: center;
}

/* Hide Auth Links in Header */
.header-auth-links--desktop {
    display: none !important;
}

/* --- SLIDE OUT NAVIGATION (APP DRAWER) --- */
.nav-collapsible {
    display: block; 
    position: fixed;
    top: 0;
    right: 0;
    width: 80%; 
    max-width: 300px;
    height: 100%;
    background: #fff; 
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu-overlay {
    display: block; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
}

/* Menu Open State */
body.nav-open .nav-collapsible { transform: translateX(0); }
body.nav-open .mobile-menu-overlay { opacity: 1; visibility: visible; }

.mobile-menu-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
}

/* App Drawer Links */
.main-nav--mobile a {
    display: block;
    padding: 12px 15px;
    font-size: 1.1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}
.header-auth-links--mobile a {
    display: block;
    padding: 12px 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

/* Mobile Search in Drawer (Hidden as it is in header) */
.header-item-search--mobile {
    display: none; 
}

/* --- ADMIN & DASHBOARD LAYOUTS (FORCE MOBILE) --- */
.admin-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Admin Sidebar */
.admin-sidebar {
    display: none; 
    width: 100%;
    background: #fff;
    border-radius: 6px;
    /* Separator for Admin Menu */
    border-bottom: 3px solid var(--secondary-color);
    margin-bottom: 20px;
}
.admin-sidebar.active { display: block; }

/* Admin Toggle Button */
.admin-sidebar-toggle {
    display: block; 
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}

.admin-content {
    width: 100%;
    padding: 0; 
    overflow-x: hidden;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 10px;
}

/* Launchpad */
.launchpad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    margin-top: 15px;
}

/* --- FOOTER --- */
.site-footer {
    background: #232f3e; /* Dark background */
    color: #ccc;
    padding: 40px 0 80px 0; /* Extra bottom padding for mobile scrolling */
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: left;
}

.footer-col h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.footer-logo {
    font-size: 1.4rem !important;
    color: #fff;
    text-decoration: none;
}

.footer-about {
    line-height: 1.6;
    color: #aaa;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 10px;
}

/* Clean Footer Links (No Blue) */
.footer-links-list a {
    text-decoration: none;
    color: #ccc; /* Light grey */
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-links-list a:hover {
    color: #fff; /* White on hover */
    text-decoration: underline;
}

.footer-bottom-bar {
    text-align: center;
    font-size: 0.85rem;
    color: #777;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .footer-grid {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    .header-search-input {
        width: 80px; 
    }
    .header-search-input:focus {
        width: 120px;
    }
}