/**
 * ==================== Layout Styles ====================
 * Header, Navigation, Hero, Sections, Footer, Grids
 */

/* ==================== Top Bar ==================== */
.top-bar {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 10px 0;
    font-size: 13px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 24px;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.top-bar-item .icon {
    width: 16px;
    height: 16px;
    stroke: var(--color-brand);
}

.top-bar-text {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .top-bar { display: none; }
}

/* ==================== Main Header ==================== */
.main-header {
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

/* ==================== Logo ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    max-width: 180px;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo-img { max-width: 140px; }
}

.logo-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

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

.logo-brand {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.2;
}

.logo-tagline {
    font-size: 11px;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 1024px) {
    .logo-tagline { display: none; }
}

/* ==================== Desktop Navigation ==================== */
.main-nav { display: none; }

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

.nav-list {
    display: flex;
    gap: 4px;
}

.nav-item { position: relative; }

.nav-link {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-dark);
    transition: color var(--transition-normal);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: var(--color-brand);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.nav-item:hover .nav-link,
.nav-item.active .nav-link {
    color: var(--color-brand);
}

.nav-item:hover .nav-link::after,
.nav-item.active .nav-link::after {
    transform: scaleX(1);
}

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

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

.nav-dropdown a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--color-dark);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-dropdown a:hover {
    background-color: var(--color-lighter);
    color: var(--color-brand);
    border-left-color: var(--color-brand);
    padding-left: 24px;
}

/* Wide dropdown with subcategories */
.nav-dropdown--wide {
    min-width: 260px;
    padding: 8px 0;
}

.nav-dropdown-parent {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-dark);
    display: block;
    padding: 10px 20px 6px;
    border-left: 3px solid transparent;
}

.nav-dropdown-parent:hover {
    background: var(--color-lighter) !important;
    color: var(--color-brand) !important;
    border-left-color: var(--color-brand) !important;
}

.nav-dropdown-child {
    font-size: 12px;
    padding: 4px 20px 4px 32px !important;
    color: #777 !important;
}

.nav-dropdown-child:hover {
    color: var(--color-brand) !important;
    background-color: #fff0f0 !important;
    border-left-color: var(--color-brand) !important;
    padding-left: 36px !important;
}

.nav-dropdown-sep {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==================== Mobile Menu Toggle ==================== */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-dark);
    transition: all var(--transition-normal);
}

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

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

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

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

/* ==================== Mobile Navigation ==================== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-white);
    z-index: 1001;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.mobile-nav.active { right: 0; }

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.mobile-nav-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray);
}

.mobile-nav-close svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.mobile-nav-link {
    display: block;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-dark);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: var(--color-lighter);
    color: var(--color-brand);
    border-left-color: var(--color-brand);
}

.mobile-nav-link-sub {
    font-size: 13px;
    padding: 10px 20px 10px 36px;
    color: var(--color-gray);
}

.mobile-nav-footer {
    padding: 20px;
    border-top: 1px solid var(--color-border);
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1024px) {
    .mobile-nav,
    .mobile-nav-overlay { display: none; }
}

/* ==================== Main Content ==================== */
.main-content {
    min-height: calc(100vh - var(--header-height));
}

/* ==================== Hero Section ==================== */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('/images/hero-tire.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.9;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.05) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    padding: 60px 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--color-brand);
    color: var(--color-white);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 48px;
    font-weight: 900;
    color: var(--color-white);
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-title span { color: var(--color-brand); }

.hero-desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat { text-align: center; }

.hero-stat-number {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: var(--color-brand);
    line-height: 1;
}

.hero-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

@media (min-width: 768px) {
    .hero { min-height: 700px; }
    .hero-title { font-size: 64px; }
    .hero-desc { font-size: 20px; }
}

@media (min-width: 1024px) {
    .hero-title { font-size: 72px; }
}

@media (max-width: 768px) {
    .hero { padding: 60px 0; }
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 16px; }
    .hero-stats { gap: 24px; }
}

@media (max-width: 480px) {
    .hero { min-height: 400px; padding: 40px 0; }
    .hero-title { font-size: 26px; }
    .hero-desc { font-size: 14px; }
    .hero-stats { gap: 16px; margin-top: 32px; padding-top: 24px; }
    .hero-stat-number { font-size: 28px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
}

@media (max-width: 360px) {
    .hero { min-height: 340px; }
    .hero-title { font-size: 22px; }
    .hero-stats { flex-wrap: wrap; justify-content: center; }
}

/* ==================== Section Spacing ==================== */
.featured-section,
.categories-section {
    padding: 80px 0;
}

.featured-section { background-color: var(--color-lighter); }
.categories-section { background-color: var(--color-white); }

/* ==================== Categories Grid ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}

@media (min-width: 640px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin: 0 auto; }
}

@media (min-width: 1024px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); max-width: 800px; margin: 0 auto; }
}

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: flex-end;
    padding: 24px;
}

.category-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow);
}

.category-card:hover .category-bg {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
}

.category-content {
    position: relative;
    z-index: 1;
}

.category-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 8px;
}

.category-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.category-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ==================== Advantages Section ==================== */
.advantages-section {
    padding: 80px 0;
    background-color: var(--color-dark);
    color: var(--color-white);
}

.advantages-section .section-title { color: var(--color-white); }
.advantages-section .section-subtitle { color: rgba(255, 255, 255, 0.7); }

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 32px;
}

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

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

/* ==================== Footer ==================== */
.main-footer {
    background-color: var(--color-dark);
    color: var(--color-white);
}

/* Footer CTA */
.footer-cta {
    background-color: var(--color-brand);
    padding: 48px 0;
}

.footer-cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

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

.footer-cta-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 8px;
}

.footer-cta-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

/* Footer Main */
.footer-main {
    padding: 64px 0 32px;
}

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

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

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-img {
    max-width: 150px;
    height: auto;
    display: block;
}

.footer-logo-icon {
    width: 50px;
    height: 50px;
}

.footer-logo-text {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.footer-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 24px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

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

.footer-links a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--color-brand); }

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.contact-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--color-brand);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

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

.copyright,
.footer-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Footer mobile */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-bottom-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
