/*
Theme Name: Al Khaleej Solar - FMT Inspired
Theme URI: http://alkhaleejsolars.com/
Author: Manus
Description: A custom WordPress theme for Al Khaleej Solar, inspired by the FMT Online Store design.
Version: 1.4
Text Domain: alkhaleej-solar
*/

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

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

a {
    text-decoration: none;
    color: inherit;
}

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

/* Header */
.site-header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    flex: 0 0 auto;
}

.logo h1 {
    margin: 0;
}

.logo h1 a {
    font-size: 24px;
    font-weight: 800;
    color: #333;
}

.search-bar {
    flex: 1;
    min-width: 200px;
    max-width: 500px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    background: #f1f1f1;
    font-size: 14px;
}

.header-actions {
    flex: 0 0 auto;
}

.cart-link {
    font-weight: bold;
    color: #4db7ad;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Navigation */
.main-navigation {
    background: #4db7ad;
    color: #fff;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.archive .main-navigation,
body.single-product .main-navigation,
body.tax-product_cat .main-navigation {
    background: #4db7ad !important;
    color: #fff !important;
}

.nav-flex {
    display: flex;
    align-items: center;
    overflow-x: auto;
}

.fmt-main-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    min-width: min-content;
}

.fmt-main-menu li {
    flex: 0 0 auto;
}

.fmt-main-menu li a {
    display: block;
    padding: 15px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    white-space: nowrap;
}

.fmt-main-menu li a:hover {
    background: rgba(0,0,0,0.1);
}

.sale-badge {
    background: #000;
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: bold;
}

/* Slider */
.home-slider {
    margin-top: 20px;
    margin-bottom: 40px;
}

.swiper {
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.swiper-wrapper {
    display: flex;
}

.swiper-slide {
    width: 100%;
    height: auto;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.swiper-slide .slide-content {
    width: 100%;
    height: auto;
    background-image: none !important;
    background-color: transparent !important;
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
    gap: 15px;
    padding: 20px;
    box-sizing: border-box;
}

.swiper-slide .slide-overlay {
    background: transparent;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.slide-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

.slide-overlay {
    background: rgba(0,0,0,0.4);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-label {
    display: none;
}

.slide-text {
    display: none;
}

.slide-text h2 {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: 800;
}

.slide-text p {
    font-size: 18px;
    margin-bottom: 30px;
    font-weight: 400;
}

.btn {
    display: inline-block;
    padding: 12px 35px;
    background: #4db7ad;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Product Slider Styles */
.swiper-slide .product-card {
    width: 100%;
    margin: 0;
}

.swiper-pagination {
    display: flex !important;
    justify-content: center;
    margin-top: 20px;
}

.swiper-pagination-bullet {
    background: #4db7ad !important;
    opacity: 0.5;
    width: 10px;
    height: 10px;
}

.swiper-pagination-bullet-active {
    background: #4db7ad !important;
    opacity: 1;
}

.swiper-button-prev,
.swiper-button-next {
    display: flex !important;
    color: #4db7ad;
    background: #f0f0f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 18px;
}

/* Sections */
.section-header {
    text-align: center;
    padding: 40px 0 20px;
}

.section-header h2 {
    font-size: 28px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding-bottom: 50px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.badge {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-new { background: #4db7ad; color: #fff; }
.badge-sale { background: #ffc107; color: #333; position: absolute; top: 10px; right: 10px; }

.product-image {
    padding: 20px;
    background: #fff;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
}

.product-price {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 10px;
}

.price-current {
    font-size: 18px;
    font-weight: bold;
    color: #4db7ad;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #4db7ad;
    color: #fff;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s;
    cursor: pointer;
    font-size: 14px;
}

/* WooCommerce Page Layout */
.woocommerce-page .site-main {
    padding: 40px 0;
}

.woocommerce-page .container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}

/* Footer */
.site-footer {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #4db7ad;
}

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

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

.footer-widget a {
    color: #aaa;
    transition: color 0.3s;
}

.footer-widget a:hover {
    color: #4db7ad;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .swiper-slide .slide-content {
        gap: 12px;
        padding: 15px;
    }
}

@media (max-width: 992px) {
    .swiper-slide .slide-content {
        grid-template-columns: repeat(var(--grid-cols-tablet, 2), 1fr);
        gap: 12px;
        padding: 15px;
    }
    
    .fmt-main-menu li a {
        padding: 12px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .header-main {
        flex-direction: column;
        text-align: center;
    }
    
    .search-bar {
        margin: 10px 0;
        width: 100%;
        max-width: 100%;
    }
    
    .fmt-main-menu {
        flex-wrap: wrap;
    }
    
    .fmt-main-menu li a {
        padding: 10px 10px;
        font-size: 11px;
    }
    
    .swiper-slide .slide-content {
        gap: 10px;
        padding: 10px;
    }
    
    .product-image {
        height: 150px;
        padding: 15px;
    }
    
    .product-title {
        font-size: 13px;
        height: 35px;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .add-to-cart-btn {
        padding: 10px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .logo h1 a {
        font-size: 18px;
    }
    
    .search-bar input {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .cart-link {
        font-size: 12px;
    }
    
    .fmt-main-menu li a {
        padding: 8px 8px;
        font-size: 10px;
    }
    
    .swiper-slide .slide-content {
        grid-template-columns: 1fr !important;
        gap: 8px;
        padding: 8px;
    }
    
    .product-image {
        height: 120px;
        padding: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 12px;
        height: 30px;
        margin-bottom: 5px;
    }
    
    .price-current {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 35px;
        height: 35px;
    }
    
    .swiper-button-prev::after,
    .swiper-button-next::after {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .swiper-slide .slide-content {
        grid-template-columns: 1fr !important;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
