/*
Theme Name: Saliroma Systems
Theme URI: https://majiserve.com
Description: Professional water treatment e-commerce theme with WoodMart-inspired design and Jumia-style navigation
Author: Saliroma Systems
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: majiserve
Tags: e-commerce, woocommerce, responsive, custom-colors
*/

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   COLOR VARIABLES - Water Industry Theme
   ========================================================================== */
:root {
    --primary-blue: #0066CC;
    --primary-dark: #004999;
    --secondary-teal: #00ACC1;
    --accent-orange: #FF6F00;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --success: #43A047;
    --danger: #E53935;
}

/* ==========================================================================
   LAYOUT & CONTAINER
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    min-height: 60vh;
    padding: 40px 0;
}

/* ==========================================================================
   TOP HEADER BAR
   ========================================================================== */
.top-header {
    background: var(--text-dark);
    color: var(--white);
    padding: 10px 0;
    font-size: 14px;
}

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

.top-header-left span {
    margin-right: 20px;
}

.top-header-left i {
    margin-right: 5px;
    color: var(--secondary-teal);
}

.top-header-right a {
    color: var(--white);
    margin-left: 15px;
}

.top-header-right a:hover {
    color: var(--secondary-teal);
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    padding: 20px 0;
}

.header-content {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 30px;
    align-items: center;
}

/* Logo */
.site-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
}

.site-logo span {
    color: var(--secondary-teal);
}

/* Custom logo image */
.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: 60px;
    width: auto;
    display: block;
}

/* Search Bar */
.header-search {
    position: relative;
    max-width: 600px;
}

.header-search input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 15px;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.header-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

.header-search button:hover {
    background: var(--primary-dark);
}

/* Header Icons */
.header-icons {
    display: flex;
    gap: 25px;
    align-items: center;
}

.header-icon {
    position: relative;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

.header-icon:hover {
    color: var(--primary-blue);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-orange);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.main-navigation {
    background: var(--primary-blue);
    position: relative;
}

/* Widen the nav container to match page content (1400px) so All Categories
   aligns with the left edge of the sidebar/content below */
.main-navigation .container {
    max-width: 1400px;
    padding: 0;
}

/* Nav bar inner — flex row: [All Categories] | gap | [menu items] */
.nav-inner {
    display: flex;
    align-items: stretch;
}

/* Main menu list — pushed to the far RIGHT of the nav bar */
.main-navigation .main-menu {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    margin-left: auto;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: var(--white);
    padding: 15px 20px;
    display: block;
    font-weight: 500;
    white-space: nowrap;
}

.main-navigation a:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   ALL CATEGORIES — nav bar dropdown (Jumia-style)
   ========================================================================== */

/* Wrapper — relative so panel drops below it */
.nav-all-cats {
    position: relative;
    flex-shrink: 0;
}

/* Trigger button */
.nav-all-cats-btn {
    background: rgba(0, 0, 0, 0.25);
    color: var(--white);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0 22px 0 20px;
    height: 100%;
    min-height: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.nav-all-cats-btn:hover,
.nav-all-cats.is-open .nav-all-cats-btn {
    background: rgba(0, 0, 0, 0.4);
}

.nav-cat-caret {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.nav-all-cats.is-open .nav-cat-caret {
    transform: rotate(180deg);
}

/* Dropdown panel */
.nav-cats-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 260px;
    background: var(--white);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    border-radius: 0 0 8px 8px;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Open states — hover (desktop) and .is-open (JS toggle) */
.nav-all-cats:hover .nav-cats-panel,
.nav-all-cats.is-open .nav-cats-panel {
    display: block;
}

/* Category list — must be block, NOT flex */
.nav-cats-list {
    display: block;
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.nav-cat-row {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.nav-cat-row:last-child { border-bottom: none; }

.nav-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    color: var(--text-dark) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.nav-cat-link:hover {
    background: #f0f6ff;
    color: var(--primary-blue) !important;
    padding-left: 22px;
}

.nav-sub-arrow {
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
}

.nav-cat-row:hover .nav-sub-arrow {
    color: var(--primary-blue);
}

/* Subcategory flyout */
.nav-cat-sub {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 220px;
    background: var(--white);
    box-shadow: 6px 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 0 8px 8px 8px;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    z-index: 1051;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-cat-row.has-sub:hover > .nav-cat-sub {
    display: block;
}

/* Subcategory heading */
.nav-cat-sub-title {
    padding: 10px 18px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0;
    cursor: default;
}

.nav-cat-sub li a {
    display: block;
    padding: 10px 18px;
    color: var(--text-dark) !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.nav-cat-sub li a:hover {
    background: #f0f6ff;
    color: var(--primary-blue) !important;
    padding-left: 24px;
}

/* ==========================================================================
   SIDEBAR CATEGORY NAVIGATION (Jumia-Style)
   ========================================================================== */
.category-sidebar {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header::before {
    content: '☰';
    font-size: 20px;
}

.category-list {
    padding: 0;
}

.category-list > li {
    border-bottom: 1px solid var(--border-color);
}

.category-list > li:last-child {
    border-bottom: none;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-link:hover {
    background: var(--bg-light);
    color: var(--primary-blue);
    padding-left: 25px;
}

.category-link.active {
    background: var(--secondary-teal);
    color: var(--white);
    font-weight: 600;
}

.category-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.category-arrow.expanded {
    transform: rotate(90deg);
}

.product-count {
    color: var(--text-light);
    font-size: 14px;
    margin-left: 8px;
}

.subcategory-list {
    display: none;
    background: #fafafa;
    padding: 0;
}

.subcategory-list.show {
    display: block;
}

.subcategory-list li {
    border-top: 1px solid var(--border-color);
}

.subcategory-list .category-link {
    padding-left: 40px;
    font-size: 14px;
}

.subcategory-list .category-link::before {
    content: '•';
    margin-right: 10px;
    color: var(--secondary-teal);
}

/* ==========================================================================
   MAIN LAYOUT (Sidebar + Content)
   ========================================================================== */
.main-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* ==========================================================================
   PRODUCT GRID
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    padding-top: 114.28%; /* Updated for 700x800 (7:8 ratio) */
    overflow: hidden;
    background: var(--bg-light);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-orange);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.product-badge.sale {
    background: var(--danger);
}

.product-badge.new {
    background: var(--success);
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
    min-height: 48px;
}

.product-title:hover {
    color: var(--primary-blue);
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 12px;
}

.product-price del {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 400;
    margin-right: 8px;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   WOODMART STYLE ENHANCEMENTS
   ========================================================================== */

/* Product Card WoodMart Style */
.product-card.woodmart-style {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid transparent;
}

.product-card.woodmart-style:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: #f0f0f0;
}

/* Product Badges (WoodMart Style) */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-badges .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge-sale {
    background: #E53935;
}

.badge-new {
    background: #43A047;
}

.badge-featured {
    background: #FF6F00;
}

.badge-out-of-stock {
    background: #757575;
}

/* Product Image (Updated for 700x800 ratio - 7:8) */
.product-card.woodmart-style .product-image {
    position: relative;
    padding-top: 114.28%; /* 800/700 = 1.1428 = 114.28% for 7:8 aspect ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.product-card.woodmart-style .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card.woodmart-style:hover .product-image img {
    transform: scale(1.08);
}

/* Product Actions (Hover Overlay) */
.product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.product-card.woodmart-style:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.product-actions .button,
.product-actions .add_to_cart_button,
.product-actions .added_to_cart {
    width: 100%;
    background: var(--white);
    color: var(--primary-blue);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.product-actions .button:hover,
.product-actions .add_to_cart_button:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: scale(1.02);
}

/* Product Info Section */
.product-card.woodmart-style .product-info {
    padding: 18px;
}

.product-card.woodmart-style .product-category {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card.woodmart-style .product-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 10px;
    line-height: 1.4;
    min-height: auto;
}

.product-card.woodmart-style .product-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card.woodmart-style .product-title a:hover {
    color: var(--primary-blue);
}

/* Star Ratings */
.product-card.woodmart-style .product-rating {
    margin: 8px 0;
}

.product-card.woodmart-style .star-rating {
    font-size: 14px;
    color: #FFC107;
}

.woocommerce .star-rating {
    color: #FFC107;
    font-size: 14px;
}

.woocommerce .star-rating::before {
    color: #e0e0e0;
}

/* Product Price */
.product-card.woodmart-style .product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 8px 0 0;
}

.product-card.woodmart-style .product-price del {
    color: #999;
    font-size: 15px;
    font-weight: 400;
    margin-right: 8px;
    opacity: 0.7;
}

.product-card.woodmart-style .product-price ins {
    text-decoration: none;
    color: #E53935;
}

/* Shop Toolbar Styling */
.shop-toolbar {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.shop-toolbar .woocommerce-ordering select {
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-toolbar .woocommerce-ordering select:hover {
    border-color: var(--primary-blue);
}

.shop-toolbar .woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* Breadcrumbs */
.woocommerce-breadcrumb,
.breadcrumb {
    font-size: 14px;
    color: #666;
}

.woocommerce-breadcrumb a,
.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.woocommerce-breadcrumb a:hover,
.breadcrumb a:hover {
    color: var(--primary-blue);
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 30px;
    text-align: center;
}

.woocommerce-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination .page-numbers li {
    display: inline-block;
}

.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.woocommerce-pagination .page-numbers a:hover,
.woocommerce-pagination .page-numbers span.current {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Shop page grid — CSS class so media queries can override it */
.shop-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    align-items: start;
    padding-bottom: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-grid {
        grid-template-columns: 240px 1fr;
    }

    .shop-with-sidebar > div {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }

    .shop-with-sidebar > div {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static !important;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card.woodmart-style .product-title {
        font-size: 14px;
    }

    .product-card.woodmart-style .product-price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: #1a1a1a !important;
    color: #ffffff !important;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.site-footer .footer-widget h3 {
    color: #00ACC1 !important;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.site-footer .footer-widget {
    color: #e0e0e0 !important;
}

.site-footer .footer-widget p,
.site-footer .footer-widget strong,
.site-footer .footer-widget span {
    color: #e0e0e0 !important;
}

.site-footer .footer-widget ul {
    list-style: none;
    padding: 0;
}

.site-footer .footer-widget ul li {
    margin-bottom: 8px;
    color: #e0e0e0 !important;
}

.site-footer .footer-widget ul li i {
    color: #00ACC1 !important;
    margin-right: 8px;
}

.site-footer .footer-widget a {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer .footer-widget a:link,
.site-footer .footer-widget a:visited {
    color: #ffffff !important;
}

.site-footer .footer-widget a:hover {
    color: #00ACC1 !important;
}

.site-footer .footer-widget li:not(:has(a)) {
    color: #e0e0e0 !important;
}

.site-footer .footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    color: #999 !important;
}

.site-footer .footer-bottom p {
    color: #999 !important;
    margin: 0;
}

/* Additional footer text visibility rules */
.site-footer,
.site-footer *:not(h3):not(i):not(a) {
    color: #e0e0e0 !important;
}

.site-footer h3,
.site-footer .footer-widget h3 {
    color: #00ACC1 !important;
}

.site-footer i,
.site-footer .footer-widget i {
    color: #00ACC1 !important;
}

.site-footer a,
.site-footer .footer-widget a {
    color: #ffffff !important;
}

.site-footer a:hover,
.site-footer .footer-widget a:hover {
    color: #00ACC1 !important;
}

/* WordPress widget specific */
.site-footer .widget,
.site-footer .widget li,
.site-footer .widget p,
.site-footer .widget span {
    color: #e0e0e0 !important;
}

.site-footer .widget a {
    color: #ffffff !important;
}

/* ==========================================================================
   WHATSAPP FLOAT BUTTON
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

/* ==========================================================================
   HAMBURGER / MOBILE NAV TOGGLE
   ========================================================================== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-dark);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Overlay that dims the page when nav is open on mobile */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
}

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

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 250px 1fr;
    }

    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* -- Header -- */
    .header-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
    }

    .site-logo {
        flex: 1;
        font-size: 22px;
    }

    .header-search {
        order: 10;
        flex-basis: 100%;
        max-width: 100%;
    }

    .header-icons {
        gap: 18px;
    }

    /* Show hamburger button on mobile */
    .nav-toggle {
        display: flex;
    }

    /* Top bar collapses to single column */
    .top-header-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* -- Mobile navigation drawer -- */
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 999;
        background: var(--primary-blue);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .main-navigation.is-open {
        display: block;
    }

    /* Stack nav-inner vertically on mobile */
    .nav-inner {
        flex-direction: column;
        align-items: stretch;
    }

    /* All Categories takes full row on mobile */
    .nav-all-cats {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .nav-all-cats-btn {
        width: 100%;
        padding: 15px 20px;
        justify-content: space-between;
        background: rgba(0, 0, 0, 0.2);
        min-height: 0;
    }

    /* On mobile the panel is inline (not absolute) */
    .nav-cats-panel {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 50vh;
    }

    /* Flyout sub-menus become stacked on mobile */
    .nav-cat-sub {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        border-top: 1px solid #f0f0f0;
        max-height: none;
    }

    .nav-cat-row.has-sub:hover > .nav-cat-sub {
        display: none; /* disable hover on mobile, JS handles it */
    }

    .nav-cat-row.has-sub.sub-open > .nav-cat-sub {
        display: block;
    }

    .main-navigation .main-menu {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        margin-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .main-navigation .container {
        padding: 0;
    }

    /* Ensure category lists never get flex on mobile */
    .nav-cats-list,
    .nav-cat-sub {
        display: block !important;
        flex-direction: unset !important;
    }

    .main-navigation li {
        position: static;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: 15px 20px;
        font-size: 16px;
    }

    /* -- Layout -- */
    .main-wrapper {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        margin-bottom: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
}

/* ==========================================================================
   HOMEPAGE LAYOUT (front-page.php grids)
   ========================================================================== */
.homepage-with-sidebar {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.homepage-main-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.services-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.industries-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.why-choose-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .homepage-main-grid {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    .homepage-main-grid {
        grid-template-columns: 1fr;
    }

    /* Sidebar moves to top on mobile as a collapsed filter panel */
    .homepage-sidebar {
        position: static !important;
        order: -1;
    }

    .services-cards-grid {
        grid-template-columns: 1fr;
    }

    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .why-choose-grid {
        grid-template-columns: 1fr;
    }

    /* Hero slider height reduced on mobile */
    .hero-slider {
        height: 280px !important;
    }

    .hero-slider h1 {
        font-size: 28px !important;
    }

    .hero-slider p,
    .hero-slider div[style*="font-size: 20px"] {
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .homepage-with-sidebar {
        padding: 0 12px;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* ==========================================================================
   CATEGORIES SLIDE-IN DRAWER (shop + inner pages)
   ========================================================================== */

/* Overlay backdrop */
.cat-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1098;
    cursor: pointer;
}
.cat-drawer-overlay.active { display: block; }

/* Drawer panel */
.cat-drawer {
    position: fixed;
    top: 0;
    left: -340px;
    width: 320px;
    height: 100vh;
    background: var(--white);
    z-index: 1099;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
}
.cat-drawer.is-open { left: 0; }

/* Drawer header bar */
.cat-drawer-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cat-drawer-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s ease;
}
.cat-drawer-close:hover { background: rgba(255, 255, 255, 0.2); }

.cat-drawer-body { padding: 0; }

/* Lock body scroll when drawer is open */
body.drawer-open { overflow: hidden; }

/* ==========================================================================
   SHOP PAGE — full-width layout
   ========================================================================== */
.shop-page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.shop-breadcrumb {
    padding: 20px 0 15px;
    font-size: 14px;
    color: #666;
}

.shop-breadcrumb .bc-sep { color: #ccc; margin: 0 4px; }

/* Top bar */
.shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--white);
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* "All Categories" toggle button */
.cat-drawer-btn {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.cat-drawer-btn:hover { background: var(--primary-dark); }

.shop-topbar-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.shop-results-count { font-size: 14px; color: #666; }

/* Products grid — full width */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Pagination */
.shop-pagination { margin-top: 40px; }

/* No products */
.shop-no-products {
    background: var(--white);
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.shop-no-products i { font-size: 48px; color: #ddd; display: block; margin-bottom: 20px; }
.shop-no-products h2 { font-size: 24px; margin-bottom: 10px; color: var(--text-dark); }
.shop-no-products p { color: #666; margin-bottom: 25px; }
.shop-no-products a {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
}

/* ==========================================================================
   INNER PAGES (About, Contact, Services, etc.) — full-width, no sidebar
   ========================================================================== */
.inner-page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.inner-page-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    padding: 50px 40px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    color: var(--white);
}

.inner-page-hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.inner-page-content {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.entry-content {
    line-height: 1.8;
    color: var(--text-dark);
    font-size: 16px;
}

.entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .shop-topbar { flex-direction: column; align-items: stretch; }
    .cat-drawer-btn { justify-content: center; }
    .shop-topbar-meta { justify-content: space-between; }
    .inner-page-hero { padding: 35px 20px; }
    .inner-page-hero h1 { font-size: 28px; }
    .inner-page-content { padding: 20px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   SERVICES PAGE - GRID LAYOUT
   ========================================================================== */
.entry-content .services-tiles-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin: 40px 0 !important;
    list-style: none !important;
    padding: 0 !important;
}

.entry-content .services-tiles-grid > div {
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    min-width: 0 !important;
}

.entry-content .services-tiles-grid > div:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

@media (max-width: 768px) {
    .entry-content .services-tiles-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .inner-page-content {
        padding: 15px !important;
    }

    /* Services page uses a <table> layout — force it to stack on mobile */
    .inner-page-content table,
    .inner-page-content tbody {
        display: block !important;
        width: 100% !important;
    }

    .inner-page-content tr {
        display: block !important;
        margin-bottom: 20px;
    }

    .inner-page-content td {
        display: block !important;
        width: 100% !important;
        padding: 0 0 20px 0 !important;
        box-sizing: border-box !important;
    }

    .inner-page-content table {
        border-spacing: 0 !important;
        margin: 20px 0 !important;
    }
}
