:root {
    --dg-red: #ef394e;
    --dg-gray-100: #f0f0f1;
    --dg-gray-200: #e0e0e2;
    --dg-gray-300: #c3c3ce;
    --dg-gray-400: #a1a3a8;
    --dg-gray-500: #707070;
    --dg-gray-700: #3f404d;
    --dg-blue: #19bfd3;
    --ai-gradient: linear-gradient(90deg, #3f51b5 10%, #9c27b0 30%, #673ab7 100%);
}

.mt_archive_wrapper * { box-sizing: border-box; }

/* -----------------------------------------------------------
   1. VISIBILITY CONTROL
----------------------------------------------------------- */
@media (min-width: 769px) {
    .mt_mobile_only { display: none !important; }
    .mt_bottom_sheet_overlay, .mt_bottom_sheet_ui { display: none !important; }
    .mt_ad_banner_wrapper { display: none !important; }
}
@media (max-width: 768px) {
    .mt_desktop_only { display: none !important; }
    .mt_desktop_header_toolbar { display: none !important; }
    .mt_header_left_part, .mt_header_right_part { display: none !important; }
}

/* -----------------------------------------------------------
   2. GRID SYSTEM
----------------------------------------------------------- */
div#mtMainGrid.mt_main_product_grid { 
    display: grid !important; 
    gap: 1px !important; 
    background: var(--dg-gray-200) !important; 
    border: 1px solid var(--dg-gray-200) !important; 
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
@media (min-width: 769px) {
    div#mtMainGrid.mt_cols_4 { grid-template-columns: repeat(4, 1fr) !important; }
    div#mtMainGrid.mt_cols_5 { grid-template-columns: repeat(5, 1fr) !important; }
    div#mtMainGrid.mt_cols_6 { grid-template-columns: repeat(6, 1fr) !important; }
}

/* -----------------------------------------------------------
   3. CARD STYLING
----------------------------------------------------------- */
.mt_product_card_dt {
    background: #fff;
    padding: 15px;
    position: relative !important; 
    display: flex !important; 
    flex-direction: column !important;
    min-height: 400px !important; 
    transition: all 0.2s ease-in-out !important; 
    cursor: pointer !important;
    min-width: 0 !important; 
    border: none;
    margin: 0 !important;
    overflow: hidden !important;
}

@media (min-width: 769px) {
    .mt_product_card_dt:hover { 
        box-shadow: 0 2px 15px rgba(0,0,0,0.1); 
        z-index: 10 !important; 
    }
}

.mt_product_card_dt.mt_is_oos {
    filter: grayscale(100%);
    opacity: 0.8;
    background-color: #f9f9f9 !important;
}
.mt_product_card_dt.mt_is_oos:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.mt_img_container_dt { 
    width: 100%; 
    aspect-ratio: 1; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin-bottom: 10px; 
    position: relative;
    z-index: 1;
}
.mt_img_container_dt img { 
    width: 240px;
    height: 240px;
    object-fit: contain; 
    max-width: 100%;
    max-height: 100%;
    transition: all 0.3s ease;
}

.mt_content_box_dt {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mt_title_dt { 
    margin-bottom: 8px !important; 
    min-height: 44px !important;
    overflow: hidden !important; 
    padding: 0 !important;
}
.mt_title_dt a {
    font-size: 14px;
    font-weight: 700;
    color: #3f404d;
    text-decoration: none !important;
    line-height: 22px !important;
    display: -webkit-box; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
    font-family: inherit !important;
}

/* Rating & Stock Layout - Fixed Minimum Height to avoid jumping */
.mt_meta_row_dt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: bold;
    min-height: 20px;
}
.mt_delivery_status {
    color: var(--dg-red);
    display: flex;
    align-items: center;
    gap: 4px;
}
.mt_rating_box {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #3f404d;
    margin-right: auto;
}
.mt_rating_star {
    color: #f9bc00;
    font-size: 14px;
}

/* Price Section Layout */
.mt_price_section_dt { 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 4px !important;
    position: relative;
    margin-top: auto !important;
}
.mt_price_main_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.mt_price_old_row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    min-height: 20px;
}

.mt_discount_label { 
    background: var(--dg-red); 
    color: #fff; 
    font-size: 12px !important; 
    font-weight: 700 !important; 
    padding: 0 6px !important; 
    border-radius: 12px !important; 
    height: 20px !important; 
    line-height: 20px !important; 
    display: inline-block !important;
}

.mt_old_price_dt, .mt_old_price_dt span, .mt_old_price_dt bdi, .mt_old_price_dt del { 
    color: var(--dg-gray-300); 
    text-decoration: line-through !important; 
    font-size: 12px !important; 
    font-weight: 400 !important; 
    font-family: inherit !important;
}

.mt_final_price_dt, .mt_final_price_dt span, .mt_final_price_dt bdi { 
    font-size: 16px; 
    font-weight: 700; 
    color: #000; 
    display: flex !important; 
    align-items: center !important; 
    gap: 4px !important; 
    text-decoration: none !important;
    line-height: 1.2 !important;
}

.mt_final_price_dt {
    margin-right: auto;
}

.mt_final_price_dt .woocommerce-Price-currencySymbol {
    font-size: 11px !important;
    font-weight: 400 !important;
}

.mt_special_badge_dt { position: absolute; top: 10px; right: 10px; width: 60px; z-index: 5; }

/* -----------------------------------------------------------
   4. NEW SWATCHES STYLING
----------------------------------------------------------- */
.mt_colors_stack_dt { z-index: 6; display: flex; }

@media (min-width: 769px) {
    .mt_colors_stack_dt {
        position: absolute;
        top: 10px;
        left: 10px;
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .mt_colors_stack_dt {
        position: relative;
        flex-direction: row;
        justify-content: center;
        margin-top: 8px;
        width: 100%;
        height: 20px;
    }
    .mt_dot_color, .mt_dot_color_more {
        border: 1px solid #fff;
        box-sizing: content-box;
    }
    .mt_dot_color:not(:first-child), .mt_dot_color_more {
        margin-right: -4px; 
    }
}

.mt_dot_color {
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}
.mt_dot_color:hover { transform: scale(1.2); z-index: 10; }
.mt_dot_color_more {
    width: 14px; height: 14px; border-radius: 50%; background: #eee; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 9px; color: #555; border: 1px solid #fff; 
    box-shadow: 0 0 2px rgba(0,0,0,0.2); z-index: 5;
    position: relative;
}

/* -----------------------------------------------------------
   5. SKELETON & LOADING
----------------------------------------------------------- */
.mt_loading_init .mt_real_content_wrapper { display: none !important; }
.mt_loaded .mt_skeleton_card { display: none !important; }
.mt_loaded .mt_real_content_wrapper { display: contents !important; }
.elementor-editor-active .mt_skeleton_card { display: none !important; }
.elementor-editor-active .mt_real_content_wrapper { display: contents !important; }

.mt_skeleton_card {
    background: #fff !important; 
    padding: 15px !important; 
    display: flex !important; 
    flex-direction: column !important; 
    min-height: 400px !important;
    border: 1px solid #fff !important;
    box-sizing: border-box !important;
}
.mt_skeleton_inner { width: 100%; height: 100%; display: flex; flex-direction: column; }
.mt_sk {
    background: #f2f2f2;
    background-image: linear-gradient(90deg, #f2f2f2 0px, #e8e8e8 40px, #f2f2f2 80px);
    background-size: 200% 100%;
    animation: mt_shimmer 1.5s infinite linear;
    border-radius: 4px;
    display: block;
}
.mt_sk_img { height: 240px; margin-bottom: 15px; width: 100%; }
.mt_sk_line { display: block; background: #f2f2f2; }
.mt_sk_footer_row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 40px; }
.mt_sk_badge { width: 35px; height: 18px; border-radius: 12px; }
.mt_sk_price_box { width: 90px; height: 25px; }
@keyframes mt_shimmer { 0% { background-position: -150% 0; } 100% { background-position: 150% 0; } }

/* NEW FULL-SCREEN CUSTOM LOADING UI */
.mt_ajax_overlay { 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100vw !important; 
    height: 100vh !important; 
    background: rgba(0,0,0,0.6) !important; 
    z-index: 999999 !important; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
}
.mt_ajax_overlay.active { display: flex; }
.mt_ajax_loader_box { 
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}
.mt_loading_logo { width: 60px; margin-bottom: 15px; display: block; }
.mt_loading_text { font-size: 14px; font-weight: bold; color: #3f404d; margin-bottom: 15px; font-family: inherit;}
.mt_loading_dots span { display: inline-block; width: 8px; height: 8px; background: var(--dg-red); border-radius: 50%; animation: mt_bounce 1.4s infinite ease-in-out both; margin: 0 3px; }
@keyframes mt_bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.mt_ad_banner_wrapper {
    width: 100%;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid var(--dg-gray-100);
    background: #fff;
    grid-column: 1 / -1;
}
.mt_ad_banner_wrapper img, .mt_ad_banner_wrapper video {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* -----------------------------------------------------------
   6. MOBILE STYLING
----------------------------------------------------------- */
@media (max-width: 768px) {
    div#mtMainGrid.mt_main_product_grid { 
        grid-template-columns: 1fr !important;
        border: none !important; 
        background: transparent !important; 
        gap: 0 !important; 
        display: block !important;
    }
    
    .mt_product_card_dt, .mt_skeleton_card { 
        flex-direction: row !important; 
        flex-wrap: nowrap !important;
        padding: 15px !important; 
        border: none !important; 
        border-bottom: 1px solid var(--dg-gray-100) !important;
        min-height: auto !important; 
        width: 100% !important;
        align-items: flex-start !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        transform: none !important;
    }
    .mt_product_card_dt:last-child { border-bottom: none !important; }
    
    .mt_img_container_dt, .mt_sk_img { 
        width: 118px !important; 
        min-width: 118px !important; 
        height: auto !important;
        flex-shrink: 0 !important;
        margin-bottom: 0 !important; 
        margin-left: 15px !important; 
        aspect-ratio: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .mt_img_container_dt a { 
        display: block; 
        width: 118px; 
        height: 118px; 
        position: relative;
    }
    
    .mt_content_box_dt {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        min-height: 118px !important;
    }
    .mt_title_dt { height: auto !important; min-height: auto !important; margin-bottom: 5px !important; }
    .mt_sk_footer_row { margin-top: 15px !important; } 
    .mt_price_section_dt { width: 100% !important; margin-top: auto !important; }
    
    .mt_bottom_sheet_overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; }
    .mt_bottom_sheet_overlay.active { display: block; }
    .mt_bottom_sheet_ui { position: fixed; bottom: -100%; left: 0; right: 0; background: #fff; border-radius: 24px 24px 0 0; z-index: 2001; transition: 0.4s; padding: 24px; max-height: 70vh; overflow-y: auto; display: none; }
    .mt_bottom_sheet_ui.active { bottom: 0; display: block; }
    .mt_sheet_header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }
    .mt_sheet_header h3 { font-size: 16px; margin: 0; font-weight: bold; }
    .mt_close_sheet { font-size: 20px; cursor: pointer; padding: 5px; }
    .mt_sheet_item { padding: 14px 0; border-bottom: 1px solid #eee; cursor: pointer; font-size: 14px; color: #555; }
}

/* -----------------------------------------------------------
   7. DESKTOP TOOLBAR & LOAD MORE
----------------------------------------------------------- */
.mt_desktop_header_toolbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--dg-gray-100); margin-bottom: 15px; padding-bottom: 10px; }
.mt_header_right_part { display: flex; align-items: center; }
.mt_sort_list { display: flex; list-style: none; padding: 0; margin: 0; align-items: center; }
.mt_sort_label { font-size: 12px; font-weight: bold; margin-left: 15px; display: flex; align-items: center; gap: 6px; color: #000; }
.mt_sort_label svg { width: 16px; height: 16px; stroke: currentColor; }
.mt_sort_item { font-size: 12px; color: var(--dg-gray-500); padding: 0 12px; cursor: pointer; transition: 0.3s; }
.mt_sort_item.active { color: var(--dg-red); font-weight: bold; }
.mt_header_left_part { display: flex; align-items: center; gap: 15px; }
.mt_items_count { font-size: 12px; color: var(--dg-gray-400); }
.mt_page_size_control select { border: 1px solid var(--dg-gray-200); border-radius: 4px; padding: 4px; font-size: 12px; color: var(--dg-gray-500); background: #fff; }
.mt_grid_switcher { display: flex; gap: 5px; }
.mt_grid_btn { padding: 4px; border: 1px solid var(--dg-gray-200); border-radius: 4px; cursor: pointer; color: var(--dg-gray-500); display: flex; background: #fff; transition: 0.3s; }
.mt_grid_btn.active { color: var(--dg-red); background: #fff1f2; border-color: var(--dg-red); }
.mt_grid_btn svg { width: 20px; height: 20px; }
.mt_pagination_action { text-align: center; margin: 30px 0; width: 100%; display: block !important; }
button.mt_load_more_btn { padding: 12px 30px; background-color: #fff; border: 1px solid #ccc; border-radius: 8px; cursor: pointer !important; font-size: 14px; font-weight: 700; color: #333; transition: all 0.2s ease !important; width: auto !important; }
button.mt_load_more_btn:hover { border-color: var(--dg-red); color: var(--dg-red); background-color: #fff; }
.mt_end_message { color: var(--dg-gray-400); font-size: 13px; margin-top: 15px; }