/**
 * TechnoGene WooCommerce Custom Styles
 *
 * Vazirmatn font stack, RTL-optimized, Bootstrap-style cards
 * for the 4-column product grid and single product YMYL UI.
 *
 * @package TechnoGene
 * @since   1.0.0
 */

/* ============================================
   1. VAZIRMATN FONT OVERRIDE FOR WOOCOMMERCE
   ============================================ */

.woocommerce,
.woocommerce-page,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce div.product,
.woocommerce-page div.product,
.woocommerce #content div.product,
.woocommerce-page #content div.product,
.woocommerce .product-title,
.woocommerce .price,
.woocommerce .amount,
.woocommerce .button,
.woocommerce .added_to_cart,
.woocommerce .quantity input,
.woocommerce .select2-container,
.woocommerce .woocommerce-breadcrumb,
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering select,
.woocommerce .product_meta,
.woocommerce .shop_table,
.woocommerce .checkout,
.woocommerce .cart_totals,
.woocommerce .cart-collaterals,
.woocommerce .cross-sells,
.woocommerce .cart-empty,
.woocommerce .return-to-shop {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
}

/* ============================================
   2. ARCHIVE / SHOP GRID — BOOTSTRAP-STYLE CARDS
   ============================================ */

/* 2a. Product grid container */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 0;
    margin: 0 0 2rem;
    list-style: none;
    direction: rtl;
}

/* 2b. Individual product card */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: auto;
    margin: 0;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    position: relative;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #c8d6e5;
}

/* 2c. Product image wrapper */
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce-page ul.products li.product .woocommerce-loop-product__link {
    display: block;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f8f9fa;
}

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    transition: transform 0.4s ease;
}

.woocommerce ul.products li.product:hover img,
.woocommerce-page ul.products li.product:hover img {
    transform: scale(1.08);
}

/* 2d. Product info area (below image) */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    padding: 14px 16px 0;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.5;
    text-align: right;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price {
    padding: 8px 16px 14px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d5a87;
    text-align: right;
}

.woocommerce ul.products li.product .price del,
.woocommerce-page ul.products li.product .price del {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-inline-end: 6px;
}

.woocommerce ul.products li.product .price ins,
.woocommerce-page ul.products li.product .price ins {
    text-decoration: none;
}

/* 2e. Add-to-cart button */
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
    margin: auto 16px 16px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50px;
    text-align: center;
    background: #1e3a5f;
    color: #ffffff;
    border: none;
    transition: all 0.3s ease;
    display: block;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover {
    background: #2d5a87;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.woocommerce ul.products li.product .added_to_cart,
.woocommerce-page ul.products li.product .added_to_cart {
    margin: 0 16px 16px;
    padding: 10px 20px;
    font-size: 0.875rem;
    border-radius: 50px;
    text-align: center;
    background: #e8f4f8;
    color: #1e3a5f;
    display: block;
}

/* 2f. Sale badge */
.woocommerce ul.products li.product .onsale,
.woocommerce-page ul.products li.product .onsale {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    margin: 0;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50px;
    background: #dc3545;
    color: #ffffff;
    z-index: 5;
    min-height: auto;
    min-width: auto;
    line-height: 1.4;
}

/* ============================================
   3. 4-COLUMN RESPONSIVE GRID
   ============================================ */

@media (max-width: 1024px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .woocommerce-page ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.875rem;
        padding: 12px 12px 0;
    }

    .woocommerce ul.products li.product .price,
    .woocommerce-page ul.products li.product .price {
        font-size: 0.95rem;
        padding: 6px 12px 12px;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce-page ul.products li.product .button {
        margin: auto 12px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================
   4. SINGLE PRODUCT PAGE
   ============================================ */

/* 4a. Single product container */
.woocommerce div.product,
.woocommerce-page div.product {
    direction: rtl;
    text-align: right;
}

/* 4b. Product gallery */
.woocommerce div.product div.images,
.woocommerce-page div.product div.images {
    border-radius: 12px;
    overflow: hidden;
}

.woocommerce div.product div.images .woocommerce-product-gallery {
    border-radius: 12px;
    overflow: hidden;
}

.woocommerce div.product div.images .flex-control-thumbs {
    margin-block-start: 10px;
    gap: 8px;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    border-color: #1e3a5f;
}

/* 4c. Summary */
.woocommerce div.product .product_title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-block-end: 0.5rem;
}

.woocommerce div.product .woocommerce-product-rating {
    margin-block-end: 0.75rem;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d5a87;
    margin-block-end: 1rem;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    font-size: 1.1rem;
    color: #95a5a6;
    margin-inline-end: 8px;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    text-decoration: none;
}

/* 4d. Quantity and add-to-cart */
.woocommerce div.product form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-block: 1.5rem;
}

.woocommerce div.product form.cart .quantity {
    float: none;
    margin: 0;
}

.woocommerce div.product form.cart .quantity input.qty {
    width: 70px;
    padding: 10px 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    direction: ltr;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    flex: 1;
    min-width: 180px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    background: #1e3a5f;
    color: #ffffff;
    border: none;
    transition: all 0.3s ease;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background: #2d5a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.35);
}

/* 4e. Product meta */
.woocommerce div.product .product_meta {
    margin-block-start: 1.5rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid #e8e8e8;
    font-size: 0.9rem;
}

.woocommerce div.product .product_meta > span {
    display: block;
    margin-block-end: 6px;
}

/* ============================================
   5. YMYL RUO WARNING — ALERT-DANGER OVERRIDE
   ============================================ */

.woocommerce .tg-safety-warning {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    border-radius: 10px;
    color: #721c24;
    margin-block-end: 20px;
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.woocommerce .tg-safety-warning__icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.woocommerce .tg-safety-warning__text {
    color: #721c24;
    line-height: 1.8;
    font-size: 0.95rem;
}

.woocommerce .tg-safety-warning__text strong {
    color: #dc3545;
    font-weight: 700;
}

/* ============================================
   6. CATALOG NUMBER BADGE
   ============================================ */

.tg-catalog-number {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    margin-block-end: 10px;
    border-block-end: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

.tg-catalog-number__label {
    font-weight: 700;
    color: #1e3a5f;
}

.tg-catalog-number__value {
    font-family: 'Courier New', 'Consolas', monospace;
    font-weight: 600;
    color: #333;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 4px;
    direction: ltr;
    unicode-bidi: embed;
}

/* ============================================
   7. WOOCOMMERCE BREADCRUMBS — RTL
   ============================================ */

.woocommerce .woocommerce-breadcrumb,
.woocommerce-page .woocommerce-breadcrumb {
    direction: rtl;
    text-align: right;
    font-size: 0.875rem;
    color: #666;
    margin-block-end: 1.5rem;
    padding: 0;
}

.woocommerce .woocommerce-breadcrumb a,
.woocommerce-page .woocommerce-breadcrumb a {
    color: #1e3a5f;
}

/* ============================================
   8. RESULTS COUNT & ORDERING — RTL
   ============================================ */

.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
    font-size: 0.9rem;
    color: #666;
    float: none;
    margin-block-end: 1rem;
}

.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering {
    float: none;
    margin-block-end: 1.5rem;
}

.woocommerce .woocommerce-ordering select,
.woocommerce-page .woocommerce-ordering select {
    padding: 8px 36px 8px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23333" d="M6 8L1 3h10z"/></svg>') no-repeat left 12px center;
    appearance: none;
    cursor: pointer;
    min-width: 180px;
}

/* ============================================
   9. WOOCOMMERCE PAGINATION — RTL
   ============================================ */

.woocommerce nav.woocommerce-pagination,
.woocommerce-page nav.woocommerce-pagination {
    direction: rtl;
    text-align: center;
    margin-block: 2rem;
}

.woocommerce nav.woocommerce-pagination ul,
.woocommerce-page nav.woocommerce-pagination ul {
    border: none;
    display: inline-flex;
    gap: 4px;
}

.woocommerce nav.woocommerce-pagination ul li,
.woocommerce-page nav.woocommerce-pagination ul li {
    border: none;
    float: none;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span,
.woocommerce-page nav.woocommerce-pagination ul li a,
.woocommerce-page nav.woocommerce-pagination ul li span {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #ffffff;
    transition: all 0.3s ease;
}

.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce-page nav.woocommerce-pagination ul li a:hover {
    background: #1e3a5f;
    color: #ffffff;
    border-color: #1e3a5f;
}

.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce-page nav.woocommerce-pagination ul li span.current {
    background: #1e3a5f;
    color: #ffffff;
    border-color: #1e3a5f;
}

/* ============================================
    10. NATIVE WOOCOMMERCE GRIDS FIX — RELATED & UPSELLS
    ============================================ */

/* --- Container sections --- */

.woocommerce div.product .related,
.woocommerce-page div.product .related,
.woocommerce div.product .upsells,
.woocommerce-page div.product .upsells {
    clear: both;
    margin-block-start: 3rem;
    padding-block-start: 2rem;
    border-block-start: 2px solid #e8e8e8;
}

.woocommerce div.product .related h2,
.woocommerce-page div.product .related h2,
.woocommerce div.product .upsells h2,
.woocommerce-page div.product .upsells h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-block-end: 1.5rem;
}

/* --- Grid container: force CSS Grid, neutralize float clearfixes --- */

.related.products ul.products,
.up-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px;
}

.related.products ul.products::before,
.related.products ul.products::after,
.up-sells ul.products::before,
.up-sells ul.products::after {
    display: none !important;
}

/* --- Individual items: force into grid cells, neutralize floats --- */

.related.products ul.products li.product,
.up-sells ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
    clear: none !important;
}

@media (max-width: 992px) {
    .related.products ul.products,
    .up-sells ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .related.products ul.products,
    .up-sells ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .related.products ul.products,
    .up-sells ul.products {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* ============================================
   12. RESPONSIVE RTL FIXES
   ============================================ */

@media (max-width: 768px) {
    .woocommerce div.product form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    .woocommerce div.product form.cart .quantity input.qty {
        width: 100%;
    }

    .woocommerce div.product form.cart .single_add_to_cart_button {
        min-width: auto;
        width: 100%;
    }

    .woocommerce .woocommerce-ordering select {
        width: 100%;
    }
}

/* ============================================
   13. CART & CHECKOUT — RTL BASICS
   ============================================ */

.woocommerce table.shop_table,
.woocommerce-page table.shop_table {
    direction: rtl;
    text-align: right;
    border-radius: 12px;
    overflow: hidden;
}

.woocommerce table.shop_table th,
.woocommerce-page table.shop_table th {
    background: #1e3a5f;
    color: #ffffff;
    font-weight: 600;
    padding: 14px 16px;
}

.woocommerce table.shop_table td,
.woocommerce-page table.shop_table td {
    padding: 14px 16px;
}

.woocommerce .cart_totals h2,
.woocommerce-page .cart_totals h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3a5f;
}

/* ============================================
    14. TECH SPECS BAR — CATALOG NUMBER + STORAGE TEMP
    ============================================ */

.tg-tech-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    padding: 14px 16px;
    margin-block-end: 16px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    direction: rtl;
}

.tg-tech-spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tg-tech-spec__icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tg-tech-spec__label {
    font-weight: 600;
    color: #1e3a5f;
    white-space: nowrap;
}

.tg-tech-spec__value--catalog {
    font-family: 'Courier New', 'Consolas', monospace;
    font-weight: 600;
    color: #333;
    background: #ffffff;
    padding: 1px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    direction: ltr;
    unicode-bidi: embed;
}

.tg-tech-spec__value--temp {
    font-weight: 700;
    padding: 1px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.tg-tech-spec__value--temp--20c {
    background: #dbeafe;
    color: #1e40af;
}

.tg-tech-spec__value--temp-4c {
    background: #e0f2fe;
    color: #0e7490;
}

.tg-tech-spec__value--temp-rt {
    background: #fef3c7;
    color: #b45309;
}

@media (max-width: 480px) {
    .tg-tech-specs {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
}

/* ============================================
    15. RELATED ACADEMY & PROTOCOL GRID
    ============================================ */

.tg-related-academy {
    clear: both;
    margin-block-start: 3rem;
    padding-block-start: 2rem;
    border-block-start: 2px solid #e8e8e8;
    direction: rtl;
}

.tg-related-academy .tg-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-block-end: 1.5rem;
}

.tg-academy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tg-academy-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tg-academy-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #c8d6e5;
}

.tg-academy-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tg-academy-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f8f9fa;
}

.tg-academy-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    margin: 0;
}

.tg-academy-card:hover .tg-academy-card__image img {
    transform: scale(1.08);
}

.tg-academy-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f4f8 100%);
}

.tg-academy-card__placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.tg-academy-card__title {
    padding: 12px 14px 4px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.5;
    text-align: right;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tg-academy-card__cta {
    display: block;
    padding: 4px 14px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d5a87;
    text-align: right;
    transition: color 0.3s ease;
}

.tg-academy-card:hover .tg-academy-card__cta {
    color: #1e3a5f;
}

@media (max-width: 1024px) {
    .tg-academy-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .tg-academy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tg-academy-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
    16. POST-TYPE BADGES — ACADEMY / PROTOCOL
    ============================================ */

.tg-post-type-badge {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 10px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 20px;
    z-index: 2;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tg-post-type-badge--academy {
    background: #d1fae5;
    color: #065f46;
}

.tg-post-type-badge--protocol {
    background: #ede9fe;
    color: #5b21b6;
}

/* ============================================
    17. CALL FOR PRICE — "تماس بگیرید" FEATURE
    ============================================ */

.tg-call-for-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-block-end: 1rem;
}

.tg-contact-for-price-wrapper {
    margin-block: 1.5rem;
}

.tg-contact-for-price-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    background: #1e3a5f;
    color: #ffffff;
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.tg-contact-for-price-btn:hover {
    background: #2d5a87;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.35);
}

@media (max-width: 768px) {
    .tg-contact-for-price-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-contact-for-price-btn {
        transition: none;
        transform: none;
    }
}

/* ============================================
    18. ACCESSIBILITY — REDUCED MOTION
    ============================================ */

@media (prefers-reduced-motion: reduce) {
    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product,
    .woocommerce ul.products li.product img,
    .woocommerce-page ul.products li.product img,
    .woocommerce ul.products li.product .button,
    .woocommerce-page ul.products li.product .button,
    .woocommerce nav.woocommerce-pagination ul li a,
    .woocommerce-page nav.woocommerce-pagination ul li a,
    .woocommerce nav.woocommerce-pagination ul li span,
    .woocommerce-page nav.woocommerce-pagination ul li span {
        transition: none;
        transform: none;
    }
}

/* ============================================
   18. [tg_product_grid] — SHOP LANDING GRID (/store/)
   Responsive 4-column grid per TechnoGene grid standard.
   RTL-optimized, Vazirmatn font stack, Bootstrap-style cards.
   ============================================ */

.atg-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-block: 2rem;
    direction: rtl;
    font-family: var(--tg-font-family, "Vazirmatn", Tahoma, sans-serif);
}

.atg-products-grid.atg-products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
    font-size: 1.1rem;
}

.atg-product-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.atg-product-card:hover {
    box-shadow: 0 10px 25px rgba(30, 58, 95, 0.12);
    transform: translateY(-4px);
}

.atg-product-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    overflow: hidden;
}

.atg-product-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.atg-product-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.atg-product-card:hover .atg-product-card__image-link img {
    transform: scale(1.05);
}

.atg-product-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #9ca3af;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.atg-product-card__onsale {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    padding: 4px 10px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
}

.atg-product-card__body {
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex-grow: 1;
}

.atg-product-card__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    color: #1e3a5f;
}

.atg-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.atg-product-card__title a:hover {
    color: #2d5a87;
}

.atg-product-card__specs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding-block: 8px;
    border-block: 1px solid #f1f5f9;
}

.atg-product-card__spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
    flex-wrap: wrap;
}

.atg-product-card__spec-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.atg-product-card__spec-label {
    color: #94a3b8;
    font-weight: 500;
}

.atg-product-card__spec-value {
    font-weight: 600;
    color: #1e3a5f;
}

.atg-product-card__price {
    margin-top: auto;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a5f;
}

.atg-product-card__price .tg-call-for-price {
    font-size: 1.25rem;
    color: #b45309;
}

.atg-product-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.atg-product-card__actions .atg-btn {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 10px 14px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.atg-btn-primary {
    background: #1e3a5f;
    color: #ffffff;
}

.atg-btn-primary:hover {
    background: #2d5a87;
    color: #ffffff;
}

.atg-btn-outline {
    background: transparent;
    color: #1e3a5f;
    border-color: #1e3a5f;
}

.atg-btn-outline:hover {
    background: #1e3a5f;
    color: #ffffff;
}

/* Native WooCommerce add-to-cart loop inside the grid card */
.atg-product-card__actions a.button,
.atg-product-card__actions a.added_to_cart {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 10px 14px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    background: #1e3a5f;
    color: #ffffff;
    border: 1px solid #1e3a5f;
    width: auto;
}

.atg-product-card__actions a.button:hover,
.atg-product-card__actions a.added_to_cart:hover {
    background: #2d5a87;
    border-color: #2d5a87;
    color: #ffffff;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .atg-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .atg-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .atg-products-grid {
        grid-template-columns: 1fr;
    }

    .atg-product-card__actions {
        flex-direction: column;
    }

    .atg-product-card__actions .atg-btn,
    .atg-product-card__actions a.button {
        min-width: 100%;
    }
}

/* ============================================
    19. SHOP LANDING PAGE LAYOUT — GRID + SIDEBAR
    Two-column CSS Grid layout for the Elementor
    HTML injection method (avoids corrupted JSON).
    RTL-optimized, Vazirmatn font stack, TechnoGene brand.
    ============================================ */

.tg-shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    direction: rtl;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    align-items: start;
}

/* --- Sidebar container --- */

.tg-shop-sidebar {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 100px;
    direction: rtl;
}

.tg-shop-sidebar .tg-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 16px;
    padding-block-end: 12px;
    border-block-end: 2px solid #1e3a5f;
}

.tg-shop-sidebar .tg-search-box {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #666;
    background: #f8f9fa;
    text-align: right;
    direction: rtl;
    margin-block-end: 16px;
    transition: border-color 0.3s ease;
}

.tg-shop-sidebar .tg-search-box:focus {
    outline: none;
    border-color: #1e3a5f;
    background: #ffffff;
}

.tg-shop-sidebar hr {
    border: none;
    border-block-start: 1px solid #e8e8e8;
    margin: 18px 0;
}

.tg-shop-sidebar p {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 10px;
}

/* --- Filter title rows (fake filter groups) --- */

.tg-shop-sidebar .tg-filter-group {
    margin-block-end: 18px;
}

.tg-shop-sidebar .tg-filter-group__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 10px;
}

.tg-shop-sidebar .tg-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tg-shop-sidebar .tg-filter-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
}

.tg-shop-sidebar .tg-filter-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #1e3a5f;
    cursor: pointer;
    flex-shrink: 0;
}

.tg-shop-sidebar .tg-filter-count {
    margin-inline-start: auto;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* --- Main shop content (product grid host) --- */

.tg-shop-main {
    direction: rtl;
    min-width: 0;
}

.tg-shop-main .tg-shop-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 20px;
    padding-block-end: 16px;
    border-block-end: 1px solid #e8e8e8;
}

.tg-shop-main .tg-shop-toolbar__count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.tg-shop-main .tg-shop-toolbar__count strong {
    color: #1e3a5f;
}

/* --- Responsive: collapse to single column --- */

@media (max-width: 992px) {
    .tg-shop-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tg-shop-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .tg-shop-layout {
        gap: 20px;
    }

    .tg-shop-sidebar {
        padding: 18px 16px;
    }
}

/* ============================================
    20. SINGLE PRODUCT PAGE — CONTAINER WIDTH & BLEED FIX
    Enforce a centered max-width wrapper aligned with the global
    .container band (1200px) used by the site header logo/menu.
    Prevents gallery/summary/add-to-cart from hitting screen edges.
    RTL-aware, Vazirmatn stack, mobile-safe padding.
    ============================================ */

/* 20a. Outer container — aligns with header logo/menu band (1200px) */
.single-product .woocommerce,
.single-product .woocommerce-page,
.single-product .site-main,
.single-product #primary,
.single-product #content {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
    direction: rtl;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}

/* 20b. Elementor widget wrapper fallback — same band width */
.single-product #content .woocommerce,
.single-product #content .woocommerce-page,
.single-product .elementor-widget-container .woocommerce,
.single-product #primary .woocommerce {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

/* 20c. Inner product wrapper — modern Flexbox top section.
   The .woocommerce div.product container hosts four kinds of children,
   stacked sequentially:
     1. div.images        → 40% gallery column
     2. .summary          → 55% title/price/cart/meta column
                            (40% + 55% leaves a 5% gutter via
                            justify-content: space-between)
     3. .woocommerce-tabs → 100% width band below (§20f.2)
     4. .related/.upsells → 100% width band below tabs (§20f)
   flex-wrap: wrap lets any block set to width:100% drop to its own row. */
.single-product .woocommerce div.product,
.single-product .woocommerce-page div.product {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
}

/* 20d. Gallery column — 40% width, clear floats.
   5% breathing gutter comes from justify-content: space-between. */
.single-product .woocommerce div.product div.images,
.single-product .woocommerce-page div.product div.images {
    width: 40% !important;
    float: none !important;
    margin: 0 0 40px 0 !important;
    box-sizing: border-box;
}

/* 20e. Summary column (title, price, cart, meta) — 55% width, inline-end. */
.single-product .woocommerce div.product .summary,
.single-product .woocommerce-page div.product .summary {
    width: 55% !important;
    float: none !important;
    margin: 0 0 40px 0 !important;
    padding-block-start: 0;
    box-sizing: border-box;
}

/* 20f. Related products & upsells — full-width band below all product data.
   In the §20c flex parent, `width: 100%` + `flex-wrap: wrap` forces these
   blocks to their own row, clearing the gallery/summary/tabs above and
   spanning the entire 1200px container width. */
.single-product .woocommerce div.product .related,
.single-product .woocommerce div.product .upsells,
.single-product .woocommerce-page div.product .related,
.single-product .woocommerce-page div.product .upsells,
.single-product .woocommerce div.product .related.products,
.single-product .woocommerce-page div.product .related.products,
.single-product .woocommerce div.product .up-sells,
.single-product .woocommerce-page div.product .up-sells,
.single-product .woocommerce-page div.product .up-sells ul.products {
    clear: both !important;
    width: 100% !important;
    display: block !important;
    margin-top: 50px !important;
    float: none !important;
}

/* 20f.2. WooCommerce tabs — force full-width band below gallery + summary.
   Same structural reset as §20f: `width: 100%` + `flex-wrap: wrap` in the
   §20c flex parent pulls .woocommerce-tabs out of the right-side summary
   cell (where it was landing beside the summary before) and drops it onto
   its own row spanning the entire 1200px container width, stacked above
   the related/upsells band. */
.single-product .woocommerce div.product .woocommerce-tabs,
.single-product .woocommerce-page div.product .woocommerce-tabs,
.single-product .woocommerce div.product .woocommerce-tabs ul.tabs,
.single-product .woocommerce-page div.product .woocommerce-tabs ul.tabs,
.single-product .woocommerce div.product .woocommerce-tabs .panel,
.single-product .woocommerce-page div.product .woocommerce-tabs .panel {
    clear: both !important;
    width: 100% !important;
    display: block !important;
    margin-top: 50px !important;
    float: none !important;
}

/* 20g. Mobile-safe padding for tablets */
@media (max-width: 992px) {
    .single-product .woocommerce,
    .single-product .woocommerce-page,
    .single-product .site-main,
    .single-product #primary,
    .single-product #content,
    .single-product #content .woocommerce,
    .single-product #primary .woocommerce {
        padding-inline: 16px;
    }

    /* Narrower top section split: 45% / 50% with 5% gutter. */
    .single-product .woocommerce div.product div.images,
    .single-product .woocommerce-page div.product div.images {
        width: 45% !important;
        margin: 0 0 32px 0 !important;
    }

    .single-product .woocommerce div.product .summary,
    .single-product .woocommerce-page div.product .summary {
        width: 50% !important;
        margin: 0 0 32px 0 !important;
    }
}

/* 20h. Stacked single-column layout on phones */
@media (max-width: 768px) {
    .single-product .woocommerce,
    .single-product .woocommerce-page,
    .single-product .site-main,
    .single-product #primary,
    .single-product #content,
    .single-product #content .woocommerce,
    .single-product #primary .woocommerce {
        padding-inline: 14px;
    }

    /* Phones: both columns collapse to full width. */
    .single-product .woocommerce div.product div.images,
    .single-product .woocommerce-page div.product div.images,
    .single-product .woocommerce div.product .summary,
    .single-product .woocommerce-page div.product .summary {
        width: 100% !important;
        margin: 0 0 24px 0 !important;
    }
}

/* ============================================
    21. FOOTER LAYOUT — CONTAINER WIDTH ALIGNMENT
    Forces footer inner content (native + Elementor) to match the
    global 1200px container band so columns align with site header
    and use horizontal space without over-squeezing.
    ============================================ */

/* 21a. Native .main-footer .container — align to 1200px band */
.main-footer .container,
.main-footer.site-footer .container,
footer.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 21b. Elementor footer location wrappers — force 1200px band */
footer.site-footer .elementor-section-boxed .elementor-container,
footer.site-footer .elementor-widget-wrap,
.elementor-location-footer .elementor-section-boxed .elementor-container,
.elementor-location-footer .elementor-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* 21c. Footer content grid alignment (native scheme) */
.main-footer .footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    width: 100%;
}

/* 21d. Elementor footer widgets — let inner columns breathe */
.elementor-location-footer .elementor-column {
    padding-inline: 16px;
    box-sizing: border-box;
}

/* 21e. Mobile-safe footer padding */
@media (max-width: 768px) {
    .main-footer .container,
    footer.site-footer .container,
    .elementor-location-footer .elementor-section-boxed .elementor-container,
    .elementor-location-footer .elementor-container {
        padding: 0 16px;
    }

    .main-footer .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ============================================
    22. SHOP AJAX FILTER — LOADING STATE & UI FEEDBACK
    Visual states for .tg-shop-main during AJAX filter requests.
    Mirrors loading styles used by the shop-ajax.js engine.
    ============================================ */

.tg-shop-main.is-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
    position: relative;
}

.tg-shop-main.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><circle cx="24" cy="24" r="20" fill="none" stroke="%231e3a5f" stroke-width="4" stroke-dasharray="80 60" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 24 24" to="360 24 24" dur="1s" repeatCount="indefinite"/></circle></svg>') no-repeat center;
    background-size: 48px 48px;
    z-index: 10;
    pointer-events: none;
}

/* Filter checkbox label hover state */
.tg-shop-sidebar .tg-filter-list li:hover {
    color: #1e3a5f;
}

.tg-shop-sidebar .tg-filter-list li:hover .tg-filter-checkbox {
    border-color: #1e3a5f;
}

/* Empty state returned by AJAX */
.tg-shop-main .atg-products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
    font-size: 1.1rem;
}

/* ============================================
    23. MY ACCOUNT & AUTH PORTAL — v2.10.0 (redesigned v2.10.2)
    Styles the WooCommerce `[woocommerce_my_account]` page:
      - Auth page (guest): a modern single-card TABBED interface
        (Login visible by default, toggle to Registration),
        driven by `assets/js/auth-tabs.js`. See 23a–23g below.
        Previous v2.10.0/v2.10.1 side-by-side split layouts were
        retired in v2.10.2 in favor of the tabbed single-column
        card (max-width 500px, centered) — far cleaner on mobile
        and on the Persian RTL storefront.
      - Logged-in dashboard: vertical sidebar nav + content
        cards (23h onward, unchanged from v2.10.0).

    Brand: primary #1e3a5f, hover #2d5a87, Vazirmatn font,
    12px rounded corners, soft brand shadow. All rules are
    RTL-aware via logical CSS properties.
    Targets: `.woocommerce-account`, `#customer_login`,
    `.tg-auth-tabs`, `.woocommerce-form-login`,
    `.woocommerce-form-register`,
    `.woocommerce-MyAccount-navigation`, `.woocommerce-MyAccount-content`.
    ============================================ */

/* 23a. Auth page shell — centered flex host for the login card.
   IMPORTANT: the centering + flex-column rule is scoped to
   `body:not(.logged-in)` so it applies ONLY on the guest auth
   page. The logged-in dashboard reuses the SAME
   `.woocommerce-account .woocommerce` selector for its 240px
   sidebar grid (23h, defined further below), so an unscoped
   override would shatter the dashboard. WordPress adds
   `.logged-in` to `body` for authenticated sessions, making it
   the reliable discriminator between the two states.

   v2.10.4 — BULLETPROOF against Elementor Full Width overrides.
   Elementor's full-width / canvas templates force RTL flex
   content to `flex-start` (inline-start = right) and cap widths
   on the page wrapper, which defeated the v2.10.3 plain-flex
   centering. The fix uses `!important` + `flex-direction: column`
   on BOTH the standard WC container and the Elementor shortcode
   widget that hosts the `[woocommerce_my_account]` block, so
   the card centers identically whether the page is themed or
   built in Elementor. `column` (instead of row) is used so the
   stacked form + tabs read top-to-bottom while still centering
   on the cross axis. */
.woocommerce-account.woocommerce-page,
.woocommerce-account.woocommerce-page .woocommerce {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
    direction: rtl;
    text-align: right;
}

/* Guest-only: bulletproof vertical + horizontal centering of the
   auth card against Elementor Full Width / canvas overrides. */
body:not(.logged-in) .woocommerce-account .woocommerce,
body:not(.logged-in) .elementor-widget-shortcode .woocommerce {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 60px 15px;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce-account .woocommerce > form,
.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
}

/* 23b. #customer_login — modern UI login card.
   The v2.10.1 side-by-side flex/grid layout is replaced by a
   single-column card (max-width 420px) that hosts the injected
   `.tg-auth-tabs` toggle + one visible form at a time. v2.10.3
   polished the card: 16px corners, 40px/30px padding, and a
   soft neutral drop-shadow so the card reads as elevated
   regardless of the page background.
   v2.10.4 — locked the card's horizontal auto-centering with
   `!important` so Elementor's float/RTL drift cannot push it
   to the inline-start (right) edge. */
#customer_login {
    width: 100%;
    max-width: 420px;
    margin: 0 auto !important;
    float: none !important;
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #eaeaea;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* Both columns are full-width; visibility is toggled by JS
   (Login shown by default, Register hidden). */
#customer_login .u-column1,
#customer_login .u-column2 {
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    float: none;
    box-sizing: border-box;
}

/* Hide the register column by default; auth-tabs.js flips it
   on when the Register tab is activated (or when a failed
   registration leaves a `.woocommerce-error` in the column). */
#customer_login .u-column2 {
    display: none;
}

/* 23c. Injected tabs bar — `.tg-auth-tabs` (created by auth-tabs.js).
   Two equally-sized side-by-side pill buttons sit at the top of
   the card, above the form. v2.10.3 tightened the active/inactive
   contrast: inactive tabs rest on a subtle gray field, active
   tabs fill with the brand navy. Smooth transitions on all
   properties so the swap feels liquid. Matches TechnoGene brand. */
.tg-auth-tabs {
    display: flex;
    gap: 6px;
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 5px;
    margin-block-end: 28px;
    box-sizing: border-box;
}

.tg-auth-tab {
    flex: 1;                       /* equal-width buttons */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;                /* muted slate — inactive */
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease,
                box-shadow 0.25s ease, transform 0.25s ease,
                border-color 0.25s ease;
}

/* Inactive state — subtle gray background, darkens text on hover */
.tg-auth-tab:not(.is-active) {
    background: #ffffff;
    color: #1e3a5f;
}

.tg-auth-tab:not(.is-active):hover {
    background: #e2e8f0;
    color: #2d5a87;
}

/* Active state — solid brand fill + brand shadow */
.tg-auth-tab.is-active {
    background: #1e3a5f;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.28);
}

.tg-auth-tab.is-active:hover {
    background: #2d5a87;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.34);
}

/* 23d. Auth card header — hidden on the tabbed UI.
   The injected tabs ("ورود" / "ثبت‌نام") now own the top-level
   heading role, so the native `.u-column h2` titles ("Login" /
   "Register") become redundant and would double the label. The
   inner form legends + labels still convey fields to AT users. */
#customer_login .u-column1 h2,
#customer_login .u-column2 h2,
.woocommerce-form-login h2,
.woocommerce-form-register h2 {
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    border: 0;
    position: absolute;
}

/* 23d.1 Optional short intro under the tabs (kept visible). */
.woocommerce-form-login p,
.woocommerce-form-register p,
#customer_login .u-column1 p,
#customer_login .u-column2 p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-block-end: 20px;
}

/* 23e. Refined input fields — subtle border, 12px corners */
.woocommerce-form-login .form-row,
.woocommerce-form-register .form-row,
.woocommerce-account .woocommerce-form-row {
    margin-block-end: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.woocommerce-form-login label,
.woocommerce-form-register label,
.woocommerce-account .woocommerce-form-row label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
}

.woocommerce-form-login input[type="text"],
.woocommerce-form-login input[type="email"],
.woocommerce-form-login input[type="password"],
.woocommerce-form-login input[type="tel"],
.woocommerce-form-register input[type="text"],
.woocommerce-form-register input[type="email"],
.woocommerce-form-register input[type="password"],
.woocommerce-form-register input[type="tel"],
.woocommerce-account .woocommerce-form-row input[type="text"],
.woocommerce-account .woocommerce-form-row input[type="email"],
.woocommerce-account .woocommerce-form-row input[type="password"],
.woocommerce-account .woocommerce-form-row input[type="tel"],
.woocommerce-account .woocommerce-form-row input[type="url"],
.woocommerce-account .woocommerce-form-row textarea,
.woocommerce-account .woocommerce-form-row select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.woocommerce-form-login input:focus,
.woocommerce-form-register input:focus,
.woocommerce-account .woocommerce-form-row input:focus,
.woocommerce-account .woocommerce-form-row textarea:focus,
.woocommerce-account .woocommerce-form-row select:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

/* 23e.1 Guarantee full-width inputs inside the auth columns.
   WooCommerce's `form-login.php` / `form-register.php` apply
   the `.input-text` class to username/password/email inputs.
   On some page templates (Elementor canvas, narrow container)
   those inputs inherit a constrained width and end up
   letter-stacked. Force them to fill their column. */
.woocommerce-form-login input.input-text,
.woocommerce-form-register input.input-text {
    width: 100% !important;
    box-sizing: border-box;
}

/* 23f. Brand primary button styling (atg-btn + WC submit).
   v2.10.3 explicitly targets `.woocommerce-form-login__submit`
   (WooCommerce's native login submit class) so the brand button
   identity is enforced regardless of which WC build / template
   emits the submit. Full-width, generously padded, brand
   navy with a soft shadow that lifts on hover. */
.woocommerce-form-login .atg-btn,
.woocommerce-form-register .atg-btn,
.woocommerce-account .woocommerce-form-row .atg-btn,
.woocommerce-form-login button.button,
.woocommerce-form-register button.button,
.woocommerce-account .woocommerce-form-row button.button,
.woocommerce-form-login .woocommerce-form-login__submit,
.woocommerce-form-register .woocommerce-form-register__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    margin-block-start: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #1e3a5f;
    color: #ffffff;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease,
                box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.22);
}

.woocommerce-form-login .atg-btn:hover,
.woocommerce-form-register .atg-btn:hover,
.woocommerce-account .woocommerce-form-row .atg-btn:hover,
.woocommerce-form-login button.button:hover,
.woocommerce-form-register button.button:hover,
.woocommerce-account .woocommerce-form-row button.button:hover,
.woocommerce-form-login .woocommerce-form-login__submit:hover,
.woocommerce-form-register .woocommerce-form-register__submit:hover {
    background: #2d5a87;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(30, 58, 95, 0.32);
}

/* 23g. "Remember me" checkbox row + lost password link */
.woocommerce-form-login .woocommerce-form-login__rememberme,
.woocommerce-form-login .woocommerce-form-login__checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
    margin-block-end: 16px;
}

.woocommerce-form-login .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.woocommerce-form-login .woocommerce-LostPassword,
.woocommerce-form-login .lost_password,
.woocommerce-form-register .lost_password {
    margin-block-start: 14px;
    font-size: 0.9rem;
    text-align: left;
}

.woocommerce-form-login .woocommerce-LostPassword a,
.woocommerce-form-login .lost_password a,
.woocommerce-form-register .lost_password a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #1e3a5f;
    transition: color 0.2s ease;
}

.woocommerce-form-login .woocommerce-LostPassword a:hover,
.woocommerce-form-login .lost_password a:hover,
.woocommerce-form-register .lost_password a:hover {
    color: #2d5a87;
    border-color: #2d5a87;
}

/* 23g.1 Inline auth notices (error / info) inside the card.
   WC surfaces a failed-registration error inside .u-column2;
   the tab engine reveals that column automatically (see JS),
   and this rule restyles the notice to match the card chrome. */
#customer_login .woocommerce-error,
#customer_login .woocommerce-Message,
#customer_login .woocommerce-message {
    margin-block-end: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #f3c2c2;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.9rem;
}

#customer_login .woocommerce-Message,
#customer_login .woocommerce-message {
    border-color: #c2d8f3;
    background: #f0f7ff;
    color: #1e3a5f;
}


/* 23h. Logged-in dashboard layout — sidebar nav + content area */
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-MyAccount-navigation {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
}

.woocommerce-account .woocommerce {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    margin-block-start: 40px;
    align-items: start;
}

/* 23i. Navigation — sleek vertical sidebar pill menu */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(30, 58, 95, 0.06);
    position: sticky;
    top: 24px;
}

.woocommerce-MyAccount-navigation li {
    margin: 0;
    padding: 0;
    border-block-end: 1px solid #f1f5f9;
}

.woocommerce-MyAccount-navigation li:last-child {
    border-block-end: none;
}

.woocommerce-MyAccount-navigation li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    color: #1e3a5f;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-inline-start: 3px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.woocommerce-MyAccount-navigation li a:hover {
    background: #f8fafc;
    color: #2d5a87;
    border-inline-start-color: #2d5a87;
}

/* Active indicator — brand rail on the inline-start edge */
.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li.active a {
    background: #1e3a5f;
    color: #ffffff;
    border-inline-start-color: #2d5a87;
}

.woocommerce-MyAccount-navigation li.is-active a:hover,
.woocommerce-MyAccount-navigation li.active a:hover {
    background: #2d5a87;
    color: #ffffff;
}

/* 23j. Content area — clear card containers */
.woocommerce-MyAccount-content > * {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px;
    margin-block-end: 24px;
    box-shadow: 0 6px 24px rgba(30, 58, 95, 0.06);
}

.woocommerce-MyAccount-content p {
    color: #4b5563;
    line-height: 1.7;
    margin-block-end: 16px;
}

.woocommerce-MyAccount-content .woocommerce-Message,
.woocommerce-MyAccount-content .woocommerce-message {
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 12px;
    padding: 16px 20px;
    color: #1e3a5f;
}

/* 23k. Account details / Edit address / Downloads card headers */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    color: #1e3a5f;
    font-size: 1.25rem;
    font-weight: 700;
    margin-block-end: 16px;
    padding-block-end: 12px;
    border-block-end: 2px solid #eef2f7;
}

/* 23l. Orders table — clean card table styling */
.woocommerce-MyAccount-content .woocommerce-orders-table,
.woocommerce-MyAccount-content table.woocommerce-MyAccount-orders,
.woocommerce-MyAccount-content table.shop_table,
.woocommerce-MyAccount-content table.my_account_orders {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border: none;
}

.woocommerce-MyAccount-content table th,
.woocommerce-MyAccount-content table td {
    padding: 14px 16px;
    text-align: right;
    border-block-end: 1px solid #eef2f7;
    font-size: 0.9rem;
}

.woocommerce-MyAccount-content table th {
    background: #f8fafc;
    color: #1e3a5f;
    font-weight: 700;
    text-align: right;
}

.woocommerce-MyAccount-content table tr:last-child td,
.woocommerce-MyAccount-content table tr:last-child th {
    border-block-end: none;
}

.woocommerce-MyAccount-content table tr:hover td {
    background: #f8fafc;
}

/* 23m. Inline action buttons inside account content cards */
.woocommerce-MyAccount-content a.button,
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content .atg-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #1e3a5f;
    background: transparent;
    color: #1e3a5f;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.woocommerce-MyAccount-content a.button:hover,
.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content .atg-btn:hover {
    background: #1e3a5f;
    color: #ffffff;
}

/* Primary filled variant inside dashboard cards */
.woocommerce-MyAccount-content a.button.atg-btn-primary,
.woocommerce-MyAccount-content button.button.atg-btn-primary {
    background: #1e3a5f;
    color: #ffffff;
}

.woocommerce-MyAccount-content a.button.atg-btn-primary:hover,
.woocommerce-MyAccount-content button.button.atg-btn-primary:hover {
    background: #2d5a87;
}

/* 23n. Downloads list / address blocks inside cards */
.woocommerce-MyAccount-content .woocommerce-MyAccount-downloads,
.woocommerce-MyAccount-content .woocommerce-Addresses {
    margin-block-start: 8px;
}

.woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: 12px;
}

.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    margin-block-end: 0;
    border-block-end: none;
    padding-block-end: 0;
}

/* 23o. Responsive — stack auth columns + collapse dashboard grid */
@media (max-width: 992px) {
    .woocommerce-account .woocommerce {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .woocommerce-MyAccount-navigation ul {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        border-radius: 12px;
    }

    .woocommerce-MyAccount-navigation li {
        border-block-end: none;
    }

    .woocommerce-MyAccount-navigation li a {
        padding: 8px 14px;
        border-radius: 999px;
        border-inline-start: none;
    }

    .woocommerce-MyAccount-navigation li.is-active a,
    .woocommerce-MyAccount-navigation li.active a {
        background: #1e3a5f;
        color: #ffffff;
    }
}

@media (max-width: 768px) {
    /* Tabbed auth card — relax padding on phones; the card
       stays centered and single-column on every viewport. */
    #customer_login {
        padding: 24px;
    }

    .tg-auth-tabs {
        padding: 5px;
        gap: 6px;
    }

    .tg-auth-tab {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .woocommerce-account.woocommerce-page,
    .woocommerce-account.woocommerce-page .woocommerce {
        padding-inline: 16px;
    }

    .woocommerce-MyAccount-content > * {
        padding: 18px;
    }

    .woocommerce-MyAccount-content table th,
    .woocommerce-MyAccount-content table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    #customer_login {
        padding: 20px;
    }

    /* Orders table scrolls horizontally on phones */
    .woocommerce-MyAccount-content .woocommerce-orders-table-wrapper,
    .woocommerce-MyAccount-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ============================================
    24. SHOP PAGINATION — ELEGANT FLEXBOX
    Flexbox styling for the `.tg-shop-pagination` block
    rendered under the product grid by section 18/19. Mirrors
    the TechnoGene brand (primary #1e3a5f, hover #2d5a87) and
    pairs with the JS-delegated click handler in shop-ajax.js
    that intercepts `.page-numbers` anchors for AJAX page jumps.
    (Renumbered from 23 in v2.10.0 to make room for the new
    My Account & Auth Portal section.)
    ============================================ */

.tg-shop-results .tg-shop-pagination {
    margin-block-start: 2.5rem;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid #e8e8e8;
    direction: rtl;
}

/* paginate_links( 'type' => 'list' ) wraps items in <ul class="page-numbers"> */
.tg-shop-results .tg-shop-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tg-shop-results .tg-shop-pagination .page-numbers li {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each link + non-clickable current span */
.tg-shop-results .tg-shop-pagination .page-numbers a,
.tg-shop-results .tg-shop-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #ffffff;
    color: #1e3a5f;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.tg-shop-results .tg-shop-pagination .page-numbers a:hover {
    background: #1e3a5f;
    color: #ffffff;
    border-color: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

/* "Current" page indicator (rendered as <span class="current">) */
.tg-shop-results .tg-shop-pagination .page-numbers span.current,
.tg-shop-results .tg-shop-pagination .page-numbers a.current {
    background: #1e3a5f;
    color: #ffffff;
    border-color: #1e3a5f;
    cursor: default;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

/* Prev / Next arrows — slightly narrower for glyph clarity */
.tg-shop-results .tg-shop-pagination .page-numbers a.prev,
.tg-shop-results .tg-shop-pagination .page-numbers a.next {
    font-size: 1.1rem;
    padding: 0 14px;
}

/* Dots ellipsis ("…") — non-clickable placeholder */
.tg-shop-results .tg-shop-pagination .page-numbers span.dots {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: default;
}

/* Loading state disables hover transitions for a calmer UX */
.tg-shop-main.is-loading .tg-shop-pagination .page-numbers a {
    pointer-events: none;
    opacity: 0.6;
}

/* Mobile-safe pagination */
@media (max-width: 768px) {
    .tg-shop-results .tg-shop-pagination .page-numbers {
        gap: 6px;
    }

    .tg-shop-results .tg-shop-pagination .page-numbers a,
    .tg-shop-results .tg-shop-pagination .page-numbers span {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}
