/*
Theme Name: Old Chicago
Description: A modern WordPress theme celebrating Chicago's cultural heritage and iconic landmarks with original designs.
Author: Old Chicago
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: e-commerce, woocommerce, vintage, chicago, magic, history, responsive, custom-colors
Text Domain: vintage-chicago

Old Chicago WordPress Theme, Copyright 2024
Old Chicago Theme is distributed under the terms of the GNU GPL v2
*/

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #444;
    background-color: #ffffff;
    text-align: center;
    font-size: 15px;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #005a87;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #003e5f;
    text-decoration: none;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Inter', 'Segoe UI', sans-serif;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #222;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: #666;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-half {
    flex: 0 0 50%;
    padding: 0 15px;
}

.col-third {
    flex: 0 0 33.333%;
    padding: 0 15px;
}

.col-quarter {
    flex: 0 0 25%;
    padding: 0 15px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: #f8f9fa;
    color: #333;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 0;
    margin: 0;
    line-height: 0;
}

.site-logo {
    height: 60px !important;
    max-height: 60px !important;
    width: auto !important;
    vertical-align: middle;
}

.site-title-text {
    font-size: 2.2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #222;
    text-decoration: none;
    margin: 0;
    display: none; /* Hidden when logo is present */
}

.site-title:hover {
    color: #005a87;
    text-decoration: none;
}

.site-description {
    font-size: 1rem;
    color: #777;
    font-style: italic;
    margin: 0;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

/* Ensure cart icon is visible */
.menu-item-cart {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.menu-item-cart a {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    color: #444;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.menu-item-cart a:hover {
    background: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
}

.menu-item-cart i {
    font-size: 1.1rem;
}

.cart-contents-count {
    background: #c41e3a;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: #444;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #005a87;
    text-decoration: none;
    outline: none;
    box-shadow: none;
}

.nav-menu a:focus {
    outline: none !important;
    box-shadow: none !important;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #005a87;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.nav-menu .menu-item-has-children {
    position: relative;
}

/* Remove dropdown arrows - use underline effect instead */
.nav-menu .menu-item-has-children > a::after {
    display: none !important;
}

.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
    border: 1px solid #e0e0e0;
    display: none;
}

.nav-menu .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
}

/* Hide third-level submenus by default */
.nav-menu .sub-menu .sub-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    z-index: 1001;
    display: none;
}

/* Show third-level submenus only on hover of parent */
.nav-menu .sub-menu .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
}



/* Ensure submenu items are properly styled */
.nav-menu .sub-menu li {
    margin: 0;
    width: 100%;
    display: block !important;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #444;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: none;
    border-bottom: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #444;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: none;
    border-bottom: none;
    transition: all 0.3s ease;
}

.nav-menu .sub-menu a::after {
    display: none;
}

.nav-menu .sub-menu a:hover {
    background: #f8f8f8;
    color: #c41e3a;
    padding-left: 2rem;
}

/* Third level dropdown (if needed) */
.nav-menu .sub-menu .menu-item-has-children {
    position: relative;
}

/* Remove submenu dropdown arrows */
.nav-menu .sub-menu .menu-item-has-children > a::after {
    display: none !important;
}

/* Third level dropdown positioning - now handled above */

.nav-menu .sub-menu .sub-menu a {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

/* Menu Icons */
.menu-item-icon a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-item-icon i {
    font-size: 1.2rem;
}

.cart-contents-count {
    background: #c41e3a;
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 1.5rem;
    text-align: center;
    display: inline-block;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle-icon span {
    width: 25px;
    height: 3px;
    background: #000;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle:hover .menu-toggle-icon span {
    background: #c41e3a;
}

.menu-toggle.active .menu-toggle-icon span {
    background: #c41e3a;
}

.menu-toggle.active .menu-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Force mobile menu styles to take effect */
@media (max-width: 768px) {
    .nav-menu {
        background: #2c1810 !important;
        color: #fff !important;
    }
    
    .nav-menu a {
        color: #fff !important;
    }
    
    .nav-menu .sub-menu {
        background: #1a0f0a !important;
    }
    
    .nav-menu .sub-menu a {
        color: #d4af37 !important;
    }
    
    .nav-menu .sub-menu .sub-menu {
        background: #0f0805 !important;
    }
    
    .nav-menu .sub-menu .sub-menu a {
        color: #b8941f !important;
    }
}

/* Desktop Navigation - Ensure submenus work properly */
@media (min-width: 769px) {
    .nav-menu .sub-menu {
        display: none;
    }
    
    .nav-menu .menu-item-has-children:hover .sub-menu {
        display: block !important;
    }
    
    /* Third-level submenus should be hidden by default */
    .nav-menu .sub-menu .sub-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    /* Only show third-level submenus when hovering over their direct parent */
    .nav-menu .sub-menu .menu-item-has-children:hover .sub-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Prevent third-level submenus from showing when hovering over Shop */
    .nav-menu .menu-item-has-children:hover .sub-menu .sub-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* Mobile Dropdown Adjustments */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c1810;
        box-shadow: 0 8px 30px rgba(0,0,0,0.3);
        flex-direction: column;
        padding: 0;
        z-index: 1000;
        border-top: 3px solid #c41e3a;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #444;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        padding: 1.2rem 2rem;
        color: #ffffff !important;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
    }
    
    .nav-menu a:hover {
        background: #c41e3a;
        color: #ffffff !important;
        padding-left: 2.5rem;
    }
    
    /* Hide submenus by default on mobile */
    .nav-menu .sub-menu {
        display: none;
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: #1a0f0a;
        border-radius: 0;
        margin: 0;
        padding: 0;
        border-top: 1px solid #444;
        border-bottom: 1px solid #444;
    }
    
    /* Show submenus only when parent has 'active' class */
    .nav-menu .menu-item-has-children.active .sub-menu {
        display: block;
    }
    
    .nav-menu .sub-menu a {
        padding: 1rem 2.5rem;
        font-size: 0.9rem;
        color: #ffffff !important;
        border-bottom: 1px solid #333;
    }
    
    .nav-menu .sub-menu a:hover {
        background: #c41e3a;
        color: #ffffff !important;
        padding-left: 3rem;
    }
    
    /* Hide third-level submenus by default */
    .nav-menu .sub-menu .sub-menu {
        display: none;
        background: #0f0805;
        border-top: 1px solid #333;
    }
    
    /* Show third-level submenus only when parent has 'active' class */
    .nav-menu .sub-menu .menu-item-has-children.active .sub-menu {
        display: block;
    }
    
    .nav-menu .sub-menu .sub-menu a {
        padding: 0.8rem 3rem;
        font-size: 0.85rem;
        color: #ffffff !important;
    }
    
    .nav-menu .sub-menu .sub-menu a:hover {
        background: #c41e3a;
        color: #ffffff !important;
        padding-left: 3.5rem;
    }
    
    /* Remove mobile dropdown arrows too */
    .nav-menu .menu-item-has-children > a::after {
        display: none !important;
    }
    
    /* Menu icons styling for mobile */
    .menu-item-icon a {
        color: #ffffff !important;
    }
    
    .menu-item-icon i {
        color: #ffffff !important;
    }
    
    .cart-contents-count {
        background: #c41e3a;
        color: #fff;
    }
}

/* Remove focus outline from navigation */
.nav-menu a:focus,
.nav-menu a:focus-visible,
.nav-menu a:active,
.nav-menu a:focus-within {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* Also target any pseudo-elements */
.nav-menu a:focus::before,
.nav-menu a:focus::after {
    outline: none !important;
    box-shadow: none !important;
}

/* WordPress admin bar override if needed */
.nav-menu a:focus:not(.ab-item) {
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
    background: #f8f9fa;
    color: #333;
    text-align: center;
    padding: 6rem 0;
    margin-bottom: 5rem;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #222;
    text-shadow: none;
}

.hero-content .lead {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    color: #555;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    background: #005a87;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(0, 90, 135, 0.25);
}

.btn:hover {
    background: #003e5f;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 90, 135, 0.35);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #c41e3a;
    border: 2px solid #c41e3a;
    color: #fff;
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.25);
}

.btn-secondary:hover {
    background: #a0182e;
    border-color: #a0182e;
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.35);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    padding: 2rem 0;
}

.content-area {
    flex: 1;
    margin-right: 2rem;
}

.sidebar {
    flex: 0 0 300px;
}

/* ==========================================================================
   CARDS & FEATURES
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: #c41e3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.5rem;
}

/* ==========================================================================
   WOOCOMMERCE STYLES
   ========================================================================== */

.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    justify-content: start !important; /* Changed from center to start to align products from the left */
    gap: 2rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 2rem 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.woocommerce ul.products li.product {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
    padding: 1.5rem !important;
    transition: all 0.3s ease !important;
    border: 1px solid #f0f0f0 !important;
    width: 100% !important;
    min-width: 280px !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 420px !important;
    display: flex !important;
    flex-direction: column !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

.woocommerce ul.products li.product img {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
    flex-shrink: 0 !important;
    background: #f5f5f5 !important;
    border: 1px solid #e0e0e0 !important;
}

/* Fallback for missing images */
.woocommerce ul.products li.product img[src=""],
.woocommerce ul.products li.product img:not([src]),
.woocommerce ul.products li.product img[src*="placeholder"] {
    background: linear-gradient(45deg, #f5f5f5 25%, transparent 25%), 
                linear-gradient(-45deg, #f5f5f5 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f5f5f5 75%), 
                linear-gradient(-45deg, transparent 75%, #f5f5f5 75%) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px !important;
}

/* Ensure product link containers maintain proper dimensions */
.woocommerce ul.products li.product .woocommerce-loop-product__link img {
    min-height: 250px !important;
    max-height: 250px !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    flex-grow: 1;
}

.woocommerce ul.products li.product .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c41e3a;
    margin-bottom: 1rem;
    margin-top: auto;
}

.woocommerce .add_to_cart_button {
    background: #2c1810;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    cursor: pointer;
    margin-top: auto;
}

.woocommerce .add_to_cart_button:hover {
    background: #c41e3a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.2);
    color: #fff;
}

/* Product grid mobile responsive */
@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        justify-content: start !important; /* Changed from center to start to align products from the left */
    }
    
    .woocommerce ul.products li.product {
        width: 100% !important;
        max-width: 400px !important;
        min-width: 280px !important;
        padding: 1rem !important;
        min-height: 350px !important;
        margin: 0 auto !important;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: #f8f9fa;
    color: #555;
    padding: 5rem 0 2rem;
    margin-top: 6rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.footer-section.about-section {
    text-align: justify;
}

.footer-section h3 {
    color: #222;
    margin-bottom: 2rem;
    font-size: 1.4rem;
}

.footer-section p,
.footer-section a {
    color: #0073aa;
    line-height: 1.8;
}

.footer-section a:hover {
    color: #005a87;
}

.footer-bottom {
    border-top: 1px solid #e5e5e5;
    padding-top: 2rem;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.justified-text {
    text-align: justify;
}

.policies-links ul, .policies-links ul.no-bullets {
    list-style-type: none !important;
    padding-left: 0 !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .lead {
        font-size: 1.2rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-menu {
        margin-top: 1rem;
    }
    
    .nav-menu li {
        margin: 0 1rem;
    }
    
    .content-area {
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-half,
    .col-third,
    .col-quarter {
        flex: 1;
        margin-bottom: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li {
        margin: 0.5rem 0;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}