/*
 Theme Name: Sim Child
 Theme URI:  https://example.com/sim-child
 Description: Child theme for SIM shop with custom home page template and AJAX functionality
 Author:     You
 Template:   storefront
 Version:    1.1.1
*/

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --primary-color: #0066cc;
    --secondary-color: #00cc66;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

a:focus,
button:focus,
.button.alt:focus,
input:focus,
textarea:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
    outline-color: #7f54b300 !important;
}

/* ============================================
   HEADER
   ============================================ */

.order-btn{
    display:flex;
        align-items: center;
        gap: 5px;
        justify-content: center;
        border-radius: 5px;
        padding: 5px 10px;
}
.order-btn img{
   max-height: 32px;
       filter: brightness(0.7);
}
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    margin-bottom: 0 !important;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.main-navigation {
    flex: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Header Search */
.header-search {
    position: relative;
   display: flex;
   align-items: center;
   flex-direction: row-reverse;
   gap: 8px ;
}

.search-form {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border-color: #d5d5d500 !important;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
}

.search-results {
    padding: 5px 13px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-item {
    display: flex;
    gap: 1rem;
    padding: 5px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    align-items: center;
}

.search-item:hover {
    background: var(--bg-light);
}

.search-item-image {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.search-item-title {
    font-weight: 600;
    margin-bottom: -5px;
}

.search-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.8), rgba(0, 204, 102, 0.8));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 1px 1px 0 #000000;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    color: #ffffff;
    text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 1px 1px 0 #000000;
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.categories-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.category-count {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */
.products-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.products-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.filter-select,
.filter-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95rem;
    min-width: 200px;
}

.filter-select:focus,

/* Product Card (based on user's image) */
.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-link {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.product-image {
    position: relative;
    padding: 10px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image img {
    max-width: 100%;
    height: auto;
}

.product-price-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.product-info {
    padding: 1rem 1rem 0 1rem;
    text-align: center;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-operator {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-buy {
    flex: 1;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.8), rgba(0, 204, 102, 0.8));
    color: var(--white);
    transition: .6s;
}

.btn-buy:hover {
    transition: .6s;
    color: white;
    background: linear-gradient(135deg, #00cc66cc, #0066cccc);
}

.btn-wishlist {
    display: none !important;
    width: 50px;
    background: var(--white);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-wishlist:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.8), rgba(0, 204, 102, 0.8)) !important;
    color: var(--white);
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-inner {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--white);
    color: var(--text-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.8), rgba(0, 204, 102, 0.8));
    color: var(--white);
    border-color: transparent !important;
}

.page-dots {
    color: var(--text-light);
    padding: 0 0.5rem;
}

/* ============================================
   TEXT SECTION
   ============================================ */
.text-section {
    padding: 4rem 0;
}

.text-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.text-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
       background: #767474;
    color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
}

form {
    margin-bottom: 0 !important;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo img {
    max-height: 40px !important;
    max-width: 220px !important;
    object-fit: contain;
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.loading,
.no-products,
.error {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.products-filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.filter-group.search-group{
    max-width: 230px;
}
.filter-group.full-width {
    flex-basis: 100%;
    order: -1;
    /* Categories on top */
}

.category-filters-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cat-filter-btn {
    cursor: pointer;
    position: relative;
}

.cat-filter-btn input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cat-filter-btn span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-weight: 600;
    color: var(--text-color);
    transition: var(--transition);
}

.cat-filter-btn input:checked+span,
.cat-filter-btn:hover span {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-inputs input {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.products-grid{
        display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 20px;
}
.filter-cards{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 50px;
}
.op-code-select{
        border-radius: 5px;
    padding: .6180469716em;
    background-color: #f2f2f2;
    color: #43454b;
    border: 0;
    /* -webkit-appearance: none; */
    box-sizing: border-box;
    font-weight: 400;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .125);
    width: 100%;
}
.card-info span{
    display: flex;
    /* width: 100%; */
    /* justify-content: center; */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    justify-content: center;
}
/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .search-form {
        max-height: 0;
        overflow: hidden;
    }

    .search-form.active {
        max-height: 100vh;
    }
        .separator {
            display: none;
        }
    }

    @media (max-width: 768px) {
        .products-grid {
            grid-template-columns: 1fr 1fr;
        }
        .filter-group.search-group{
            max-width: 100%;
        }
        #filter-search{
            max-width: 100%!important;
        }
    }

    @media (max-width: 480px) {
        .products-grid {
            grid-template-columns: 1fr 1fr;
        }

        .product-image {
            padding: 10px;
        }

        .product-info {
            padding: 10px;
        }

        .product-actions {
            padding: 10px;
        }

        .product-operator {
            margin-bottom: 0;
        }

        .product-title {
            font-size: 19px;
            font-weight: 700;
        }

        .product-price-badge {
            position: absolute;
            top: 0;
            right: 0;
            background: var(--white);
            color: #e74c3c;
            font-weight: 700;
            font-size: 15px;
            padding: 1px 10px;
            border-radius: 10px;
            box-shadow: var(--shadow);
        }

    }

    /* ============================================
   ORDER POPUP
   ============================================ */
    /* Overlay */
    .order-popup-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 16, 20, 0.75);
        backdrop-filter: blur(4px);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }

    /* Popup */
    .order-popup {
        background: #fff;
        width: 100%;
        max-width: 420px;
        border-radius: 16px;
        padding: 28px 24px 24px;
        position: relative;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
        animation: popupFade 0.3s ease-out;
    }

    /* Title */
    .order-popup h3 {
        margin: 0 0 20px;
        font-size: 22px;
        font-weight: 600;
        text-align: center;
        color: #111;
    }

    /* Close button */
    .close-popup {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: transparent;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        transition: background 0.2s, transform 0.2s;
    }

    .close-popup:hover {
        background: #e5e5e5;
        transform: rotate(90deg);
    }

    /* Form */
    .order-popup .form-group {
        margin-bottom: 16px;
    }

    .order-popup label {
        display: block;
        font-size: 14px;
        margin-bottom: 6px;
        color: #555;
    }

    .order-popup input {
        width: 100%;
        height: 44px;
        padding: 0 14px;
        border-radius: 10px;
        border: 1px solid #ddd;
        font-size: 15px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .order-popup input:focus {
        outline: none;
        border-color: #5b6cff;
        box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.15);
    }

    .order-popup input[readonly] {
        background: #f7f7f7;
        color: #666;
    }

    /* Submit button */
    .btn-submit-order {
        width: 100%;
        height: 46px;
        border-radius: 12px;
        border: none;
        background: linear-gradient(135deg, #5b6cff, #7c4dff);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.15s, box-shadow 0.15s;
    }

    .btn-submit-order:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 25px rgba(91, 108, 255, 0.35);
    }

    /* Message */
    .order-message {
        margin-top: 14px;
        font-size: 14px;
        text-align: center;
    }

    /* Animation */
    @keyframes popupFade {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* Mobile */
    @media (max-width: 480px) {
        .order-popup {
            margin: 0 12px;
            padding: 24px 18px;
        }
    }


    /* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .site-header{
            padding: 0.5rem 0!important;
    }
    .search-form {
        max-height: 0;
        overflow: hidden;
    }
    .mobile-menu-toggle{
        display: none!important;
    }
    .search-form.active {
        max-height: 100vh;
        overflow: visible;
    }
    .site-logo img{
        max-height: 66px;
    }
    .search-form{
        display: none;
    }
    .header-inner {
        flex-wrap:no-wrap;
        gap: 1rem;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 4;
    }

    .main-navigation.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        background: white;
        margin-bottom: 0;
        max-height: 100vh;
    }

    .mobile-menu-toggle {
        display: flex;
        background-color: #d5d5d500 !important;
        border-color: #d5d5d500 !important;
        outline-color: #7f54b300 !important;
    }

    .header-search {
        width: 100%;
        order: 3;
        max-width: 100%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .products-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .price-inputs input {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 20px;
}
#filter-search{
    max-width: 230px;
}
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .price-inputs{
        flex-direction: column;
    }
    .separator{
        display: none;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hero-content{
        padding: 2rem 0;
    }
    .filter-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.filter-card{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-info span{
    font-size: 16px;
}
.loading{
    width:95vw;
    text-align: center;
}
}

@media (max-width: 480px) {
    .btn-secondary{
        width: 100%;
    }
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
    .product-image{
        padding: 10px;
    }
    .product-info{
        padding: 10px;
    }
    .product-actions{
        padding: 10px;
    }
    .product-operator{
        margin-bottom: 0;
    }
    .product-title{
            font-size: 19px;
    font-weight: 700;
    }
    .product-price-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--white);
    color: #e74c3c;
    font-weight: 700;
    font-size: 15px;
    padding: 1px 10px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

}