/**
 * AstroShala - Header & Footer Styles
 * Included in style.css but separated for clarity
 */

/* ============================================
   HEADER
   ============================================ */

.as-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.25rem 0;
    transition: all 0.5s ease;
    background: transparent;
}

.as-header-scrolled {
    background: rgba(14, 18, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    padding: 0.75rem 0;
}

.as-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.as-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--as-text);
}

.as-logo:hover {
    color: var(--as-text);
}

.as-logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--as-gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--as-shadow-gold);
    transition: transform 0.3s ease;
}

.as-logo:hover .as-logo-icon {
    transform: scale(1.05);
}

.as-logo-icon span {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0E1219;
    font-family: var(--as-font-heading);
}

.as-logo-text {
    display: flex;
    flex-direction: column;
}

.as-logo-name {
    font-family: var(--as-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
}

.as-logo-tagline {
    font-size: 0.6875rem;
    color: var(--as-gold);
    font-weight: 500;
    letter-spacing: 0.05em;
}

@media (max-width: 639px) {
    .as-logo-text { display: none; }
}

/* Desktop Nav */
.as-nav-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .as-nav-desktop { display: block; }
}

.as-nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
}

.as-nav-links li {
    margin: 0;
    position: relative;
}

.as-nav-links li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--as-text-muted);
    border-radius: var(--as-radius);
    transition: all 0.3s ease;
    text-decoration: none;
}

.as-nav-links li a:hover,
.as-nav-links li.current-menu-item a,
.as-nav-links li.current_page_item a {
    color: var(--as-gold);
    background: rgba(201, 168, 76, 0.08);
}

/* Sub-menu */
.as-nav-links li .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--as-bg-card);
    border: 1px solid var(--as-border-subtle);
    border-radius: var(--as-radius);
    padding: 0.5rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s ease;
    list-style: none;
    z-index: 9999;
    box-shadow: var(--as-shadow-elevated);
}

.as-nav-links li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.as-nav-links li .sub-menu li a {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--as-text-muted);
    border-radius: var(--as-radius);
}

.as-nav-links li .sub-menu li a:hover {
    color: var(--as-gold);
    background: rgba(201, 168, 76, 0.1);
}

/* Header Actions */
.as-header-actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .as-header-actions { display: flex; }
}

.as-header-icon {
    position: relative;
    padding: 0.5rem;
    color: var(--as-text-muted);
    transition: color 0.3s ease;
    text-decoration: none;
}

.as-header-icon:hover {
    color: var(--as-gold);
}

.as-cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--as-gold);
    color: #0E1219;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-btn-header {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Mobile Toggle */
.as-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

@media (min-width: 1024px) {
    .as-mobile-toggle { display: none; }
}

.as-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--as-text);
    transition: all 0.3s ease;
    border-radius: 1px;
}

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

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

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

/* Mobile Menu - Full Screen Left Drawer */
.as-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 14, 20, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
    visibility: hidden;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* Hide bottom nav when drawer is open */
body.as-menu-open .as-bottom-nav {
    display: none !important;
}

/* Overlay behind drawer */
.as-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.as-mobile-overlay.as-open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Header with logo + close */
.as-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
}

.as-drawer-header .as-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.as-drawer-header .as-logo img {
    height: 40px;
    width: auto;
}

.as-drawer-close {
    background: none;
    border: none;
    color: var(--as-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    line-height: 0;
}

.as-drawer-close:hover {
    color: var(--as-gold);
}

.as-drawer-close svg {
    width: 24px;
    height: 24px;
}

/* Scrollable nav area */
.as-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0;
}

.as-mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.as-mobile-nav-links li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.as-mobile-nav-links > li > a,
.as-mobile-nav-links > li > .as-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.05rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--as-text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.as-mobile-nav-links > li > a:hover,
.as-mobile-nav-links > li > .as-submenu-toggle:hover,
.as-mobile-nav-links > li.current-menu-item > a,
.as-mobile-nav-links > li.current_page_item > a {
    color: var(--as-gold);
    background: rgba(201, 168, 76, 0.06);
}

/* Submenu toggle arrow */
.as-submenu-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: var(--as-text-muted);
    opacity: 0.5;
}

.as-submenu-open > .as-submenu-toggle .as-submenu-arrow {
    transform: rotate(180deg);
    color: var(--as-gold);
    opacity: 1;
}

/* Mobile sub-menu - collapsed by default */
.as-mobile-nav-links .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.as-submenu-open > .sub-menu {
    max-height: 500px;
}

.as-mobile-nav-links .sub-menu li {
    border-bottom: none;
}

.as-mobile-nav-links .sub-menu li a {
    display: block;
    font-size: 0.8125rem;
    padding: 0.625rem 1.25rem 0.625rem 2.5rem;
    color: var(--as-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.as-mobile-nav-links .sub-menu li a::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--as-border-subtle);
    transition: background 0.2s ease;
}

.as-mobile-nav-links .sub-menu li a:hover {
    color: var(--as-gold);
    background: rgba(201, 168, 76, 0.06);
}

.as-mobile-nav-links .sub-menu li a:hover::before {
    background: var(--as-gold);
}

/* Drawer footer CTA */
.as-mobile-cta {
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
}

body.as-menu-open {
    overflow: hidden;
}


/* ============================================
   FOOTER
   ============================================ */

.as-footer {
    background: var(--as-bg-secondary);
    border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.as-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4rem 0;
}

@media (min-width: 768px) {
    .as-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .as-footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}

.as-footer-col h4 {
    font-family: var(--as-font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--as-text);
    margin-bottom: 1.5rem;
}

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

.as-footer-links li {
    margin-bottom: 0.75rem;
}

.as-footer-links li a {
    color: var(--as-text-muted);
    font-size: 0.875rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.as-footer-links li a:hover {
    color: var(--as-gold);
}

.as-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.as-footer-contact a,
.as-footer-contact span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--as-text-muted);
    font-size: 0.875rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.as-footer-contact a:hover {
    color: var(--as-gold);
}

.as-footer-contact svg {
    color: var(--as-gold);
    flex-shrink: 0;
}

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

.as-footer-trust li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--as-text-muted);
    font-size: 0.875rem;
}

.as-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--as-gold);
    margin-top: 0.5rem;
    flex-shrink: 0;
}

/* Footer Bottom */
.as-footer-bottom {
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    padding: 1.5rem 0;
}

.as-footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .as-footer-bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.as-footer-bottom p {
    color: var(--as-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.as-footer-legal {
    display: flex;
    gap: 1.5rem;
}

.as-footer-legal a {
    color: var(--as-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.as-footer-legal a:hover {
    color: var(--as-gold);
}


/* ============================================
   WHATSAPP FLOAT BUTTON
   ============================================ */

.as-whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

/* Push WhatsApp button up on mobile/tablet when bottom nav is visible */
@media (max-width: 1023px) {
    .as-whatsapp-float {
        bottom: 5rem;
    }
}

.as-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.4);
}


/* ============================================
   STICKY BOTTOM NAVIGATION (Mobile/Tablet)
   ============================================ */

.as-bottom-nav {
    display: none;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    background: var(--as-bg-card) !important;
    border-top: 1px solid var(--as-border-subtle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    width: 100% !important;
    max-width: 100vw !important;
}

@media (max-width: 1023px) {
    .as-bottom-nav {
        display: flex;
    }
}

.as-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.375rem 0.25rem;
    color: var(--as-text-muted);
    text-decoration: none !important;
    font-size: 0.6rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    min-width: 0;
    flex: 1 1 0%;
    max-width: 20%;
    text-align: center;
    line-height: 1.2;
}

.as-bottom-nav-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.as-bottom-nav-item svg {
    flex-shrink: 0;
}

.as-bottom-nav-item:hover,
.as-bottom-nav-item.as-active {
    color: var(--as-gold);
}

.as-bottom-nav-item.as-active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--as-gradient-gold);
    border-radius: 0 0 2px 2px;
}

.as-bottom-nav-badge {
    position: absolute;
    top: 0;
    right: calc(50% - 16px);
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: var(--as-gold);
    color: #0E1219;
    font-size: 9px;
    font-weight: 700;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}


/* ============================================
   LAYOUT HELPERS
   ============================================ */

.as-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .as-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .as-posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.as-card-image {
    overflow: hidden;
    border-radius: var(--as-radius-lg) var(--as-radius-lg) 0 0;
}

.as-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.as-card:hover .as-card-image img {
    transform: scale(1.05);
}

.as-card-content {
    padding: 1.25rem;
}

.as-card-title {
    font-family: var(--as-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.as-card-title a {
    color: var(--as-text);
    text-decoration: none;
}

.as-card-title a:hover {
    color: var(--as-gold);
}

.as-card-meta {
    color: var(--as-text-muted);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.as-card-excerpt {
    color: var(--as-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.as-archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--as-border-subtle);
}

.as-archive-header h1 {
    margin-bottom: 0.5rem;
}

.as-post-header {
    margin-bottom: 2rem;
}

.as-post-meta {
    color: var(--as-text-muted);
    font-size: 0.875rem;
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.as-post-thumbnail {
    margin-bottom: 2rem;
    border-radius: var(--as-radius-lg);
    overflow: hidden;
}

.as-post-thumbnail img {
    width: 100%;
    border-radius: var(--as-radius-lg);
}

.as-no-content {
    text-align: center;
    padding: 4rem 0;
}

.as-no-content h2 {
    margin-bottom: 0.75rem;
}

/* Post Navigation */
.post-navigation {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--as-border-subtle);
}

.post-navigation a {
    color: var(--as-gold);
    text-decoration: none;
    font-size: 0.875rem;
}

.post-navigation a:hover {
    color: var(--as-gold-light);
}
