/* ================================================================
   TABBED MENU PLUGIN — Frontend CSS
   All colors via CSS variables set inline from plugin settings
   ================================================================ */

/* ── Reset & Container ── */
.tmp-wrapper *,
.tmp-wrapper *::before,
.tmp-wrapper *::after {
    box-sizing: border-box;
}
.tmp-wrapper {
    font-family: inherit;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 40px;
    color: var(--tmp-text, #000);
    position: relative;
}

/* ================================================================
   TOP CATEGORY TABS
   ================================================================ */
.tmp-top-tabs-wrap {
    position: relative;
    background: var(--tmp-secondary, #fff);
    border-bottom: 3px solid var(--tmp-primary, #e30613);
    display: flex;
    align-items: center;
    overflow: hidden;
}
.tmp-top-tabs {
    display: flex;
    flex-direction: row;
    flex-nowrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    padding: 10px 4px;
    gap: 4px;
}
.tmp-top-tabs::-webkit-scrollbar { display: none; }

.tmp-top-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--tmp-tab-in-text, #e30613);
    transition: all 0.2s ease;
    min-width: 80px;
    line-height: 1.2;
}
.tmp-top-tab:hover {
    background: rgba(227, 6, 19, 0.08);
}
.tmp-top-tab.active {
    background: var(--tmp-tab-act-bg, #e30613);
    color: var(--tmp-tab-act-text, #fff);
    font-weight: 600;
}
.tmp-tab-icon {
    font-size: 26px;
    line-height: 1;
}
.tmp-tab-label {
    font-size: 12px;
    text-align: center;
}

/* Scroll Buttons */
.tmp-scroll-btn {
    background: var(--tmp-primary, #e30613);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 0 10px;
    align-self: stretch;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    z-index: 2;
    flex-shrink: 0;
}
.tmp-scroll-btn:hover { opacity: 0.85; }
.tmp-scroll-btn.hidden { display: none; }

/* ================================================================
   SUB-TABS BAR
   ================================================================ */
.tmp-sub-tabs-wrap {
    background: var(--tmp-primary, #e30613);
    padding: 0 16px;
    overflow: hidden;
}
.tmp-sub-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    padding: 8px 0;
    scrollbar-width: none;
}
.tmp-sub-tabs::-webkit-scrollbar { display: none; }
.tmp-sub-tab {
    background: transparent;
    border: 2px solid transparent;
    color: rgba(255,255,255,0.85);
    padding: 7px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}
.tmp-sub-tab:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.tmp-sub-tab.active {
    background: var(--tmp-secondary, #fff);
    color: var(--tmp-primary, #e30613);
    font-weight: 700;
    border-color: transparent;
}

/* ================================================================
   PANELS
   ================================================================ */
.tmp-cat-panel  { display: none; }
.tmp-cat-panel.active { display: block; }
.tmp-sub-panel  { display: none; }
.tmp-sub-panel.active { display: block; }

/* ================================================================
   PRODUCT GRID
   ================================================================ */
.tmp-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--tmp-cols, 3), 1fr);
    gap: 16px;
    padding: 20px 0;
}
@media (max-width: 768px) {
    .tmp-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .tmp-product-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* ================================================================
   PRODUCT CARD
   ================================================================ */
.tmp-product-card {
    background: var(--tmp-card-bg, #fff);
    border-radius: var(--tmp-radius, 8px);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s, transform 0.25s;
}
.tmp-product-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    transform: translateY(-2px);
}

/* Sale badge */
.tmp-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--tmp-primary, #e30613);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* Image */
.tmp-product-img-link { display: block; text-decoration: none; }
.tmp-product-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tmp-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}
.tmp-product-card:hover .tmp-product-img-wrap img {
    transform: scale(1.05);
}

/* Info */
.tmp-product-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.tmp-product-name {
    margin: 0;
    font-size: var(--tmp-name-size, 15px);
    font-weight: 600;
    color: var(--tmp-text, #000);
    line-height: 1.3;
}
.tmp-product-name a {
    color: inherit;
    text-decoration: none;
}
.tmp-product-name a:hover {
    color: var(--tmp-primary, #e30613);
}
.tmp-sku {
    font-size: 11px;
    color: #999;
}
.tmp-short-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.tmp-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.tmp-reg-price {
    font-size: 12px;
    color: #999;
}
.tmp-price-badge {
    background: var(--tmp-price-bg, #ffe000);
    color: var(--tmp-price-color, #e30613);
    font-size: var(--tmp-price-size, 14px);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* Add to Cart Button */
.tmp-btn-cart {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--tmp-btn-bg, #e30613);
    color: var(--tmp-btn-text, #fff) !important;
    border: none;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    margin-top: auto;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
}
.tmp-btn-cart:hover {
    opacity: 0.88;
    transform: scale(1.02);
}
.tmp-btn-cart.added {
    background: #28a745;
}
.tmp-btn-cart.adding {
    opacity: 0.7;
    cursor: wait;
}

/* ================================================================
   LOADING SPINNER
   ================================================================ */
.tmp-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}
