/* Site-wide layout styles (header, nav, footer). Moved out of _Layout.cshtml so browsers cache them. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f4efe6;
    color: #333;
}

/* Shared Header Styles */
.site-header {
    background-color: #003F24;
    color: white;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    animation: logoFloat 3s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

@keyframes logoFloat {
    0%   { transform: translateY(0px) rotate(0deg); }
    25%  { transform: translateY(-4px) rotate(-2deg); }
    50%  { transform: translateY(-6px) rotate(0deg); }
    75%  { transform: translateY(-4px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.nav-menu {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-menu a i {
    font-size: 18px;
    opacity: 0.9;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-menu a.nav-highlight {
    background-color: rgba(247, 147, 30, 0.18);
    border: 1px solid rgba(247, 147, 30, 0.45);
    color: #ffc46b;
}

.nav-menu a.nav-highlight:hover {
    background-color: rgba(247, 147, 30, 0.3);
}

.nav-menu a.nav-highlight i {
    color: #f7931e;
}

.user-profile {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #003F24;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.cart-badge {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f7931e;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    transition: background-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Container */
.container {
    width: 100%;
    min-height: calc(100vh - 118px);
    background: #f4efe6;
    padding-top: 118px;
}

/* Flash messages (TempData["Error"] / TempData["Success"]) */
.flash-message {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border-left: 4px solid;
}

.flash-error {
    background-color: #FDECEA;
    border-left-color: #C62828;
    color: #8E1B14;
}

.flash-success {
    background-color: #E8F5E9;
    border-left-color: #00694e;
    color: #0a4d35;
}

/* Footer Styles */
.site-footer {
    background-color: #003F24;
    color: white;
    padding: 24px 0 12px;
    margin-top: 40px;
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
    align-items: start;
}

.footer-section h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: white;
    font-size: 20px;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

.footer-store-badge {
    display: inline-flex;
    align-items: center;
}

.footer-store-badge img {
    height: 40px;
    width: auto;
}

/* Mobile Responsiveness */
@media (max-width: 1300px) and (min-width: 769px) {
    .header-container { padding: 0 20px; }
    .nav-menu { gap: 4px; }
    .nav-menu a { font-size: 15px; padding: 8px 10px; gap: 6px; }
    .nav-menu a i { font-size: 15px; }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background-color: #002d1a;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

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

    .nav-menu a {
        width: 100%;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
        font-size: 15px;
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background-color: rgba(255,255,255,0.08);
    }

    .nav-menu a .cart-count {
        position: static;
        margin-left: 4px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .site-footer {
        margin-top: 24px;
        padding: 20px 0 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 22px;
        gap: 10px;
    }
}
