/*
 * Devicel Layout Stylesheet
 * Header, Footer, Navigation
 * Version: 1.0.0
 */

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg-white);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-5);
}

/* Logo */
.logo {
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    transition: transform var(--transition-base);
}

.logo:hover img {
    transform: scale(1.02);
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: 44px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search input:hover {
    border-color: var(--border-dark);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.header-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Search Dropdown Results */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-dropdown-item:hover {
    background: var(--bg-light);
}

.search-dropdown-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.search-dropdown-item-info h4 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    margin-bottom: 2px;
}

.search-dropdown-item-info span {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav a,
.nav-link-btn {
    color: var(--text-muted);
    font-weight: var(--font-medium);
    font-size: var(--font-size-base);
    transition: color var(--transition-base);
    white-space: nowrap;
}

.nav a:hover,
.nav-link-btn:hover {
    color: var(--primary);
}

.nav-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* User Greeting */
.user-greeting {
    color: var(--primary);
    font-weight: var(--font-medium);
    font-size: var(--font-size-base);
}

/* CTA Button */
.nav-cta {
    background: var(--primary-gradient);
    color: var(--text-white) !important;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    transition: all var(--transition-base);
}

.nav-cta:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
}

/* Cart Icon */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.cart-icon:hover {
    background: var(--bg-light);
}

.cart-icon svg {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: var(--font-bold);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-white);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle:hover {
    background: var(--bg-light);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background var(--transition-base);
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition-base);
}

.mobile-menu-toggle span::before {
    top: -6px;
}

.mobile-menu-toggle span::after {
    bottom: -6px;
}

/* ========================================
   Main Content Area
   ======================================== */
main {
    min-height: calc(100vh - 200px);
    padding: var(--space-10) 0;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: var(--space-12) 0 var(--space-6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-8);
}

/* Footer Brand */
.footer-brand {
    max-width: 280px;
}

.footer-brand img {
    height: 36px;
    margin-bottom: var(--space-4);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* Footer Columns */
.footer-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-5);
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a,
.footer-links li {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Footer Contact */
.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

/* Footer Newsletter Section */
.footer-newsletter {
    margin-bottom: var(--space-8);
}

/* Footer Bottom */
.footer-bottom {
    text-align: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin-top: var(--space-3);
}

.footer-bottom-links a {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* ========================================
   Pagination (Livewire)
   ======================================== */
.pagination-wrapper {
    margin-top: var(--space-10);
}

nav[role="navigation"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

nav[role="navigation"] .flex.justify-between {
    display: none;
}

nav[role="navigation"] span.relative,
nav[role="navigation"] a.relative {
    display: none;
}

nav[role="navigation"] .flex.flex-wrap,
nav[role="navigation"] > div:last-child > span {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

nav[role="navigation"] span[aria-current="page"] span,
nav[role="navigation"] a[rel] {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-medium);
    transition: all var(--transition-base);
}

nav[role="navigation"] span[aria-current="page"] span {
    background: var(--primary-gradient);
    color: var(--text-white);
}

nav[role="navigation"] a[rel] {
    background: var(--bg-white);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

nav[role="navigation"] a[rel]:hover {
    border-color: var(--primary);
    color: var(--primary);
}

nav[role="navigation"] .text-sm {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

[wire\:key^="paginator"] nav > div:first-child {
    margin-bottom: var(--space-2);
}

.pagination-wrapper nav > div:first-child p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    
    .nav {
        gap: var(--space-4);
    }
    
    .nav a:not(.nav-cta):not(.cart-icon) {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    main {
        padding: var(--space-6) 0;
    }
    
    .footer {
        padding: var(--space-8) 0 var(--space-6);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
}

@media (max-width: 480px) {
    .header-inner {
        gap: var(--space-3);
    }
    
    .logo img {
        height: 32px;
    }
    
    .nav-cta {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: var(--space-2);
    }
}
/* ========================================
   Mobile Menu Styles
   Add this to the END of layout.css
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: var(--space-2);
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: var(--bg-light);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background var(--transition-base);
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition-base);
}

.mobile-menu-toggle span::before {
    top: -7px;
}

.mobile-menu-toggle span::after {
    bottom: -7px;
}

/* Active state - X icon */
.mobile-menu-toggle.active span {
    background: transparent;
}

.mobile-menu-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile Menu Panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    z-index: 99;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-inner {
    padding: var(--space-5);
}

.mobile-search {
    margin-bottom: var(--space-5);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.mobile-nav a,
.mobile-nav-btn {
    display: block;
    padding: var(--space-4);
    font-size: var(--font-size-lg);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.mobile-nav-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav .btn {
    margin-top: var(--space-4);
    text-align: center;
}

/* Body scroll lock when menu open */
body.menu-open {
    overflow: hidden;
}

/* Nav logout form */
.nav-logout-form {
    display: inline;
}

/* Responsive - Show mobile menu */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .nav {
        display: none;
    }
    
    .header-search {
        display: none;
    }
    
    /* Show only cart in header on mobile */
    .nav {
        display: flex;
        gap: var(--space-2);
    }
    
    .nav > a:not(.cart-icon),
    .nav > .user-greeting,
    .nav > .nav-logout-form,
    .nav > form {
        display: none;
    }
    
    .nav .nav-cta {
        display: none;
    }
}

/* Tablet - Adjust header */
@media (max-width: 1024px) {
    .header-search {
        max-width: 280px;
    }
    
    .nav {
        gap: var(--space-4);
    }
    
    .nav a {
        font-size: var(--font-size-sm);
    }
}
/* ========================================
   Mobile Menu Styles
   Add this to the END of layout.css
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: var(--space-2);
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: var(--bg-light);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background var(--transition-base);
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition-base);
}

.mobile-menu-toggle span::before {
    top: -7px;
}

.mobile-menu-toggle span::after {
    bottom: -7px;
}

/* Active state - X icon */
.mobile-menu-toggle.active span {
    background: transparent;
}

.mobile-menu-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile Menu Panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    z-index: 99;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-inner {
    padding: var(--space-5);
}

.mobile-search {
    margin-bottom: var(--space-5);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.mobile-nav a,
.mobile-nav-btn {
    display: block;
    padding: var(--space-4);
    font-size: var(--font-size-lg);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.mobile-nav-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav .btn {
    margin-top: var(--space-4);
    text-align: center;
}

/* Body scroll lock when menu open */
body.menu-open {
    overflow: hidden;
}

/* Nav logout form */
.nav-logout-form {
    display: inline;
}

/* Responsive - Show mobile menu */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .nav {
        display: none;
    }
    
    .header-search {
        display: none;
    }
    
    /* Show only cart in header on mobile */
    .nav {
        display: flex;
        gap: var(--space-2);
    }
    
    .nav > a:not(.cart-icon),
    .nav > .user-greeting,
    .nav > .nav-logout-form,
    .nav > form {
        display: none;
    }
    
    .nav .nav-cta {
        display: none;
    }
}

/* Tablet - Adjust header */
@media (max-width: 1024px) {
    .header-search {
        max-width: 280px;
    }
    
    .nav {
        gap: var(--space-4);
    }
    
    .nav a {
        font-size: var(--font-size-sm);
    }
}
