:root {
    --primary-orange: #FF7F00;
    --primary-blue: #0062FF;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --text-dark: #2C3E50;
    --text-gray: #4A5568;
    --border-light: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ========== دکمه افزودن - 3 سایز ========== */
.tgc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FF7F00, #FF9F40);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255,127,0,0.3);
    position: relative;
    white-space: nowrap;
}

/* سایز کوچک */
.tgc-btn--small {
    padding: 8px 18px;
    font-size: 12px;
    gap: 6px;
}

.tgc-btn--small .tgc-btn-icon svg {
    width: 14px;
    height: 14px;
}

/* سایز متوسط */
.tgc-btn--medium {
    padding: 10px 22px;
    font-size: 13px;
    gap: 7px;
}

.tgc-btn--medium .tgc-btn-icon svg {
    width: 16px;
    height: 16px;
}

/* سایز بزرگ */
.tgc-btn--large {
    padding: 14px 30px;
    font-size: 15px;
    gap: 10px;
}

.tgc-btn--large .tgc-btn-icon svg {
    width: 18px;
    height: 18px;
}

.tgc-btn:hover {
    background: linear-gradient(135deg, #0062FF, #0052D9);
    box-shadow: 0 4px 15px rgba(0,98,255,0.3);
    transform: translateY(-2px);
}

.tgc-btn.added {
    background: linear-gradient(135deg, #0062FF, #0052D9);
    box-shadow: 0 4px 15px rgba(0,98,255,0.3);
}

.tgc-btn-icon {
    display: flex;
    align-items: center;
}

.tgc-btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tgc-btn.loading .tgc-btn-text,
.tgc-btn.loading .tgc-btn-icon { opacity: 0; }

.tgc-btn.loading .tgc-btn-loader {
    display: block;
    position: absolute;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Toast ========== */
.tgc-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 20px 24px;
    background: var(--text-dark);
    color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 999999;
    animation: toastIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 420px;
}

.tgc-toast.success { background: linear-gradient(135deg, #0062FF, #0052D9); }
.tgc-toast.warning { background: linear-gradient(135deg, #FF7F00, #FF9F40); }
.tgc-toast.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }

.tgc-toast-msg { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.tgc-toast-text { font-size: 15px; font-weight: 500; }

.tgc-toast-action {
    display: inline-flex;
    padding: 10px 20px;
    background: rgba(255,255,255,0.25);
    color: #fff !important;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
}

.tgc-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 24px;
}

@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } }
.tgc-toast.hide { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ========== حالت خالی ========== */
.tgc-empty {
    text-align: center;
    padding: 100px 40px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    margin: 30px 0;
    border: 2px solid var(--border-light);
}

.tgc-empty svg {
    stroke: var(--primary-orange);
    margin-bottom: 25px;
}

.tgc-empty h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0 0 25px;
}

.tgc-empty a {
    display: inline-block;
    padding: 16px 36px;
    background: linear-gradient(135deg, #FF7F00, #FF9F40);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
}

/* ========== صفحه مقایسه ========== */
.tgc-wrap {
    direction: rtl;
    margin: 30px auto;
    max-width: 100%;
    padding: 0 15px;
}

.tgc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-orange);
}

.tgc-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-orange);
    margin: 0;
}

.tgc-header span {
    padding: 10px 20px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

/* ========== جدول دسکتاپ ========== */
.tgc-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-white);
    border: 2px solid var(--border-light);
}

.tgc-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.tgc-table th,
.tgc-table td {
    padding: 16px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.tgc-table thead th {
    background: linear-gradient(180deg, var(--bg-white), var(--bg-light));
    border-bottom: 3px solid var(--primary-orange);
    vertical-align: top;
}

.tgc-table tbody tr:nth-child(even) { background: var(--bg-light); }
.tgc-table tbody tr:hover { background: rgba(255,127,0,0.05); }

.tgc-label-col,
.tgc-label {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--text-dark);
    text-align: right !important;
    min-width: 150px;
    border-left: 3px solid var(--primary-orange);
    position: sticky;
    right: 0;
}

.tgc-product-col {
    min-width: 200px;
    padding: 20px 15px;
}

/* ========== کارت محصول دسکتاپ - هم‌ارتفاع ========== */
.tgc-card {
    position: relative;
    text-align: center;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 18px 12px;
    border: 2px solid var(--border-light);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.tgc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-orange);
}

/* دکمه حذف - SVG داخلی */
.tgc-remove {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: var(--bg-white);
    color: #dc2626;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: all 0.25s;
}

.tgc-remove:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: scale(1.1);
}

.tgc-remove:hover svg {
    stroke: #fff;
}

.tgc-remove svg {
    stroke: #dc2626;
    transition: stroke 0.25s;
}

.tgc-img-link {
    display: block;
    margin-bottom: 12px;
}

.tgc-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    padding: 8px;
    border: 2px solid var(--border-light);
    transition: transform 0.3s;
}

.tgc-card:hover img {
    transform: scale(1.05);
    border-color: var(--primary-orange);
}

.tgc-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-dark);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tgc-card h4 a {
    color: inherit;
    text-decoration: none;
}

.tgc-card h4 a:hover { color: var(--primary-orange); }

.tgc-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 12px;
}

.tgc-price del {
    color: #999;
    font-size: 13px;
    margin-right: 6px;
}

.tgc-view {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #FF7F00, #FF9F40);
    color: #fff !important;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: auto;
}

.tgc-view:hover {
    background: linear-gradient(135deg, #0062FF, #0052D9);
    color: #fff !important;
    transform: translateY(-2px);
}

.tgc-val {
    font-size: 14px;
    color: var(--text-gray);
}

.tgc-no-specs {
    text-align: center;
    padding: 60px 20px !important;
    color: var(--text-gray);
}

/* ========== موبایل ========== */
.tgc-mobile {
    display: none;
}

@media (max-width: 768px) {
    .tgc-table-wrap { display: none; }
    .tgc-mobile { display: block; }
    
    .tgc-wrap {
        padding: 0;
        margin: 0;
    }
    
    .tgc-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
        margin-bottom: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-light);
    }
    
    .tgc-header h2 { font-size: 18px; }
    .tgc-header span { font-size: 12px; padding: 6px 14px; }
    
    /* کارت‌های بالا - ثابت و هم‌ارتفاع */
    .tgc-mobile-products {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px;
        background: var(--bg-white);
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 2px solid var(--border-light);
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .tgc-mobile-card {
        position: relative;
        text-align: center;
        padding: 12px 8px;
        background: var(--bg-white);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .tgc-mobile-card .tgc-remove {
        position: absolute;
        width: 24px;
        height: 24px;
        top: 5px;
        left: 5px;
        background: #fff;
        color: #dc2626;
        border: 1px solid var(--border-light);
        border-radius: 50%;
        box-shadow: var(--shadow-sm);
    }
    
    .tgc-mobile-card img {
        width: 80px;
        height: 80px;
        object-fit: contain;
        border-radius: var(--radius-sm);
        margin: 0 auto 8px;
    }
    
    .tgc-mobile-card h4 {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-dark);
        margin: 0 0 6px;
        line-height: 1.3;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tgc-mobile-card .tgc-price {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .tgc-mobile-card .tgc-view {
        padding: 7px 14px;
        font-size: 11px;
        display: block;
        margin-top: auto;
    }
    
    /* مشخصات - عنوان بالا، مقادیر زیرش */
    .tgc-mobile-specs {
        background: var(--bg-light);
        padding: 10px;
    }
    
    .tgc-spec-row {
        background: var(--bg-white);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--border-light);
    }
    
    .tgc-spec-label {
        display: block;
        width: 100%;
        padding: 10px 12px;
        font-weight: 700;
        font-size: 13px;
        color: var(--text-dark);
        background: var(--bg-light);
        text-align: center;
        border-bottom: 2px solid var(--primary-orange);
    }
    
    .tgc-spec-values {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .tgc-spec-val {
        padding: 12px 10px;
        font-size: 13px;
        color: var(--text-gray);
        text-align: center;
        background: var(--bg-white);
    }
    
    .tgc-spec-val:first-child {
        border-left: 1px solid var(--border-light);
    }
    
    .tgc-no-specs {
        padding: 40px 20px;
        text-align: center;
        color: var(--text-gray);
        font-size: 14px;
        background: var(--bg-white);
        border-radius: var(--radius-md);
    }
    
    /* Toast */
    .tgc-toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
        padding: 14px;
    }
    
    .tgc-toast-text { font-size: 13px; }
    .tgc-toast-action { padding: 8px 14px; font-size: 12px; width: 100%; text-align: center; }
    
    /* Empty */
    .tgc-empty {
        margin: 15px;
        padding: 60px 20px;
    }
    
    .tgc-empty svg { width: 60px; height: 60px; }
    .tgc-empty h3 { font-size: 17px; }
    .tgc-empty a { padding: 12px 24px; font-size: 13px; }
    
    /* دکمه */
    .tgc-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    .tgc-mobile-products {
        gap: 8px;
        padding: 12px;
    }
    
    .tgc-mobile-card {
        padding: 10px 6px;
    }
    
    .tgc-mobile-card img {
        width: 70px;
        height: 70px;
    }
    
    .tgc-mobile-card h4 {
        font-size: 11px;
    }
    
    .tgc-mobile-card .tgc-price {
        font-size: 13px;
    }
    
    .tgc-mobile-card .tgc-view {
        font-size: 10px;
        padding: 6px 12px;
    }
    
    .tgc-spec-label {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .tgc-spec-val {
        font-size: 12px;
        padding: 10px 8px;
    }
}

@media (max-width: 320px) {
    .tgc-mobile-card img {
        width: 60px;
        height: 60px;
    }
    
    .tgc-mobile-card h4 {
        font-size: 10px;
    }
    
    .tgc-mobile-card .tgc-price {
        font-size: 12px;
    }
    
    .tgc-spec-label {
        font-size: 11px;
    }
    
    .tgc-spec-val {
        font-size: 11px;
    }
}