/*
Theme Name: HeroMarket
Theme URI: https://www.heromarket.com.my/
Author: Anirudha Talmale
Description: Custom WordPress theme for HeroMarket - Malaysia's neighborhood hypermarket chain. Replicates the original heromarket.com.my design.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: heromarket
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
    --hm-red: #CE1E42;
    --hm-red-dark: #b31a39;
    --hm-red-light: #d63a5a;
    --hm-dark: #3a3a3a;
    --hm-gray: #666;
    --hm-light-gray: #DDD;
    --hm-bg: #fff;
    --hm-footer-bg: #CE1E42;
    --hm-copyright-bg: #b31a39;
}

* { box-sizing: border-box; }

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--hm-dark);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    font-size: 15px;
    background: var(--hm-bg);
}

a { color: var(--hm-red); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--hm-red-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: var(--hm-dark);
    margin-bottom: 0.5em;
}

img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.site-logo img {
    width: 95px;
    height: 78px;
    object-fit: contain;
}

/* Navigation */
.main-nav { display: flex; align-items: center; }

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 0;
}

.main-nav ul li { position: relative; }

.main-nav ul li a {
    display: block;
    padding: 12px 16px;
    color: var(--hm-dark);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item > a {
    color: var(--hm-red);
}

.main-nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-radius: 0 0 4px 4px;
    flex-direction: column;
    z-index: 100;
}

.main-nav ul li:hover > ul { display: flex; }

.main-nav ul li ul li a {
    padding: 10px 20px;
    font-size: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.main-nav ul li ul li:last-child a { border-bottom: none; }

.main-nav ul li.menu-item-has-children > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
    font-size: 10px;
}

/* About page layout */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.about-layout .about-image img {
    width: 100%;
    border-radius: 8px;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--hm-dark);
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--hm-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.hero-slider .heroSwiper {
    height: 520px;
}

.hero-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.hero-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.swiper-button-next, .swiper-button-prev {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.swiper-pagination-bullet-active {
    background: var(--hm-red) !important;
}

/* What's In Store Section */
.whats-in-store {
    padding: 60px 0;
    background: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--hm-dark);
}

.section-title p {
    color: var(--hm-gray);
    font-size: 16px;
}

/* Tab navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-nav button {
    padding: 10px 25px;
    border: 2px solid var(--hm-light-gray);
    background: #fff;
    color: var(--hm-dark);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
}

.tab-nav button:hover,
.tab-nav button.active {
    background: var(--hm-red);
    border-color: var(--hm-red);
    color: #fff;
}

/* Promo grid */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.promo-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.promo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.promo-card .promo-content {
    padding: 16px;
}

.promo-card .promo-content h3 {
    font-size: 15px;
    margin: 0 0 8px;
    line-height: 1.4;
}

.promo-card .promo-content .promo-date {
    font-size: 12px;
    color: var(--hm-gray);
}

.promo-card .promo-content .promo-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--hm-red);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* About + Portfolio Row */
.about-portfolio-section {
    padding: 50px 0;
    background: #fff;
}

.about-portfolio-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.about-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20px;
}

.about-col h2 {
    font-size: 26px;
    color: var(--hm-red);
    margin-bottom: 16px;
    font-style: italic;
    font-weight: 700;
}

.about-col p {
    color: var(--hm-gray);
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 14px;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    padding: 20px 20px 0;
    text-decoration: none;
    transition: transform 0.3s;
}

.portfolio-card:hover {
    transform: translateY(-4px);
}

.portfolio-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--hm-dark);
    margin: 0 0 15px;
}

.portfolio-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-top: auto;
}

/* Store Locator */
.store-locator {
    padding: 60px 0;
}

.store-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.store-tabs button {
    padding: 10px 20px;
    border: 2px solid var(--hm-light-gray);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
}

.store-tabs button:hover,
.store-tabs button.active {
    background: var(--hm-red);
    border-color: var(--hm-red);
    color: #fff;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.store-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.store-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.store-card .store-info {
    padding: 16px;
}

.store-card .store-info h3 {
    font-size: 16px;
    margin: 0 0 8px;
    color: var(--hm-red);
}

.store-card .store-info p {
    font-size: 13px;
    color: var(--hm-gray);
    margin: 0 0 6px;
    line-height: 1.6;
}

.store-card .store-info .store-hours {
    font-size: 12px;
    color: var(--hm-dark);
    font-weight: 600;
}

.store-card .store-info .store-direction {
    margin-top: 10px;
    font-size: 14px;
}

.store-card .store-info .store-direction .direction-label {
    color: var(--hm-red);
    font-weight: 700;
}

.store-card .store-info .store-direction a {
    color: var(--hm-dark);
    font-weight: 600;
}

.store-card .store-info .store-direction a:hover {
    color: var(--hm-red);
}

/* Membership Section */
.membership-section {
    padding: 60px 0;
    text-align: center;
}

.membership-section .member-count {
    font-size: 36px;
    font-weight: 700;
    color: var(--hm-red);
    margin: 20px 0;
}

.membership-section .benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 30px auto;
    text-align: left;
}

.membership-section .benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

.membership-section .benefit-item i {
    color: var(--hm-red);
    font-size: 22px;
    margin-top: 2px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--hm-red);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s;
}

.btn-primary:hover { background: var(--hm-red-dark); color: #fff; }

/* Page header */
.page-header-banner {
    background: linear-gradient(135deg, var(--hm-red) 0%, var(--hm-red-dark) 100%);
    padding: 40px 0;
    text-align: center;
    color: #fff;
}

.page-header-banner h1 {
    color: #fff;
    font-size: 32px;
    margin: 0;
}

/* General page content */
.page-content {
    padding: 60px 0;
}

.page-content p { line-height: 1.8; color: var(--hm-gray); margin-bottom: 16px; }

/* Footer */
.site-footer {
    background: var(--hm-footer-bg);
    color: #fff;
    padding: 50px 0 0;
}

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

.footer-column h4 {
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fff;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li { margin-bottom: 8px; }

.footer-column ul li a {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    transition: color 0.3s;
}

.footer-column ul li a:hover { color: #fff; text-decoration: underline; }

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    transition: background 0.3s;
}

.social-links a:hover { background: rgba(255,255,255,0.3); color: #fff; }

.copyright {
    background: var(--hm-copyright-bg);
    padding: 15px 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
}

/* Floating WhatsApp button */
.float-btn {
    position: fixed;
    width: 55px;
    height: 55px;
    bottom: 40px;
    right: 15px;
    background-color: var(--hm-red-light);
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: background 0.3s;
}

.float-btn:hover { background-color: var(--hm-red); color: #fff; }

/* Responsive */
@media (max-width: 1499px) {
    .hero-slider .heroSwiper { height: 450px; }
}

@media (max-width: 991px) {
    .nav-toggle { display: block; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }

    .main-nav.active { display: block; }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav ul li ul {
        position: static;
        box-shadow: none;
        background: #f8f8f8;
    }

    .main-nav ul li ul li a {
        padding-left: 32px;
    }

    .hero-slider .heroSwiper { height: 380px; }
    .promo-grid { grid-template-columns: repeat(2, 1fr); }
    .store-grid { grid-template-columns: repeat(2, 1fr); }
    .about-portfolio-row { grid-template-columns: repeat(2, 1fr); }
    .footer-columns { grid-template-columns: repeat(3, 1fr); }
    .about-layout { grid-template-columns: 1fr; }
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { flex-direction: row; flex-wrap: wrap; }
    .blog-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-post-card { grid-template-columns: 160px 1fr; }
    .blog-post-thumb img { width: 160px; height: 140px; }
}

@media (max-width: 767px) {
    .hero-slider .heroSwiper { height: 250px; }
    .promo-grid { grid-template-columns: 1fr; }
    .store-grid { grid-template-columns: 1fr; }
    .about-portfolio-row { grid-template-columns: 1fr 1fr; }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
    .membership-section .benefits { grid-template-columns: 1fr; }
    .about-layout { grid-template-columns: 1fr; }
    .blog-posts-grid { grid-template-columns: 1fr; }
    .blog-post-card { grid-template-columns: 1fr; }
    .blog-post-thumb img { width: 100%; height: 180px; }

    .header-inner { padding: 8px 0; }
    .site-logo img { width: 70px; height: auto; }
}

@media (max-width: 480px) {
    .about-portfolio-row { grid-template-columns: 1fr; }
    .footer-columns { grid-template-columns: 1fr; }
}

/* Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    padding: 40px 0;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-cat-btn {
    display: block;
    padding: 14px 20px;
    background: var(--hm-red);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 30px;
    text-align: center;
    transition: background 0.3s;
}

.sidebar-cat-btn:hover,
.sidebar-cat-btn.active {
    background: var(--hm-red-dark);
    color: #fff;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.blog-post-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    align-items: start;
}

.blog-post-thumb img {
    width: 200px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.blog-post-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.blog-post-info h3 a {
    color: var(--hm-dark);
}

.blog-post-info h3 a:hover {
    color: var(--hm-red);
}

.blog-post-excerpt {
    font-size: 13px;
    color: #666;
    margin: 0 0 15px;
    line-height: 1.6;
}

.blog-learn-more {
    display: inline-block;
    padding: 10px 25px;
    background: var(--hm-red);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 30px;
    transition: background 0.3s;
}

.blog-learn-more:hover {
    background: var(--hm-red-dark);
    color: #fff;
}

/* WordPress alignment classes */
.alignleft { float: left; margin-right: 20px; margin-bottom: 10px; }
.alignright { float: right; margin-left: 20px; margin-bottom: 10px; }
.aligncenter { display: block; margin: 0 auto 20px; }

/* Admin bar fix */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .site-header { top: 46px; }
}
