/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Open Sans', Arial, sans-serif; color: #333; font-size: 1rem; line-height: 1.6; font-weight: 400; background: #f5f5f5; }
a { text-decoration: none; color: inherit; transition: color .3s; }
a:hover { color: #0280B5; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 16px; }

/* ===== TOP BAR ===== */
.top-bar { background: #0280B5; color: #fff; font-size: 14px; padding: 6px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-bar a { color: #fff; }
.top-bar a:hover { color: #ffe082; }
.top-bar-left { display: flex; gap: 20px; align-items: center; }
.top-bar-left a { display: flex; align-items: center; gap: 5px; }
.top-bar-left a i { font-size: 14px; }
.top-bar-right { display: flex; gap: 15px; align-items: center; font-size: 12px; }

/* ===== HEADER ===== */
.header { background: #fff; padding: 12px 0; box-shadow: 0 2px 6px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: nowrap; }
.logo { display: flex; align-items: center; flex-shrink: 0; width: 250px; margin-right: 35px; }

/* Search */
.search-box { flex: 1; max-width: 350px; position: relative; }
.search-box input { width: 100%; padding: 10px 45px 10px 15px; border: 2px solid #0b8ad9; border-radius: 4px; font-size: 14px; outline: none; }
.search-box input:focus { border-color: #0967a8; }
.search-box button { position: absolute; right: 0; top: 0; bottom: 0; width: 42px; background: #0b8ad9; border: none; color: #fff; font-size: 16px; cursor: pointer; border-radius: 0 4px 4px 0; }
.search-box button:hover { background: #0967a8; }

/* Hotline */
.hotline-group { display: flex; gap: 20px; flex-wrap: wrap; }
.hotline-item { display: flex; align-items: center; gap: 8px; }
.hotline-item .icon { width: 40px; height: 40px; border-radius: 50%; background: #0b8ad9; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
.hotline-item .info { font-size: 11px; color: #666; line-height: 1.3; }
.hotline-item .info strong { display: block; font-size: 14px; color: #0b8ad9; }

/* ===== MAIN NAV ===== */
.main-nav { background: #0b8ad9; position: relative; z-index: 90; }
.main-nav .container { display: flex; align-items: stretch; }
.category-toggle-wrap { position: relative; }
.category-toggle { background: #0967a8; color: #fff; padding: 16px 20px; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; min-width: 260px; border: none; }
.category-toggle i { font-size: 16px; }
.category-toggle:hover { background: #07578e; }

/* Category Dropdown */
.category-dropdown { display: none; position: absolute; top: 100%; left: 0; width: 260px; background: #fff; border-radius: 0 0 6px 6px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 100; }
.category-toggle-wrap:hover .category-dropdown { display: block; }
.cat-dropdown-item { position: relative; }
.cat-dropdown-item > a { display: flex; align-items: center; gap: 8px; padding: 11px 15px; font-size: 14px; color: #333; border-bottom: 1px solid #f0f0f0; transition: background .2s, color .2s; }
.cat-dropdown-item:last-child > a { border-bottom: none; }
.cat-dropdown-item:hover > a { background: #e8f4fd; color: #0b8ad9; }
.cat-dropdown-item > a i { color: #0b8ad9; font-size: 10px; }
.cat-dropdown-submenu { position: absolute; left: 100%; top: 0; width: 480px; background: #fff; border-radius: 0 6px 6px 0; box-shadow: 0 4px 16px rgba(0,0,0,.15); display: none; z-index: 50; padding: 20px; grid-template-columns: 1fr 1fr; gap: 20px; }
.cat-dropdown-item:hover > .cat-dropdown-submenu { display: grid; }
.nav-menu-desktop { display: flex; align-items: center; gap: 0; flex: 1; }
.nav-menu-desktop a { color: #fff; padding: 12px 18px; font-size: 14px; font-weight: 600; display: block; text-transform: uppercase; transition: background .3s; white-space: nowrap; }
.nav-menu-desktop a:hover { background: rgba(255,255,255,.15); color: #fff; }
/* Mobile slide-in nav (outside main-nav) */
.nav-menu { display: none; }
/* Mobile menu toggle (in header) */
.mobile-menu-toggle { display: none; background: transparent; border: 1px solid #fff; border-radius: 3px; color: #fff; font-size: 20px; width: 40px; height: 35px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.mobile-menu-toggle:hover { background: #03a0e2; color: #fff; }

/* Mobile search */
.search-mobile { display: none; padding: 8px 0; }

/* ===== HERO / BANNER SECTION ===== */
.hero-section { padding: 20px 0; margin-bottom: 10px; }
.hero-grid { display: grid; grid-template-columns: 260px 1fr 300px; grid-template-rows: 1fr; gap: 1rem; align-items: stretch; }

/* Sidebar Categories */
.sidebar-categories { background: #fff; border-radius: 6px; overflow: visible; box-shadow: 0 1px 4px rgba(0,0,0,.1); position: relative; display: flex; flex-direction: column; }
.sidebar-cat-item { position: relative; flex: 1; }
.sidebar-cat-item > a { display: flex; align-items: center; gap: 8px; padding: 11px 15px; font-size: 16px; color: #333; border-bottom: 1px solid #f0f0f0; transition: background .2s, color .2s; height: 100%; }
.sidebar-cat-item:hover > a { background: #e8f4fd; color: #0b8ad9; }
.sidebar-cat-item > a i { color: #0b8ad9; font-size: 10px; }

/* Sidebar Submenu */
.sidebar-submenu { position: absolute; left: 100%; top: 0; width: 480px; background: #fff; border-radius: 0 6px 6px 0; box-shadow: 0 4px 16px rgba(0,0,0,.15); display: none; z-index: 50; padding: 20px; grid-template-columns: 1fr 1fr; gap: 20px; }
.sidebar-cat-item:hover > .sidebar-submenu { display: grid; }
.submenu-col h4 { font-size: 16px; font-weight: 700; color: #0b8ad9; text-transform: uppercase; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #e8f4fd; }
.submenu-col ul { list-style: none; padding: 0; margin: 0; }
.submenu-col ul li a { display: block; padding: 5px 0; font-size: 16px; color: #555; transition: color .2s, padding-left .2s; }
.submenu-col ul li a:hover { color: #0b8ad9; padding-left: 5px; }

/* Banner Slider */
.banner-slider { border-radius: 6px; overflow: hidden; position: relative; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); height: 100%; }
.slider-wrapper { position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.8); border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center; color: #555; }
.slider-btn:hover { background: #fff; color: #0b8ad9; }
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }
.slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.slider-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; transition: background .3s; }
.slider-dots span.active { background: #0b8ad9; }

/* Side Banner */
.side-banners { display: flex; flex-direction: column; gap: 15px; height: 100%; }
.side-banners img { border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.1); width: 100%; flex: 1; min-height: 0; object-fit: cover; }

/* ===== BRAND SECTION ===== */
.brand-section { padding: 26px 0; background: #fff; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { background: #0b8ad9; color: #fff; padding: 10px 30px 10px 20px; font-size: 16px; font-weight: 700; text-transform: uppercase; clip-path: polygon(0 0, 95% 0, 100% 100%, 0 100%); letter-spacing: 1px; }
.section-nav { display: flex; gap: 8px; }
.section-nav button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #ddd; background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: #999; }
.section-nav button:hover { border-color: #0b8ad9; color: #0b8ad9; }
/* brand-item styles moved to _cms.scss (Swiper) */

/* ===== PRODUCT SECTION ===== */
.product-section { padding: 25px 0; }
.product-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; background: #0b8ad9; border-radius: 6px; overflow: hidden; }
.product-section-title { color: #fff; padding: 12px 25px; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.product-tabs { display: flex; gap: 0; }
.product-tabs a { color: rgba(255,255,255,.85); padding: 12px 18px; font-size: 14px; font-weight: 600; transition: background .3s; text-transform: uppercase; }
.product-tabs a:hover, .product-tabs a.active { background: rgba(255,255,255,.2); color: #fff; }
.view-more-btn { color: #fff; padding: 12px 20px; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.view-more-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.product-card { border: 1px solid #eee; background: #fff; border-radius: 2px; overflow: hidden; transition: border-color .3s, transform .2s; padding: 15px; position: relative; }
.product-card:hover { border-color: #03A0E2; }
.product-brand { height: 25px; margin-bottom: 8px; }
.product-brand img { height: 100%; width: auto; }
.product-image { text-align: center; padding: 10px; margin-bottom: 10px; position: relative; }
.product-image img { max-height: 180px; margin: 0 auto; }
.product-badge { position: absolute; top: 5px; left: 5px; display: flex; flex-direction: column; gap: 4px; }
.badge { padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; }
.badge-hp { background: #e0f2f1; color: #00796b; border: 1px solid #b2dfdb; }
.badge-inverter { display: flex; align-items: center; gap: 3px; }
.badge-inverter img { height: 16px; }
.badge-new { background: #f44336; }
.product-name { font-size: 14px; font-weight: 600; color: #333; line-height: 1.4; margin-bottom: 8px; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { font-size: 15px; font-weight: 700; color: #e53935; }
.product-contact { font-size: 14px; color: #0b8ad9; font-style: italic; }

/* ===== NEWS SECTION ===== */
.news-section { padding: 25px 0; }
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.news-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: box-shadow .3s; }
.news-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,.12); }
.news-image { width: 100%; height: 180px; overflow: hidden; }
.news-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-image img { transform: scale(1.05); }
.news-body { padding: 15px; }
.news-date { font-size: 12px; color: #999; margin-bottom: 8px; }
.news-title { font-size: 14px; font-weight: 600; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-title:hover { color: #0b8ad9; }

/* ===== CERTIFICATES SECTION ===== */
.certificates-section { padding: 25px 0; }
.cert-subtitle { color: #666; font-size: 14px; margin-bottom: 20px; }
.certificates-section .cert-swiper { overflow: hidden; }
.certificates-section .cert-swiper .swiper-slide { height: auto; }
.cert-item { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 10px; text-align: center; }
.cert-item img { width: 100%; height: 200px; object-fit: contain; }

/* ===== FOOTER ===== */
.footer { background: #333; color: #ccc; padding: 40px 0 0; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: 30px; }
.footer-col h3 { color: #fff; font-size: 16px; margin-bottom: 15px; text-transform: uppercase; position: relative; }
.footer-col p, .footer-col a { font-size: 14px; color: #aaa; line-height: 1.8; }
.footer-col a:hover { color: #0b8ad9; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { display: flex; align-items: center; gap: 5px; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.footer-contact-item i { color: #0b8ad9; margin-top: 4px; flex-shrink: 0; }
.footer-social { display: flex; gap: 15px; margin-top: 10px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; background: #444; display: flex; align-items: center; justify-content: center; color: #fff; transition: background .3s; }
.footer-social a:hover { background: #0b8ad9; }
.footer-bottom { border-top: 1px solid #444; padding: 15px 0; margin-top: 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #888; }

/* ===== FLOATING BUTTONS ===== */
.floating-buttons { position: fixed; left: 15px; bottom: 80px; display: flex; flex-direction: column; gap: 10px; z-index: 999; }
.float-btn { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; box-shadow: 0 3px 10px rgba(0,0,0,.25); transition: transform .3s; cursor: pointer; }
.float-btn:hover { transform: scale(1.1); color: #fff; }
.float-btn.facebook { background: #1877f2; }
.float-btn.zalo { background: #0068ff; }
.float-btn.phone { background: #dd0000; animation: phone-ring 1.5s infinite; }
@keyframes phone-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(221,0,0,.4); }
  50% { box-shadow: 0 0 0 12px rgba(221,0,0,0); }
}

/* Back to top */
.back-to-top { position: fixed; right: 20px; bottom: 30px; width: 40px; height: 40px; border-radius: 50%; background: #0b8ad9; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); opacity: 0; visibility: hidden; transition: all .3s; z-index: 999; border: none; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #0967a8; }

/* ===== RESPONSIVE ===== */

/* ===== RESPONSIVE ===== */

/* Tablet ≤1024px */
@media (max-width: 1024px) {
  /* Header */
  .logo { max-width: 215px; margin-right: 15px; }
  .hotline-item .info { display: none; }
  .hotline-group { gap: 10px; }
  .mobile-menu-toggle { display: flex; }
  .search-desktop { max-width: 280px; }

  /* Hero */
  .hero-grid { grid-template-columns: 1fr; }
  .sidebar-categories { display: none; }
  .side-banners { flex-direction: row; }
  .side-banners img { width: 50%; }

  /* Navigation - slide-in menu */
  .main-nav { display: none; }
  .nav-menu { flex-direction: column; position: fixed; top: 0; left: -280px; width: 260px; height: 100%; background: #fff; z-index: 100000; box-shadow: 2px 0 4px rgba(0,0,0,.32); transition: transform .4s ease; overflow-y: auto; padding: 0; }
  .nav-menu.open { display: flex; transform: translate3d(280px, 0, 0); }
  .nav-menu > a { color: #333; padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,.1); font-size: 14px; white-space: normal; }
  .nav-menu > a:hover { background: #f5f5f5; color: #03a0e2; }
  .category-toggle-wrap { display: none; }

  /* Mobile category list (default visible, level 1) */
  .mobile-category-list { display: block; }
  .mobile-category-list .cat-dropdown-item { position: relative; }
  .mobile-category-list .cat-dropdown-item > a { display: flex; align-items: center; gap: 8px; padding: 11px 15px; font-size: 14px; color: #333; border-bottom: 1px solid #f0f0f0; font-weight: 600; }
  .mobile-category-list .cat-dropdown-item > a i.fa-chevron-right { color: #0b8ad9; font-size: 10px; }
  .mobile-category-list .cat-dropdown-item > a .mobile-sub-arrow { margin-left: auto; font-size: 10px; color: #999; transition: transform .3s; }
  .mobile-category-list .cat-dropdown-item.open > a .mobile-sub-arrow { transform: rotate(180deg); color: #0b8ad9; }
  .mobile-category-list .cat-dropdown-item.open > a { background: #e8f4fd; color: #0b8ad9; }
  /* Submenu (level 2) - indented with left border */
  .mobile-category-list .cat-dropdown-submenu { display: none !important; position: static; width: 100%; box-shadow: none; padding: 0; grid-template-columns: 1fr; border-radius: 0; background: #f7f9fb; }
  .mobile-category-list .cat-dropdown-item.open > .cat-dropdown-submenu { display: block !important; }
  .mobile-category-list .submenu-col { padding: 10px 0px 6px; }
  .mobile-category-list .submenu-col + .submenu-col { border-top: 1px solid #e8f4fd; }
  .mobile-category-list .submenu-col h4 { font-size: 14px; font-weight: 700; color: #0b8ad9; margin-bottom: 6px; padding-bottom: 4px; padding-left: 28px; border-bottom: none; text-transform: uppercase; }
  .mobile-category-list .submenu-col ul { list-style: none; padding: 0; margin: 0; }
  .mobile-category-list .submenu-col ul li a { display: block; padding: 6px 10px 6px 28px; font-size: 14px; color: #555; border-bottom: 1px solid rgba(0,0,0,.05); }
  .mobile-category-list .submenu-col ul li:last-child a { border-bottom: none; }
  .mobile-category-list .submenu-col ul li a:hover { color: #0b8ad9; padding-left: 32px; }

  /* Menu overlay */
  .menu-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); z-index: 99999; }
  .menu-overlay.active { display: block; }

  /* Products & others */
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }

  /* Product Detail - tablet */
  .pd-related .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile ≤767px */
@media (max-width: 767px) {
  /* Top bar */
  .top-bar-left { gap: 5px; }
  .top-bar-left, .top-bar-right { padding: 5px 0; font-size: 12px; line-height: 15px; }
  .top-bar-left ul li + li { margin-left: 5px; padding-left: 5px; }

  /* Header */
  .header { padding: 8px 0; }
  .header .container { flex-wrap: nowrap; gap: 10px; }
  .logo { max-width: 210px; }
  .search-desktop { display: none; }
  .search-mobile { display: block; }
  .search-mobile .search-box { max-width: 100%; }
  .search-mobile .search-box input { height: 34px; padding: 6px 40px 6px 10px; font-size: 13px; }
  .search-mobile .search-box button { width: 34px; }
  .hotline-group { display: none; }
  .mobile-menu-toggle { height: 30px; margin: 5px 0; }

  /* Products */
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-tabs { display: none; }
  .side-banners { display: none; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom .d-flex { flex-direction: column; gap: 10px; }
  .footer-bottom .footer-bocongthuong { flex-direction: column; align-items: center; text-align: center; }
  .footer-bottom .col.text-right { text-align: center; }

  /* News */
  .news-grid { grid-template-columns: 1fr; }

  /* Breadcrumb */
  .breadcrumb .container { display: flex; flex-wrap: wrap; gap: 2px; }

  /* Product Detail */
  .pd-top { grid-template-columns: 1fr; gap: 20px; }
  .pd-title { font-size: 18px; }
  .pd-gallery-thumbs { flex-wrap: wrap; }
  .pd-thumb { flex: 0 0 60px; height: 60px; }
  .pd-actions { flex-direction: column; }
  .pd-actions .pd-btn { width: 100%; justify-content: center; }
  .pd-combo-table, .pd-spec-table { display: block; overflow-x: auto; white-space: nowrap; }
  .pd-tab { padding: 10px 14px; font-size: 13px; }
  .pd-related .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small mobile ≤480px */
@media (max-width: 480px) {
  .top-bar { font-size: 11px; }
  .top-bar-left { gap: 4px; }
  .logo { max-width: 180px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card { padding: 10px; }
  .product-image img { max-height: 120px; }
  .product-name { font-size: 12px; height: auto; }
  .section-title { font-size: 14px; padding: 8px 20px 8px 15px; }
  .product-section-title { font-size: 14px; padding: 10px 15px; }
  .floating-buttons { left: 8px; bottom: 60px; }
  .float-btn { width: 40px; height: 40px; font-size: 18px; }

  /* Product Detail */
  .pd-price-current { font-size: 17px; }
  .pd-hotline-box { padding: 12px 14px; font-size: 13px; }
  .pd-thumb { flex: 0 0 50px; height: 50px; }
}
