/*
Theme Name: SmartCart
Theme URI: https://linhkhi.vn
Author: LinhKhi Team
Author URI: https://linhkhi.vn
Description: Professional WooCommerce theme with purple and orange color scheme
Version: 1.0.0
License: GPL v2 or later
Text Domain: smartcart
Tags: e-commerce, two-columns, right-sidebar, custom-header, custom-menu, featured-images
*/

:root {
    --primary-orange: #f7b267;
    --light-orange: #ffb088;
    --dark-orange: #e67d22;
    --primary-purple: #6c4ccf;
    --light-purple: #d9c7ff;
    --dark-purple: #4b3db3;
    --text-dark: #2a2135;
    --text-light: #6b5f7a;
    --border-color: #eee4f7;
    --background-light: #fffdfb;
    --bg-white: #ffffff;
    --pill-bg: #fff3e5;
    --danger: #e11d48;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
}

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

/* Main Layout with Sidebar */
.site-content {
    min-height: 50vh;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding: 24px 0;
}

.content-area {
    min-width: 0;
}

/* Header Styles */
.site-header {
    background: linear-gradient(180deg, #fff, #fff8fb 90%);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-inner {
    display: grid;
    grid-template-columns: 300px 1fr 150px;
    align-items: center;
    gap: 20px;
}

.site-logo {
    height: 80px;
    width: 300px;
}

.site-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, var(--light-purple), #ffe3bf);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--primary-purple);
    font-weight: 800;
    font-size: 24px;
    text-decoration: none;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-form {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 14px;
}

.search-form button {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.search-form button:hover {
    background: var(--dark-purple);
}

.header-cart {
    justify-self: end;
}

.header-cart .cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: var(--primary-orange);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
}

.header-cart .cart-link:hover {
    background: var(--dark-orange);
    color: white;
}

.header-cart .cart-count {
    background: white;
    color: var(--dark-orange);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #2a2135, #4b0082);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widget h3 {
    color: var(--primary-orange);
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-widget p,
.footer-widget li {
    line-height: 1.8;
    color: #e8e8e8;
}

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

.footer-widget ol {
    list-style: decimal inside;
    padding-left: 5px;
}

.footer-widget li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.footer-widget ol li {
    font-size: 13px;
    margin-bottom: 10px;
}

.footer-widget a {
    color: #e8e8e8;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-widget a:hover {
    color: var(--primary-orange);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: #999;
    font-size: 14px;
}

/* Navigation Menu */
.main-navigation {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    display: block;
    padding: 15px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.menu-item:hover > a {
    background: var(--background-light);
    color: var(--primary-purple);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    display: none;
    z-index: 100;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu li a:hover {
    background: var(--background-light);
    color: var(--primary-orange);
}

.header-cart-old {
    position: relative;
}

.cart-link {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    background: var(--primary-purple);
    padding: 10px 20px;
    border-radius: 20px;
    transition: background 0.3s;
}

.cart-link:hover {
    background: var(--dark-purple);
}

.cart-count {
    background: var(--primary-orange);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-size: 12px;
}

/* Main Navigation */
.main-navigation {
    background: var(--dark-purple);
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.nav-menu > li:hover > a {
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 999;
}

.nav-menu > li:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: var(--background-light);
    color: var(--primary-purple);
}

/* Content Layout */
.site-content {
    display: flex;
    margin-top: 30px;
    max-width: 100%;
    overflow-x: hidden;
}

.content-area {
    flex: 1;
    margin-right: 30px;
    max-width: calc(100% - 330px);
    overflow: hidden;
}

.widget-area {
    width: 300px;
    flex-shrink: 0;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    margin-bottom: 5px;
}

.products-grid.grid-4 {
    grid-template-columns: repeat(6, 1fr);
}

.product-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    padding-bottom: 3px;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    height: 100%;
}

.product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-bottom {
    margin-top: auto;
    padding-top: 2px;
}

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

.product-item img {
    width: 100%;
    max-width: 80px;
    height: 120px;
    max-height: 120px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 5px;
    margin: 0 auto 2px;
    display: block;
}

.product-title {
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-dark);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.product-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 2px;
}

.product-price del,
.regular-price {
    text-decoration: line-through;
    color: rgba(0, 0, 0, 0.3) !important;
    font-size: 11px !important;
    font-weight: normal !important;
    opacity: 0.8;
}

.product-price ins,
.sale-price {
    text-decoration: none;
    color: var(--primary-orange);
    font-weight: bold;
    font-size: 16px;
}

.product-add-to-cart {
    background: var(--primary-purple);
    color: white !important;
    border: none;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
    margin-top: 2px;
}

.product-add-to-cart:hover {
    background: var(--dark-purple);
}

.product-out-of-stock {
    background: #ccc;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    cursor: not-allowed;
    margin-top: 2px;
}

/* Section Headers */
.section-header {
    background: linear-gradient(90deg, var(--primary-purple) 0%, var(--primary-orange) 100%);
    color: white;
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
}

.view-all {
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    transition: background 0.3s;
}

.view-all:hover {
    background: rgba(255,255,255,0.3);
}

/* Slider Styles */
.slider-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
}

.slider-item {
    min-width: 33.333%;
    padding: 0 10px;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-purple);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s;
}

.slider-nav:hover {
    background: var(--dark-purple);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* Flash Sale */
.flash-sale {
    background: linear-gradient(135deg, #ff6b35 0%, #ffb088 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.flash-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.flash-sale-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.countdown {
    background: white;
    color: var(--primary-orange);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

/* Sidebar Widgets */
.widget {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.widget-title {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-orange));
    color: white;
    font-size: 15px;
    font-weight: bold;
    margin: -15px -15px 10px;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.widget-product-list {
    list-style: none;
}

.widget-product-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-product-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.widget-product-info {
    flex: 1;
}

.widget-product-title {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-product-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.widget-product-price .widget-regular-price,
.widget-product-price del {
    color: rgba(0, 0, 0, 0.5);
    font-size: 11px;
    font-weight: normal;
    text-decoration: line-through;
}

.widget-product-price .widget-sale-price,
.widget-product-price ins,
.widget-product-price .amount {
    color: var(--primary-orange);
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, var(--dark-purple) 0%, var(--dark-orange) 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr 0.5fr 0.5fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: white;
}

.footer-widget p {
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
}

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

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-widget ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* Responsive */
@media (max-width: 1200px) {
    .footer-widgets {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-logo img {
        max-width: 200px;
        height: auto;
    }
    
    .header-search {
        margin: 0;
        width: 100%;
    }
    
    .site-content {
        flex-direction: column;
        padding: 10px;
        max-width: 100vw;
    }
    
    .content-area {
        margin-right: 0;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .widget-area {
        width: 100%;
        margin-top: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    /* Fix product images */
    .product-item {
        padding: 8px;
    }
    
    .product-item img,
    .product-image-wrapper img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }
    
    .product-item .product-title {
        font-size: 13px;
        min-height: 40px;
    }
    
    .product-item .product-price {
        font-size: 12px;
    }
    
    /* Fix home boxes */
    .home-box {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .box-categories-slider .box-inner {
        grid-template-columns: 1fr;
    }
    
    .categories-menu-wrapper {
        display: none;
    }
    
    /* Fix featured slider */
    .featured-slider-wrapper {
        padding: 15px;
    }
    
    .featured-products-slider .slider-item {
        flex: 0 0 100%;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    /* Keep 2 columns on mobile for better view */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .product-item {
        padding: 5px;
    }
    
    .product-item .product-title {
        font-size: 11px;
        line-height: 1.3;
        min-height: 35px;
    }
    
    .product-item .product-price {
        font-size: 11px;
    }
    
    .product-item .product-price del {
        font-size: 10px;
    }
    
    /* Fix images */
    .product-item img,
    .product-image-wrapper img {
        max-height: 150px;
    }
    
    /* Navigation menu mobile */
    .main-navigation {
        display: none;
    }
    
    /* Single product page mobile */
    .single-product-container .product-main-content {
        grid-template-columns: 1fr;
    }
    
    .product-gallery .main-image {
        max-height: 250px;
        padding: 10px;
    }
    
    .gallery-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding: 5px 0;
    }
    
    .thumb-item {
        flex: 0 0 60px;
        width: 60px;
        height: 60px;
    }
    
    /* Cart page mobile */
    .shop_table {
        font-size: 12px;
    }
    
    .product-thumbnail img {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Checkout mobile */
    .woocommerce-checkout {
        grid-template-columns: 1fr;
    }
    
    #customer_details {
        padding: 15px;
    }
    
    .woocommerce-checkout-review-order {
        padding: 15px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}