/* Ensure content sits below fixed header */
body {
    margin: 0; /* remove the default 8px margin (showed as a white edge around the footer) */
    padding-top: 95px; /* announcement bar (~40px) + navbar (~70px) */
}

/* Shared layout container used by the injected header (announcement bar) and footer,
   plus most content pages. Defined globally so body-level partials are always
   centered/padded (pages may still override it in their own <style>). */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Announcement Bar */
.announcement-bar {
    background: #162950;
    color: #E93713;
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
    font-size: 0.9rem;
    position: fixed;   /* stays at top */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002;  /* above navbar */
}

/* Navigation Header */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 40px;      /* below announcement bar (approx height) */
    left: 0;
    width: 100%;
    z-index: 1001;  /* below announcement bar */
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.98);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo img {
    height: 44px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-menu li a {
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 9px 13px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}
.nav-menu li a:hover {
    color: #008080;
    background: rgba(0, 128, 128, 0.1);
}

.nav-menu li a.active {
    color: #008080;
    background: rgba(0, 128, 128, 0.15);
}

/* Cart Icon */
.nav-cart {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s ease;
    color: #333;
    margin-left: 20px;
}

.nav-cart:hover {
    background: rgba(0, 128, 128, 0.1);
    color: #008080;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 4px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.cart-badge.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal.active {
    opacity: 1;
    visibility: visible;
}

.cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.cart-content {
    position: absolute;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
}

.cart-modal.active .cart-content {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-header h3 {
    margin: 0;
    color: #008080;
    font-size: 1.3rem;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart-close:hover {
    background: #e0e0e0;
    color: #333;
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 50px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 64px;
    height: 64px;
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.cart-item-subtotal {
    color: #888;
    font-weight: 500;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.cart-item-variant {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 6px;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #008080;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.quantity-display {
    width: 35px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 0;
    background: white;
}

/* The cart quantity field is an <input> sitting inside .quantity-control; strip
   its native chrome so it blends into the bordered stepper. */
input.quantity-display {
    border: none;
    outline: none;
    color: #333;
    -moz-appearance: textfield;
    appearance: textfield;
}

input.quantity-display::-webkit-outer-spin-button,
input.quantity-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
    margin-left: 8px;
    transition: color 0.3s ease;
}

.remove-item:hover {
    color: #c0392b;
}

/* Stock-limit alarm inside the cart drawer */
.cart-stock-notice {
    margin: 0 20px 14px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff3cd;
    color: #8a6420;
    border: 1px solid #ffe69c;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.cart-stock-notice.is-flash {
    animation: cartShake 0.4s ease;
}

@keyframes cartShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-total {
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    color: #333;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #008080, #87CEEB);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 128, 128, 0.3);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #008080;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-close-item {
  display: none;
}


/* Mobile Menu */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        position: absolute;
        right: 60px; /* Make room for cart icon */
    }

    .nav-cart {
        position: absolute;
        right: 20px;
        margin-left: 0;
    }

    .nav-logo {
        position: static;
        margin: 0 auto;
    }

    .nav-menu {
        position: fixed;
        top: 0; /* Start from the very top */
        right: 0;
        width: 350px; /* Reasonable menu width */
        max-width: 100vw;
        height: 100vh; /* Full viewport height */
        background: white;
        flex-direction: column;
        padding: 95px 20px 30px 20px; /* Top padding to account for navbar */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s ease, visibility 0s linear 0.3s;
        gap: 0;
        margin: 0;
        z-index: 1500; /* Above navbar but below cart modal */
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.3s ease;
    }

    .nav-menu li {
        margin: 10px 0;
    }

    .nav-menu li a {
        display: block;
        padding: 15px 20px;
        border-radius: 10px;
        font-size: 1.1rem;
        border: 1px solid transparent;
    }

    .nav-menu li a:hover {
        border-color: rgba(0, 128, 128, 0.3);
    }

 /* 3) Show & style the close button on mobile */
    .nav-close-item {
        display: block;           /* override desktop hide */
        position: absolute;
        top: 16px;
        right: 16px;
        list-style: none;
    }
    .nav-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #008080;
        color: white;
        font-size: 1.5rem;
        font-weight: bold;
        border: none;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease;
    }
    .nav-close-btn:hover {
        background: #006666;
        transform: scale(1.1);
    }
    .nav-close-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0,128,128,0.5);
    }
    .nav-logo img {
        height: 45px;
    }

    /* Mobile cart modal */
    .cart-content {
        width: 100vw;
        right: -100vw;
    }

    .cart-modal.active .cart-content {
        right: 0;
    }

    /* Mobile nav actions */
    .nav-actions {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        gap: 10px;
    }

    .nav-login-btn {
        display: none;
    }

    .nav-cart {
        position: static;
        right: auto;
    }
}

/* Footer Section */
.footer {
    background: #162950;
    color: white;
    padding: 60px 0 30px 0;
}

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

.footer-left h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #87CEEB;
}

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

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

.footer-left ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-left ul li a:hover {
    color: #87CEEB;
}

.footer-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-info h4 {
    color: #87CEEB;
    margin-bottom: 15px;
}

.contact-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.directions-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #008080;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.directions-btn:hover {
    background: #006666;
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
    height: 200px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #334d6d;
    color: #87CEEB;
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .footer-content,
    .footer-right {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .nav-container {
        padding: 0 15px;
    }
}

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

    .nav-container {
        padding: 0 15px;
    }
}

/* Login Button and Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.nav-login-btn {
    background: #008080;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.nav-login-btn:hover {
    background: #006666;
}

.nav-login-btn.logged-in {
    background: #008080;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-modal.active {
    display: flex;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.auth-card {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2501;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.auth-close:hover {
    color: #333;
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.auth-tab {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    padding: 10px 0;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: #008080;
    border-bottom-color: #008080;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #7a7a7a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.password-toggle:hover,
.password-toggle:focus {
    color: #008080;
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.password-toggle-icon-hide {
    display: none;
}

.password-toggle.is-revealed .password-toggle-icon-show {
    display: none;
}

.password-toggle.is-revealed .password-toggle-icon-hide {
    display: block;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #008080;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #008080, #20b2aa);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 128, 128, 0.3);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.auth-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
    font-size: 0.9rem;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-note {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* "Purchase ID" inline link inside the auth note */
.auth-link {
    color: #008080;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.auth-link:hover { color: #006666; }

/* Purchase ID entry card (swaps in for the login view) */
.auth-back {
    background: none;
    border: none;
    color: #008080;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 14px;
}
.auth-back:hover { color: #006666; }

.auth-purchase-title {
    color: #008080;
    font-size: 1.4rem;
    margin: 0 0 6px;
}
.auth-purchase-sub {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 20px;
}

.auth-toggle {
    color: #008080;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.auth-toggle:hover {
    color: #006666;
}

/* User Menu (for logged-in state) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Responsive auth modal */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .nav-actions {
        gap: 10px;
    }

    .nav-login-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Sign-up password requirements — popover bubble shown while the field is focused */
.form-group {
    position: relative;
}

.password-criteria {
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
    display: grid;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    pointer-events: none;
}

.form-group:focus-within > .password-criteria {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.password-criteria::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 22px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid #e6e6e6;
    border-top: 1px solid #e6e6e6;
    transform: rotate(45deg);
}

.password-criteria li {
    position: relative;
    padding-left: 24px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #8a8f98;
    transition: color 0.2s ease;
}

.password-criteria li::before {
    content: "○";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
    color: #c2c6cc;
}

.password-criteria li.met {
    color: #1f9d57;
}

.password-criteria li.met::before {
    content: "✓";
    color: #1f9d57;
    font-weight: 700;
}

/* Calm page entrance — content sections fade/rise in on load. The navbar is
   excluded because it lives in #header-placeholder (not a <section>), so its
   fixed positioning is unaffected. */
@keyframes pamcaSectionIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

section {
    animation: pamcaSectionIn 0.55s ease both;
}
section:nth-of-type(2) { animation-delay: 0.07s; }
section:nth-of-type(3) { animation-delay: 0.14s; }
section:nth-of-type(4) { animation-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
    section { animation: none; }
}
