/* =========================================================================
   HỆ THỐNG CSS TỔNG LỰC - GRALIMEX 2026 (FILE MASTER)
   Chứa: Variables, Reset, Header, Utility, Component chung và Base Banner
========================================================================= */

/* =========================================
   1. VARIABLES & RESET CƠ BẢN
========================================= */
:root {
    --primary-color: #1a64af;
    --secondary-color: #039551;
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-body: #475569;
    --bg-light: #f8fafc;
    --white: #ffffff;
    
    --font-be: 'Be Vietnam Pro', sans-serif;
    --font-roboto: 'Roboto', sans-serif;
    --font-heading: var(--font-roboto); 
    --font-body: var(--font-roboto);
    
    --transition-fast: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    max-width: 100% !important;
    overflow-x: clip !important;
    margin: 0; padding: 0;
    width: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-body);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    padding-top: 128px; 
}

h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading); color: var(--text-dark); 
    font-weight: 700; line-height: 1.3; letter-spacing: 0.5px; 
}

a { text-decoration: none; color: inherit; transition: var(--transition-fast); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* =========================================
   2. MASTER HERO BANNER (SIZE VÀ LỚP PHỦ CHUNG)
========================================= */
/* Áp dụng cho mọi banner để đồng nhất kích thước và overlay */
.page-hero, .page-hero-small, .rd-hero, .about-banner, .pg-prd-hero, .ct-hero-section {
    position: relative;
    padding: 120px 0 80px; /* Size chuẩn chung */
    text-align: center;
    color: var(--white) !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
}

/* Lớp phủ đen 0.65 khóa cứng */
.page-hero::before, .page-hero-small::before, .rd-hero::before, .about-banner::before, .pg-prd-hero::before, .ct-hero-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: -1;
}

.page-hero h1, .page-hero-small h1, .rd-hero h1, .about-banner h1, .pg-prd-hero h1, .ct-hero-section h1 {
    font-size: 3.5rem; font-weight: 900; text-transform: uppercase; 
    letter-spacing: 2px; color: var(--white) !important;
    text-shadow: 0 4px 12px rgba(0,0,0,0.4); margin-bottom: 15px;
}

/* Breadcrumb chung */
.breadcrumb, .ct-nav-breadcrumb { font-size: 1.15rem; font-weight: 600; color: var(--white); }
.breadcrumb a, .ct-nav-breadcrumb a { color: rgba(255, 255, 255, 0.75); text-decoration: none; transition: var(--transition-fast); }
.breadcrumb a:hover, .ct-nav-breadcrumb a:hover { color: var(--secondary-color); }
.breadcrumb span, .ct-nav-breadcrumb span { margin: 0 12px; color: rgba(255, 255, 255, 0.5); }
.breadcrumb strong, .ct-nav-breadcrumb strong { color: var(--white); }

/* =========================================
   3. UTILITIES (TIỆN ÍCH & HIỆU ỨNG CHUNG)
========================================= */
.text-center { text-align: center; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }

.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

#backToTop {
    position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px;
    background-color: var(--primary-color); color: var(--white); border: none; border-radius: 50%;
    font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--transition-fast);
    z-index: 999; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background-color: var(--secondary-color); transform: translateY(-3px); }

.hr-mirror-hover { position: relative; overflow: hidden; }
.hr-mirror-hover::before {
    content: ''; position: absolute; top: 0; left: -150%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transform: skewX(-25deg); transition: 0.7s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1; pointer-events: none;
}
.hr-mirror-hover:hover::before { left: 150%; }
.hr-mirror-hover > * { position: relative; z-index: 2; }

/* =========================================
   4. UI COMPONENTS (Nút bấm, Cards, Tabs dùng chung)
========================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 14px 32px; border-radius: 6px;
    font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; transition: var(--transition-fast); border: 2px solid transparent;
}
.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: #124b87; color: var(--white); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(26, 100, 175, 0.3); }

.btn-secondary { background-color: var(--secondary-color); color: var(--white); }
.btn-secondary:hover { background-color: #02703d; color: var(--white); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(3, 149, 81, 0.3); }

.hp-prd-card { background: var(--white); border-radius: 12px; overflow: hidden; border: 1px solid #f1f5f9; transition: 0.4s; height: 100%; display: flex; flex-direction: column; }
.hp-prd-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); border-color: var(--primary-color); }
.hp-prd-img { width: 100%; aspect-ratio: 1 / 1; background-size: cover; background-position: center; position: relative; cursor: pointer; }
.tag-brand { position: absolute; top: 15px; left: 15px; background: var(--primary-color); color: var(--white); padding: 4px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; }
.hp-prd-info { padding: 25px; flex: 1; display: flex; flex-direction: column; text-align: center; }
.hp-prd-info h4 { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 12px; font-weight: 800; }
.hp-prd-info p { font-size: 0.85rem; color: var(--text-body); margin-bottom: 20px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-view-detail { font-weight: 800; color: var(--primary-color); display: inline-flex; align-items: center; gap: 8px; justify-content: center; font-size: 0.85rem;}

.hp-news-card { background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05); position: relative; display: flex; flex-direction: column; height: 100%;}
.hp-news-img { height: 220px; overflow: hidden; }
.hp-news-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; display: block;}
.hp-news-card:hover .hp-news-img img { transform: scale(1.1); }
.hp-news-info { padding: 25px; flex: 1; display: flex; flex-direction: column;}
.hp-news-date { color: var(--secondary-color); font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; display: block; }
.hp-news-info h3 { font-size: 1.2rem; margin-bottom: 15px; line-height: 1.4; transition: 0.3s; }
.hp-news-info h3:hover { color: var(--primary-color); }

.tab-container { display: flex; justify-content: center; margin-bottom: 0; }
.tab-nav { display: inline-flex; position: relative; padding: 0; margin-bottom: -2px; z-index: 22; }
.tab-item { padding: 15px 35px; font-weight: 800; font-size: 0.95rem; color: #64748b; cursor: pointer; position: relative; z-index: 5; transition: 0.3s; text-transform: uppercase; white-space: nowrap; }
.tab-item.active { color: var(--primary-color); }
.tab-indicator { position: absolute; top: 0; left: 0; height: 100%; background: var(--white); border: 2px solid var(--primary-color); border-bottom: 2px solid var(--white); border-radius: 12px 12px 0 0; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); z-index: 2; }
.prd-slider-container { position: relative; opacity: 1; transition: 0.4s; border: 2px solid var(--primary-color); border-radius: 15px; padding: 40px 30px; z-index: 20; background: var(--white); }
.prd-nav { width: 45px; height: 45px; background: var(--white); border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.1); color: var(--primary-color) !important; border: 1px solid #f1f5f9; }
.prd-nav:after { font-size: 18px !important; font-weight: bold; }

/* =========================================
   5. HEADER TỔNG (hr-)
========================================= */
#hr-header-master { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; background-color: var(--white); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); font-family: 'Montserrat', sans-serif; }
#hr-header-master.hr-scrolled-up { transform: translateY(-100%); }
.hr-container { width: 100%; max-width: 1200px; margin: 0 auto !important; padding: 0 15px; }

.hr-topbar { background-color: var(--primary-color); color: var(--white); height: 38px; font-size: 13px; font-family: 'Roboto', sans-serif; }
.hr-topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.hr-marquee-wrapper { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent); display: flex; align-items: center; }
.hr-marquee-content { display: inline-flex; animation: hr-marquee-anim 25s linear infinite; }
.hr-marquee-content:hover { animation-play-state: paused; cursor: default; }
@keyframes hr-marquee-anim { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.hr-marquee-item { display: inline-flex; align-items: center; padding-right: 50px; font-weight: 500; }
.hr-marquee-item i { color: #93c5fd; margin-right: 8px; }
.hr-topbar-contact { display: flex; gap: 20px; flex-shrink: 0; }
.hr-topbar-contact a { color: var(--white); display: flex; align-items: center; gap: 6px; text-decoration: none; }
.hr-topbar-contact a:hover { color: #93c5fd; }

.hr-main-nav { height: 90px; }
.hr-main-nav-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.hr-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.hr-brand img { height: 65px; width: auto; object-fit: contain; }
.hr-brand-text { border-left: 2px solid var(--primary-color); padding-left: 8px; }
.hr-brand-text .hr-t1 { font-weight: 800; font-size: 1.2rem; color: var(--primary-color); line-height: 1.1; margin: 0; }
.hr-brand-text .hr-t2 { font-weight: 800; font-size: 1.2rem; color: var(--secondary-color); line-height: 1.1; margin: 0; }

.hr-menu-list { display: flex; list-style: none; gap: 25px; align-items: center; margin: 0; padding: 0; }
.hr-menu-item { position: relative; height: 100%; display: flex; align-items: center; }
.hr-menu-link { font-weight: 700; font-size: 0.85rem; color: var(--text-dark); text-transform: uppercase; position: relative; padding: 8px 0; text-decoration: none; }
.hr-menu-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--primary-color); transition: 0.3s ease; }
.hr-menu-link:hover, .hr-menu-item.hr-active .hr-menu-link { color: var(--primary-color); }
.hr-menu-link:hover::after, .hr-menu-item.hr-active .hr-menu-link::after { width: 100%; }

.hr-submenu { position: absolute; top: 100%; left: 0; background-color: var(--white); min-width: 250px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-top: 3px solid var(--primary-color); border-radius: 0 0 6px 6px; opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 0.3s ease; padding: 10px 0; }
.hr-menu-item.hr-has-sub:hover .hr-submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.hr-submenu a { display: block; padding: 12px 20px; color: var(--text-body); font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: 0.3s; }
.hr-submenu a:hover { color: var(--primary-color); background-color: var(--bg-light); padding-left: 25px; }

.hr-btn-quote { display: inline-flex; align-items: center; gap: 8px; background-color: var(--primary-color); color: var(--white) !important; padding: 12px 28px; border-radius: 50px; font-weight: 700; font-size: 13px; text-transform: uppercase; transition: 0.3s; text-decoration: none; }
.hr-btn-quote:hover { background-color: #124b87; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(26,100,175,0.3); }

.hr-mobile-btn { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 10px; z-index: 10001; }
.hr-mobile-btn span { width: 28px; height: 3px; background: var(--primary-color); transition: 0.3s; border-radius: 2px; }

@media (max-width: 1024px) {
    .hr-main-nav { height: 80px; }
    .hr-mobile-btn { display: flex; }
    .hr-menu-list { position: fixed; top: 0; right: -100%; width: 300px; height: 100vh; background-color: var(--white); flex-direction: column; align-items: flex-start; padding: 100px 30px 40px; box-shadow: -10px 0 30px rgba(0,0,0,0.1); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; }
    .hr-menu-list.hr-active { right: 0; }
    .hr-menu-item { width: 100%; height: auto; display: block; border-bottom: 1px solid #f1f5f9; }
    .hr-menu-link { padding: 15px 0; font-size: 1rem; display: block; }
    .hr-submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; display: none; padding: 0 0 15px 20px; }
    .hr-menu-item.hr-has-sub.hr-open .hr-submenu { display: block; }
    .hr-mobile-btn.hr-is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hr-mobile-btn.hr-is-open span:nth-child(2) { opacity: 0; }
    .hr-mobile-btn.hr-is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}