/* ================================================================
   LAYOUT.CSS — ستار وير | Star Wear
   Header, footer, mobile nav. Uses sw-* classes exclusively.
   Load order: 3 of 4
   ================================================================ */

/* ===============================================================
   HEADER
   =============================================================== */
.sw-header {
    background: var(--sw-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow var(--sw-transition);
}
.sw-header.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

/* ── Top Bar ─────────────────────────────────────────────────── */
.sw-topbar {
    background: var(--sw-black);
    color: #fff;
    font-size: 12px;
    padding: 6px 0;
}
.sw-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sw-topbar-right,
.sw-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.sw-topbar-right a,
.sw-topbar-left a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 12px;
    transition: color var(--sw-transition);
}
.sw-topbar-right a:hover,
.sw-topbar-left a:hover { color: var(--sw-primary); }

/* ── Main Header Row ─────────────────────────────────────────── */
.sw-main-header {
    background: var(--sw-white);
    padding: 12px 0;
    border-bottom: 1px solid var(--sw-border);
}
.sw-main-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Hamburger ───────────────────────────────────────────────── */
.sw-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px; height: 20px;
    background: none; border: none;
    cursor: pointer; padding: 0;
    flex-shrink: 0;
}
.sw-hamburger span {
    display: block;
    width: 100%; height: 2px;
    background: var(--sw-black);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.sw-hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.sw-hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sw-hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ── Logo ────────────────────────────────────────────────────── */
.sw-logo { flex-shrink: 0; }
.sw-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.sw-logo img {
    height: 50px; width: auto;
    max-width: 160px;
    object-fit: contain;
}
.sw-logo-text {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--sw-primary);
    letter-spacing: -0.5px;
}

/* ── Search ──────────────────────────────────────────────────── */
.sw-search-wrap {
    flex: 1;
    max-width: 600px;
    margin: 0 8px;
}
.sw-search-form {
    display: flex;
    border: 2px solid var(--sw-border);
    border-radius: 50px;
    overflow: hidden;
    height: 44px;
    transition: border-color var(--sw-transition);
}
.sw-search-form:focus-within { border-color: var(--sw-primary); }
.sw-search-input {
    flex: 1; border: none; outline: none;
    font-size: 14px;
    padding: 0 16px;
    font-family: var(--sw-font);
    background: transparent;
    color: var(--sw-black);
    min-width: 0;
}
.sw-search-btn {
    background: var(--sw-primary);
    color: #fff; border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background var(--sw-transition);
    flex-shrink: 0;
}
.sw-search-btn:hover { background: var(--sw-primary-dk); }

/* ── Header Icons ────────────────────────────────────────────── */
.sw-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.sw-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none; border: none;
    cursor: pointer;
    color: var(--sw-black);
    text-decoration: none;
    position: relative;
    padding: 6px 10px;
    border-radius: var(--sw-radius);
    transition: background var(--sw-transition), color var(--sw-transition);
    font-size: 14px;
}
.sw-icon-btn:hover { background: var(--sw-light-gray); color: var(--sw-primary); }
.sw-icon-btn i { font-size: 18px; margin-bottom: 2px; }
.sw-icon-label {
    font-size: 10px;
    font-family: var(--sw-font);
    white-space: nowrap;
}
.sw-cart-badge {
    position: absolute;
    top: 2px; left: 2px;
    background: var(--sw-primary);
    color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
}

/* ── Desktop Nav Bar ─────────────────────────────────────────── */
.sw-nav-bar {
    background: var(--sw-light-gray);
    border-bottom: 1px solid var(--sw-border);
}
.sw-nav-links {
    display: flex;
    list-style: none;
    margin: 0; padding: 0;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sw-nav-links::-webkit-scrollbar { display: none; }
.sw-nav-link {
    display: block;
    padding: 10px 14px;
    color: var(--sw-dark);
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color var(--sw-transition), border-color var(--sw-transition);
}
.sw-nav-link:hover,
.sw-nav-link.active {
    color: var(--sw-primary);
    border-bottom-color: var(--sw-primary);
}

/* ── Responsive Header ───────────────────────────────────────── */
@media (max-width: 991px) {
    .sw-hamburger { display: flex; }
    .sw-nav-bar   { display: none; }
    .sw-topbar    { display: none; }
    .sw-icon-label { display: none; }
    .sw-main-header { padding: 10px 0; }
    .sw-logo img { height: 40px; }
    .sw-icon-btn { padding: 6px 8px; }
}

@media (max-width: 600px) {
    .sw-search-wrap {
        order: 4;
        width: 100%;
        margin: 8px 0 0;
        max-width: 100%;
    }
    .sw-main-header-inner { flex-wrap: wrap; }
    .sw-logo { flex: 1; }
}

/* ===============================================================
   MOBILE SIDE NAV
   =============================================================== */
.sw-mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sw-mob-overlay.active { display: block; opacity: 1; }

.sw-mob-nav {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--sw-white);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.sw-mob-nav.active { right: 0; }

.sw-mob-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--sw-black);
    color: #fff;
    flex-shrink: 0;
}
.sw-mob-logo {
    font-size: 1.2rem; font-weight: 800;
    color: var(--sw-primary);
    letter-spacing: 0.5px;
}
.sw-mob-close {
    background: none; border: none;
    color: #fff; font-size: 1.8rem;
    cursor: pointer; line-height: 1;
    padding: 0 4px;
    transition: color var(--sw-transition);
}
.sw-mob-close:hover { color: var(--sw-primary); }

.sw-mob-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.sw-mob-links { list-style: none; padding: 0; margin: 0; }
.sw-mob-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sw-dark);
    text-decoration: none;
    font-size: 15px; font-weight: 500;
    transition: background var(--sw-transition), color var(--sw-transition);
    border-right: 4px solid transparent;
}
.sw-mob-links li a:hover {
    background: var(--sw-light-gray);
    color: var(--sw-primary);
    border-right-color: var(--sw-primary);
}
.sw-mob-links li a i {
    color: var(--sw-primary);
    width: 18px; text-align: center;
    flex-shrink: 0;
}
.sw-mob-section-title {
    padding: 10px 20px 6px;
    font-size: 11px; font-weight: 700;
    color: var(--sw-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sw-mob-divider {
    height: 1px;
    background: var(--sw-border);
    margin: 8px 16px;
}
.sw-mob-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sw-border);
    background: var(--sw-light-gray);
    flex-shrink: 0;
}
.sw-mob-nav-footer p {
    font-size: 12px;
    color: var(--sw-gray);
    margin-bottom: 8px;
}
.sw-whatsapp-link {
    display: inline-flex;
    align-items: center; gap: 8px;
    background: var(--sw-green);
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px; font-weight: 600;
    transition: opacity var(--sw-transition);
}
.sw-whatsapp-link:hover { opacity: 0.85; }

/* ===============================================================
   FOOTER
   =============================================================== */
.sw-footer {
    background: var(--sw-black);
    color: rgba(255,255,255,0.85);
    padding: 48px 0 0;
    margin-top: 60px;
}

.sw-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.sw-footer-brand .sw-footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--sw-primary);
    margin-bottom: 12px;
    display: block;
}
.sw-footer-brand p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255,255,255,0.65);
    margin-bottom: 16px;
}

.sw-footer-social { display: flex; gap: 12px; }
.sw-footer-social a {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: background var(--sw-transition);
}
.sw-footer-social a:hover { background: var(--sw-primary); }

.sw-footer-col h4 {
    font-size: 14px; font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sw-primary);
    display: inline-block;
}
.sw-footer-col ul { list-style: none; padding: 0; margin: 0; }
.sw-footer-col ul li { margin-bottom: 10px; }
.sw-footer-col ul li a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--sw-transition);
    display: flex; align-items: center; gap: 8px;
}
.sw-footer-col ul li a:hover { color: var(--sw-primary); }
.sw-footer-col ul li a i { color: var(--sw-primary); width: 16px; font-size: 12px; }

.sw-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}
.sw-footer-bottom a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color var(--sw-transition);
}
.sw-footer-bottom a:hover { color: var(--sw-primary); }

@media (max-width: 900px) {
    .sw-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .sw-footer-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
    .sw-footer-social { justify-content: center; }
    .sw-footer-col ul li a { justify-content: center; }
    .sw-whatsapp-link { margin: 16px auto 0 !important; }
    .sw-footer-bottom > div > div:first-child { flex-direction: column; justify-content: center; text-align: center; }
    .sw-footer { margin-top: 40px; }
}
