/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    margin-right: 50px;
}

.logo a {
    text-decoration: none;
}

/* Auth Area - Desktop */
.nav-auth-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.auth-link {
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none !important;
}

/* Desktop: Logout button with red background when logged in */
.mobile-user-info .auth-link:not(.user-name) {
    background: #ef4444;
    color: #fff !important;
    padding: 7px 16px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 500;
    transition: background 0.3s;
}

.mobile-user-info .auth-link:not(.user-name):hover {
    background: #dc2626;
}

.btn-create-account {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-create-account:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

.user-avatar {
    background: #667eea;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-user-info {
    display: flex;
    align-items: center;
}

.auth-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.3);
}

.logo h2 {
    color: #2563eb;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
}

/* Products Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    list-style: none;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 9999;
    border: 1px solid #e2e8f0;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 9px 20px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.dropdown-menu li a:hover {
    background: #eff6ff;
    color: #2563eb;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: 0.3s;
}

/* Cart Icon */
.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #64748b;
    text-decoration: none;
    margin-left: 15px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.cart-icon:hover {
    color: #2563eb;
    background: rgba(37,99,235,0.08);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 55vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
    padding: 80px 20px;
}

.banner-container {
    text-align: center;
    position: relative;
    z-index: 2;
}

.banner-title {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.banner-subtitle {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

.cta-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.cta-button:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Animated Shapes */
.animated-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: float 6s ease-in-out infinite;
}

.shape1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Featured Products */
.featured-products {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #1e293b;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 15px;
}

.add-to-cart {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    font-weight: 500;
}

.add-to-cart:hover {
    background: #1d4ed8;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    color: #f8fafc;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #60a5fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    /* Mobile cart icon */
    .cart-icon {
        margin-left: 8px;
        padding: 4px 6px;
        font-size: 14px;
        margin-right: 8px;
    }

    .cart-icon svg {
        width: 20px;
        height: 20px;
    }

    .cart-count {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        top: -2px;
        right: -2px;
    }

    /* Mobile auth area - fix overlap and overflow */
    .nav-auth-area {
        gap: 8px;
        margin-left: auto;
        margin-right: 10px;
    }

    /* Mobile: remove all underlines from auth links */
    .nav-auth-area a,
    .nav-auth-area .auth-link,
    .mobile-user-info a,
    .mobile-user-info .auth-link {
        text-decoration: none !important;
        border-bottom: none !important;
    }

    /* Mobile: Sign In - no bg, just text */
    .nav-auth-area > .auth-link:first-of-type,
    .nav-auth-area > a.auth-link:first-child {
        background: transparent;
        color: #64748b !important;
        padding: 5px 10px;
    }

    /* Mobile: user name - no bg, just blue text */
    .user-name {
        max-width: 60px !important;
        font-size: 13px;
        background: transparent !important;
        color: #2563eb !important;
        padding: 0 !important;
    }

    /* Mobile: Logout (logged in) - red background */
    .mobile-user-info .auth-link:not(.user-name) {
        background: #ef4444 !important;
        color: #fff !important;
        padding: 6px 10px;
        border-radius: 5px;
    }

    .btn-create-account {
        padding: 5px 12px !important;
        font-size: 12px !important;
        border-radius: 4px;
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: #fff !important;
    }

    .user-name {
        max-width: 60px !important;
        font-size: 13px;
    }

    .user-avatar {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .mobile-user-info a {
        font-size: 13px;
    }

    .logo h2 {
        font-size: 18px;
    }

    .nav-container {
        height: 60px;
        padding: 0 12px;
    }

    .header {
        z-index: 1001;
    }

    /* Ensure nav doesn't overflow on small screens */
    .nav-auth-area > * {
        flex-shrink: 0;
    }

    .banner-title {
        font-size: 2.5rem;
    }

    .banner-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo {
        margin-right: 10px;
    }

    .logo h2 {
        font-size: 16px;
    }

    /* Fix mobile user info overflow - smaller font, truncated name */
    .mobile-user-info {
        gap: 4px !important;
    }

    /* Mobile: remove all underlines from auth links */
    .nav-auth-area a,
    .nav-auth-area .auth-link,
    .mobile-user-info a,
    .mobile-user-info .auth-link {
        text-decoration: none !important;
        border-bottom: none !important;
    }

    /* Mobile: Sign In - no bg, just text */
    .nav-auth-area > a.auth-link:first-of-type,
    .nav-auth-area > .auth-link:first-child {
        background: transparent;
        color: #64748b !important;
        padding: 5px 8px;
    }

    .mobile-user-info .user-name {
        max-width: 50px !important;
        font-size: 11px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block !important;
        background: transparent !important;
        color: #2563eb !important;
        padding: 0 !important;
    }

    /* Mobile: Logout (logged in) - red background */
    .mobile-user-info .auth-link:not(.user-name) {
        font-size: 11px !important;
        padding: 4px 8px !important;
        text-decoration: none !important;
        border-bottom: none !important;
        background: #ef4444 !important;
        color: #fff !important;
        border-radius: 4px;
    }

    /* Hide user avatar (circle letter) on mobile */
    .mobile-user-info .user-avatar {
        display: none !important;
    }

    .auth-sep {
        display: none;
    }

    /* Space between auth area and hamburger */
    .nav-auth-area {
        gap: 4px;
        margin-right: 8px;
    }

    .btn-create-account {
        padding: 4px 8px !important;
        font-size: 10px !important;
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: #fff !important;
    }

    .nav-container {
        height: 56px;
        padding: 0 10px;
    }

    /* Small mobile cart icon */
    .cart-icon {
        margin-left: 4px;
        padding: 3px 4px;
        margin-right: 5px;
    }

    .cart-icon svg {
        width: 18px;
        height: 18px;
    }

    .nav-menu {
        top: 56px;
    }

    .banner-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* Mobile footer: only show email and copyright */
    .footer-about,
    .footer-links,
    .footer-service {
        display: none !important;
    }

    .footer-contact h4 {
        display: none;
    }

    .footer-contact p:not(.footer-email) {
        display: none !important;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom {
        margin-top: 15px !important;
        padding-top: 15px !important;
    }

    .footer-bottom p {
        font-size: 12px;
    }
}