/*
Theme Name: IMS by Soul Country
Description: A modern block theme for IMS Company with WooCommerce support
Version: 1.0.0
Author: Soul Country
Text Domain: ims-by-soulcountry
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: block-theme, e-commerce, modern, responsive
*/

/*
 * Font & typography styles.
 * Moved to theme.json.
 */

/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}



.desktop-nav .wp-block-navigation a {
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desktop-nav .wp-block-navigation a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffd700 !important;
}

/* Add dropdown arrow for navigation items */
.desktop-nav .wp-block-navigation li:nth-child(2) a::after {
    content: "▼";
    font-size: 12px;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.desktop-nav .wp-block-navigation li:nth-child(2):hover a::after {
    transform: rotate(180deg);
    color: #ffd700;
}

/* ==========================================================================
   Header Actions
   ========================================================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 300px;
    justify-content: flex-end;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.header-search-form {
    position: relative;
}

.header-search-form .wp-block-search__inside-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    border: none;
}

.header-search-form .wp-block-search__input {
    border: none !important;
    padding: 0.75rem 1rem;
    flex-grow: 1;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #333;
    margin: 0;
}

.header-search-form .wp-block-search__input::placeholder {
    color: #666;
    font-size: 13px;
}

.header-search-form .wp-block-search__button {
    background: #2563eb !important;
    border: none !important;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    margin: 0;
    min-width: auto;
}

.header-search-form .wp-block-search__button:hover {
    background: #1d4ed8 !important;
}

.header-search-form .wp-block-search__button svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Account Links & Cart
   ========================================================================== */

.header-account-cart {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.account-link:hover {
    color: #ffd700;
}

.header-actions .wp-block-woocommerce-mini-cart {
    margin-left: 0.5rem;
}

.header-actions .wp-block-woocommerce-mini-cart .wc-block-mini-cart__button {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.header-actions .wp-block-woocommerce-mini-cart .wc-block-mini-cart__button:hover {
    color: #ffd700 !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ==========================================================================
   Mega Menu
   ========================================================================== */

.mega-menu-container {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.mega-menu-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.mega-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mega-menu-close:hover {
    background: #f0f0f0;
    color: #333;
}

.category-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.category-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 0.5rem;
}

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

.category-column li {
    margin-bottom: 0.5rem;
}

.category-column a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.category-column a:hover {
    color: #2563eb;
    background: #f8fafc;
    padding-left: 0.5rem;
}

.mega-menu-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.view-all-categories {
    display: inline-block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-categories:hover {
    background: #1d4ed8;
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #333;
    color: white;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-search {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.mobile-search input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
    background: #f8f9fa;
    color: #2563eb;
}

.has-submenu {
    position: relative;
}

.has-submenu > a {
    padding-right: 3rem;
}

.submenu-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #666;
}

.submenu {
    display: none;
    background: #f8f9fa;
    padding-left: 1rem;
}

.submenu.active {
    display: block;
}

.submenu a {
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    color: #666;
}

.show-more {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    text-align: left;
    width: 100%;
    font-size: 14px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    .category-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-search-form .wp-block-search__inside-wrapper {
        min-width: 200px;
    }
    
    .main-header .header-content {
        padding: 1rem;
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .header-search-form {
        display: none;
    }
    
    .header-account-cart {
        display: none;
    }
    
    .header-actions {
        min-width: auto;
        gap: 1rem;
    }
    
    .main-header .header-content {
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }
    
    .header-logo {
        min-width: auto;
        gap: 0.75rem;
    }
    
    .header-logo .wp-block-site-title a {
        font-size: 1.4rem;
    }
    
    .category-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mega-menu-content {
        padding: 1rem;
    }
    
    .promo-banner p {
        font-size: 12px;
        padding: 0 1rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .header-logo .wp-block-site-title a {
        font-size: 1.2rem;
    }
    
    .mobile-menu {
        width: 100%;
        max-width: none;
    }
    
    .header-logo {
        gap: 0.5rem;
    }
    
    .header-logo .wp-block-site-logo img {
        height: 32px;
    }
}

/* Hamburger animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Accessibility */
.mobile-menu-toggle:focus,
.header-search-form .wp-block-search__button:focus,
.mega-menu-close:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* Body scroll lock */
body.mobile-menu-open,
body.mega-menu-open {
    overflow: hidden;
}

/* Additional WordPress block overrides */
.main-header .wp-block-group {
    margin-bottom: 0;
    margin-top: 0;
}

.main-header .wp-block-group__inner-container {
    padding: 0;
}

/* Ensure proper z-indexing */
.wp-block-template-part {
    position: relative;
    z-index: 1000;
}

/* Additional search form enhancements */
.header-search-form.focused .wp-block-search__inside-wrapper {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    transform: scale(1.02);
}

/* Fix search button icon */
.header-search-form .wp-block-search__button svg {
    fill: currentColor;
    stroke: currentColor;
}

/* Mobile search enhancements */
.mobile-search form {
    width: 100%;
}

.mobile-search input {
    width: 100%;
    box-sizing: border-box;
}

/* Navigation menu specific styling */
.ims-header-nav .wp-block-navigation__container {
    gap: 2rem;
}

.ims-header-nav .wp-block-navigation-item a {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mega menu trigger styling */
.mega-menu-trigger {
    display: none; /* Hidden by default, shown via JavaScript */
}

/* WooCommerce mini cart styling improvements */
.header-actions .wp-block-woocommerce-mini-cart .wc-block-mini-cart__button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    min-height: auto;
}

/* Better button reset for custom buttons */
.mobile-menu-toggle,
.mega-menu-close,
.mobile-menu-close,
.submenu-toggle {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ==========================================================================
   Global Fowkes-Inspired Styles
   ========================================================================== */

:root {
    --color-primary: #f9c457;
    --color-gold-dark: #deb052;
    --color-gold-accent: #e5a742;
    --color-dark: #333333;
    --color-dark-charcoal: #2c3e50;
    --color-gray: #95a5a6;
    --color-light-gray: #d1d5db;
    --color-bg-light: #f9fafb;
    --color-border: #e5e7eb;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Buttons */
.wp-block-button__link,
button[type="submit"],
.button {
    background: linear-gradient(to bottom, #f9c457, #deb052);
    color: #333333;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wp-block-button__link:hover,
button[type="submit"]:hover,
.button:hover {
    background: linear-gradient(to bottom, #deb052, #c99842);
    box-shadow: 0 2px 8px rgba(249, 196, 87, 0.3);
}

/* Links */
a {
    color: #f9c457;
    transition: color 0.2s ease;
}

a:hover {
    color: #deb052;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-dark);
    font-weight: 700;
    line-height: 1.2;
}

/* Logo styling */
.wp-block-site-logo img {
    max-height: 50px;
    width: auto;
}

.wp-block-site-title a {
    font-style: italic;
    font-weight: 700;
    text-decoration: none;
}

/* Ensure proper spacing for sections */
section,
.wp-block-group {
    position: relative;
}

/* Remove gap between header and first content section */
.wp-site-blocks > .wp-block-cover:first-of-type,
.wp-site-blocks > .alignfull:first-of-type {
    margin-top: 0 !important;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; } 