/* ============================================================
   K&J Custom Amish Furniture — Shared Styles
   ============================================================ */

/* Google Fonts are loaded in the HTML <head> */

:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #666666;
    --light-gray: #f5f5f5;
    --off-white: #f8f8f8;
    --pure-white: #ffffff;
    --text-dark: #1a1a1a;
    --text-light: #6b6b6b;
    --text-muted: #9a9a9a;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.2);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--pure-white);
    overflow-x: hidden;
}

::selection { background: var(--primary-color); color: var(--pure-white); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--light-gray); }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

a { text-decoration: none; color: inherit; }

/* ============================================================
   HEADER
   ============================================================ */
header {
    background: var(--pure-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s var(--transition-smooth);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.header-top {
    background: var(--primary-color);
    color: var(--pure-white);
    padding: 10px 0;
    font-size: 0.85rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
    font-weight: 400;
}

.contact-info span,
.contact-info a {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
    transition: opacity 0.3s;
    color: var(--pure-white);
    text-decoration: none;
}

.contact-info span:hover,
.contact-info a:hover { opacity: 1; }

.header-top-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.header-top-logo:hover { opacity: 0.85; }

.social-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-links a {
    color: var(--pure-white);
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s var(--transition-smooth);
    text-decoration: none;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* User Account Dropdown */
.user-account-dropdown {
    position: relative;
    display: none;
    margin-right: 15px;
}

.user-account-dropdown.show { display: inline-block; }

.user-account-trigger {
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.user-account-trigger:hover { background: rgba(255,255,255,0.25); }

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--pure-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--transition-smooth);
    z-index: 10000;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.user-account-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
}
.user-dropdown-menu a:hover { background: var(--off-white); }
.user-dropdown-menu a i { width: 16px; text-align: center; color: var(--accent-color); }
.user-dropdown-menu .divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* Navigation */
.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0.75rem;
    background: var(--pure-white);
    transition: all 0.4s var(--transition-smooth);
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
}

.nav-menu > li > a {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.75rem;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s var(--transition-smooth);
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.4s var(--transition-smooth);
}

.nav-menu a:hover { color: var(--primary-color); }
.nav-menu a:hover::after { width: 100%; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown > a { display: flex; align-items: center; gap: 6px; }

.dropdown-icon {
    font-size: 0.65rem;
    transition: transform 0.3s var(--transition-smooth);
}
.dropdown:hover .dropdown-icon { transform: rotate(180deg); }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--pure-white);
    min-width: 650px;
    border-radius: 16px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-dark);
}
.dropdown-menu a::after { display: none; }
.dropdown-menu a:hover { background: var(--off-white); color: var(--primary-color); }
.dropdown-menu a i { color: var(--accent-color); width: 20px; text-align: center; font-size: 0.9rem; }

/* Mega-menu for navigation tabs */
.mega-dropdown { position: relative; }
.mega-dropdown > a { display: flex; align-items: center; gap: 4px; }
.mega-dropdown-menu {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--pure-white); white-space: nowrap;
    border-radius: 16px; padding: 24px 28px;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color); display: flex; flex-direction: row; flex-wrap: nowrap; gap: 32px; z-index: 1000;
}
.mega-dropdown:hover .mega-dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-group-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: var(--text-muted);
    margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border-color);
}
.mega-group-types { display: flex; flex-direction: column; gap: 2px; }
.mega-group-types a {
    display: block; padding: 7px 14px; font-size: 0.85rem;
    border-radius: 6px; color: var(--text-dark); text-decoration: none; transition: background 0.15s;
}
.mega-group-types a::after { display: none; }
.mega-group-types a:hover { background: var(--off-white); color: var(--primary-color); }

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 12px;
    padding-right: 36px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.85rem;
    width: 180px;
    transition: all 0.3s var(--transition-smooth);
    outline: none;
    font-family: 'Lato', sans-serif;
    background: var(--light-gray);
}

.search-box input:focus {
    border-color: var(--primary-color);
    width: 220px;
    background: var(--pure-white);
}

.search-box i {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.3s;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.cart-icon:hover { transform: scale(1.1); }

.cart-count {
    position: absolute;
    top: 0;
    right: -2px;
    background: var(--primary-color);
    color: var(--pure-white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pure-white);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--primary-color);
    color: var(--pure-white);
    padding: 4rem 0 0;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-logo img {
    height: 50px;
    filter: brightness(0) invert(1);
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.footer-social a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.footer-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    position: relative;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background: rgba(255,255,255,0.3);
}

.footer-section ul { list-style: none; }

.footer-section ul li { margin-bottom: 0.6rem; }

.footer-section ul a,
.footer-section ul span {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section ul a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

.footer-bottom p + p { margin-top: 0.3rem; }

/* ============================================================
   RESPONSIVE — HEADER / FOOTER
   ============================================================ */
@media (max-width: 1024px) {
    .dropdown-menu {
        min-width: 400px;
        grid-template-columns: repeat(2, 1fr);
    }
    .mega-dropdown-menu { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .contact-info { display: none; }

    .header-top .container { justify-content: center; }

    .header-top-logo { font-size: 1rem; }

    .social-links { display: none; }

    .nav-container { padding: 0.4rem 0; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--pure-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        gap: 0;
    }

    .nav-menu.active { display: flex; }

    .nav-menu > li { width: 100%; }
    .nav-menu > li > a {
        display: block;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        display: none;
        min-width: 100%;
        padding: 0 0 0 16px;
        grid-template-columns: 1fr;
        border-radius: 0;
    }

    .dropdown.active .dropdown-menu { display: grid; }

    .mega-dropdown-menu {
        position: static; transform: none; box-shadow: none;
        border: none; display: none; flex-direction: column; padding: 0 0 0 16px;
        border-radius: 0;
    }
    .mega-dropdown.active .mega-dropdown-menu { display: flex; }

    .mobile-menu-toggle { display: block; }

    .search-box input { width: 120px; }
    .search-box input:focus { width: 150px; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .nav-actions { gap: 8px; }
    .search-box { display: none; }
}
