/* 
 * Layout CSS for Header and Footer
 * File path: assets/css/layout.css
 * This handles the core layout elements of the site
 */

/* ==================== RESET & COMMON STYLES ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

main {
  flex: 1;
  padding: 30px 0;
}

a {
  text-decoration: none;
  color: #0066cc;
  transition: color 0.2s;
}

a:hover {
  color: #e6232c;
}

/* ==================== HEADER STYLES ==================== */
/* Top Bar */
.top-bar {
  background-color: #0066cc;
  padding: 8px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-contact a, 
.top-links a {
  color: #fff;
  font-size: 0.85rem;
  margin-right: 15px;
  text-decoration: none;
}

.top-contact a:last-child,
.top-links a:last-child {
  margin-right: 0;
}

.top-contact a i, 
.top-links a i {
  margin-right: 5px;
}

/* Main Header */
.site-header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 15px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Logo */
.site-logo {
  flex: 0 0 auto;
  margin-right: 20px;
}

.site-logo img {
  max-height: 50px;
  width: auto;
  display: block;
}

/* Search */
.header-search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  margin: 0 20px;
}

.search-form {
  display: flex;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 8px 40px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.search-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  color: #0066cc;
  cursor: pointer;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
}

.cart-icon {
  position: relative;
  font-size: 18px;
  color: #333;
  margin-right: 20px;
  display: inline-block;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #e6232c;
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-icon, 
.menu-icon:before, 
.menu-icon:after {
  width: 25px;
  height: 2px;
  background-color: #333;
  position: absolute;
  transition: all 0.3s ease;
}

.menu-icon {
  position: relative;
}

.menu-icon:before {
  content: '';
  top: -7px;
  left: 0;
}

.menu-icon:after {
  content: '';
  top: 7px;
  left: 0;
}

/* Main Navigation */
.main-nav {
  background-color: #0066cc;
  width: 100%;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  color: #fff;
  padding: 12px 15px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-item.has-dropdown:hover .dropdown {
  display: block;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  padding: 0;
  list-style: none;
}

.dropdown li a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  transition: background-color 0.3s;
}

.dropdown li:last-child a {
  border-bottom: none;
}

.dropdown li a:hover {
  background-color: #f5f5f5;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background-color: #fff;
  z-index: 1000;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  overflow-y: auto;
  transition: right 0.3s ease;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.mobile-logo img {
  max-height: 30px;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #333;
}

.mobile-search {
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.mobile-search form {
  display: flex;
}

.mobile-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
}

.mobile-search button {
  padding: 0 12px;
  background-color: #0066cc;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid #eee;
}

.mobile-nav-list li a {
  display: block;
  padding: 12px 15px;
  color: #333;
  text-decoration: none;
}

.mobile-dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.mobile-dropdown-toggle i {
  transition: transform 0.3s;
}

.mobile-dropdown.active .mobile-dropdown-toggle i {
  transform: rotate(180deg);
}

.mobile-dropdown-menu {
  display: none;
  list-style: none;
  padding: 0;
  background-color: #f5f5f5;
}

.mobile-dropdown-menu li a {
  padding-left: 30px;
  font-size: 0.9rem;
}

.mobile-dropdown.active .mobile-dropdown-menu {
  display: block;
}

/* Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}

.menu-overlay.active {
  display: block;
}

/* ==================== FOOTER STYLES ==================== */
.site-footer {
  background-color: #222;
  color: #fff;
  padding: 50px 0 20px;
  margin-top: auto;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.footer-widget {
  min-width: 0; /* Prevents grid blowout */
}

.about-widget p {
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 20px;
}

.footer-logo {
  max-height: 40px;
  margin-bottom: 15px;
  display: block;
}

.widget-title {
  color: #fff;
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.widget-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #e6232c;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 50%;
  transition: all 0.3s;
}

.social-links a:hover {
  background-color: #0066cc;
  transform: translateY(-3px);
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li {
  margin-bottom: 8px;
}

.footer-menu li a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-menu li a:hover {
  color: #fff;
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-info li {
  display: flex;
  margin-bottom: 12px;
  color: #aaa;
}

.contact-info li i {
  margin-right: 10px;
  color: #e6232c;
  width: 16px;
  text-align: center;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.copyright {
  color: #aaa;
  font-size: 14px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  margin-left: 15px;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  background-color: #0066cc;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #e6232c;
  transform: translateY(-3px);
}

/* ==================== RESPONSIVE STYLES ==================== */
@media (max-width: 991px) {
  .header-search {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    margin: 15px 0 0;
    display: none; /* Hide on tablet and mobile */
  }
  
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
  }
  
  .main-nav {
    display: none;
  }
  
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .top-contact {
    margin-bottom: 5px;
  }
  
  .site-logo img {
    max-height: 40px;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .copyright {
    margin-bottom: 10px;
  }
  
  .footer-links a {
    margin: 0 8px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    justify-content: space-between;
  }
  
  .site-logo {
    margin-right: 0;
  }
  
  .site-logo img {
    max-height: 35px;
  }
  
  .cart-icon {
    font-size: 16px;
    margin-right: 15px;
  }
}