/* Tanavoyar WooCommerce - Ultra Premium Redesign V2 */

/* --- 1. Variables & Reset --- */
:root {
    --ty-primary: #3b82f6;
    --ty-primary-hover: #2563eb;
    --ty-bg-light: #f8fafc;
    --ty-border-color: #e2e8f0;
    --ty-header-bg: #f8fafc;
    --ty-header-text: #64748b;
    --ty-row-hover: #fcfcfc;
    --ty-btn-text: #ffffff;
    --ty-text-dark: #1e293b;
    --ty-text-light: #64748b;
    --ty-radius: 12px;
    --ty-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ty-font: "Vazirmatn", system-ui, sans-serif;
}

.ty-wrap {
    font-family: inherit;
    direction: rtl;
    margin: 30px 0;
    color: var(--ty-text-dark);
}

.ty-wrap * {
    box-sizing: border-box;
}

/* --- 2. Unified Card Container --- */
.ty-unified-card {
    background: #fff;
    border: 1px solid var(--ty-border-color);
    border-radius: var(--ty-radius);
    box-shadow: var(--ty-shadow-card);
    overflow: hidden;
}

/* --- 3. Toolbar Rows --- */
.ty-toolbar-container {
    background: #fff;
}

.ty-toolbar-row {
    padding: 16px 24px;
    border-bottom: 1px solid var(--ty-border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ty-toolbar-row:last-child {
    border-bottom: none;
}

/* Row 1: Search */
.ty-row-search {
    padding-bottom: 4px;
    border-bottom: none;
}

.ty-search-wrapper {
    position: relative;
    width: 100%;
}

.ty-search-icon {
    position: absolute;
    left: 12px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ty-text-light);
    pointer-events: none;
    font-size: 18px;
    display: flex;
}

.ty-search-input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--ty-border-color);
    border-radius: var(--ty-radius) !important;
    background: var(--ty-bg-light);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    text-align: right !important;
    direction: rtl !important;
}

.ty-search-input::placeholder {
    text-align: right !important;
    direction: rtl !important;
}

.ty-search-input:focus {
    background: #fff;
    border-color: var(--ty-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Row 2: Filters */
.ty-row-filters {
    justify-content: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: none !important;
}

/* Modern Switch Toggle */
.ty-filter-item select {
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--ty-border-color);
    border-radius: var(--ty-radius);
    background-color: #fff;
    color: var(--ty-text-dark);
    font-size: 13px;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.5rem;
}

.ty-filter-item select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.ty-filter-item select:focus {
    border-color: var(--ty-primary);
    box-shadow: none;
    outline: none;
}

/* Modern Switch Toggle */
.ty-filter-stock {
    margin-right: auto;
}

.ty-stock-toggle-modern {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.ty-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ty-text-dark);
}

.ty-toggle-slider {
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 24px;
    position: relative;
    transition: all 0.3s;
}

.ty-toggle-slider::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ty-stock-filter {
    display: none;
}

.ty-stock-filter:checked+.ty-toggle-slider {
    background-color: var(--ty-primary);
}

.ty-stock-filter:checked+.ty-toggle-slider::after {
    transform: translateX(20px);
}

/* Row 3: Actions */
.ty-row-actions {
    justify-content: space-between;
    background: #fff;
    border-top: none;
    border-bottom: 1px solid var(--ty-border-color) !important;
    padding-top: 8px;
}

.ty-actions-group-primary,
.ty-actions-group-secondary {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ty-actions-group-primary .added_to_cart {
    display: none !important;
}

/* Buttons */
.ty-wrap .button {
    height: 42px;
    padding: 0 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    transition: all 0.2s !important;
    font-size: 13px !important;
}

.btn-ty-bulk-add {
    background: var(--ty-primary) !important;
    color: var(--ty-btn-text) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

.btn-ty-bulk-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #94a3b8 !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-ty-bulk-add:hover {
    background: var(--ty-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-ty-print-text,
.btn-ty-csv,
.btn-ty-copy,
.btn-ty-clear-filters {
    background: #fff !important;
    border: 1px solid var(--ty-border-color) !important;
    color: var(--ty-text-light) !important;
}

.btn-ty-print-text:hover,
.btn-ty-csv:hover,
.btn-ty-copy:hover {
    border-color: var(--ty-primary) !important;
    color: var(--ty-primary) !important;
    background: transparent !important;
}

.btn-ty-clear-filters:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: transparent !important;
}

/* --- 4. Table Styling (Separated Cards) --- */
.ty-unified-card {
    padding: 16px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.ty-variation-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
    margin-top: -10px;
    table-layout: auto;
}

.ty-variation-table thead th {
    background: var(--ty-header-bg);
    color: var(--ty-header-text);
    font-weight: 700;
    padding: 8px 12px;
    text-align: var(--ty-th-align, center);
    font-size: 13px;
    border: none;
}

.ty-variation-table thead th:first-child {
    border-top-right-radius: var(--ty-radius);
    border-bottom-right-radius: var(--ty-radius);
}

.ty-variation-table thead th:last-child {
    border-top-left-radius: var(--ty-radius);
    border-bottom-left-radius: var(--ty-radius);
}

.ty-variation-table tbody td {
    background: #fff;
    padding: 8px 12px;
    vertical-align: middle;
    text-align: var(--ty-td-align, center);
    border-top: 1px solid var(--ty-border-color);
    border-bottom: 1px solid var(--ty-border-color);
    transition: all 0.2s;
    word-break: keep-all;
}

.ty-variation-table tbody td:first-child {
    border-right: 1px solid var(--ty-border-color);
    border-top-right-radius: var(--ty-radius);
    border-bottom-right-radius: var(--ty-radius);
}

.ty-variation-table tbody td:last-child {
    border-left: 1px solid var(--ty-border-color);
    border-top-left-radius: var(--ty-radius);
    border-bottom-left-radius: var(--ty-radius);
}

.ty-variation-row:hover td {
    background-color: var(--ty-row-hover);
    border-color: var(--ty-border-color);
}

/* Specific Columns Styling */
.ty-col-price {
    color: var(--ty-primary);
    font-weight: 700;
    font-size: 15px;
    font-feature-settings: "ss01";
}

/* Quantity Stepper */
.ty-quantity-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ty-border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
    background: #fff;
    width: 100px;
    /* Reduced width for better control */
}

.ty-qty-btn {
    width: 36px;
    height: 100%;
    background: var(--ty-bg-light);
    border: none;
    color: var(--ty-text-dark);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}

.ty-qty-btn:hover:not(:disabled) {
    background: #e2e8f0;
    color: var(--ty-primary);
}

.ty-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ty-qty-input {
    width: 28px;
    height: 100%;
    border: none !important;
    text-align: center;
    font-feature-settings: "ss01";
    font-size: 14px;
    font-weight: 600;
    color: var(--ty-text-dark);
    background: transparent;
    padding: 0;
    margin: 0;
    appearance: textfield;
    /* Standard property */
    -moz-appearance: textfield;
    /* Firefox */
}

.ty-qty-input::-webkit-outer-spin-button,
.ty-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ty-qty-input:focus {
    outline: none;
    box-shadow: none !important;
}

.btn-ty-add-to-cart {
    border-radius: 50px !important;
    padding: 0 24px !important;
    font-weight: 600 !important;
    background: var(--ty-primary) !important;
    color: var(--ty-btn-text) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
    transition: transform 0.1s !important;
}

.btn-ty-add-to-cart:hover {
    transform: scale(1.05);
    background: var(--ty-primary-hover) !important;
}

.btn-ty-add-to-cart:active {
    transform: scale(0.95);
}

.ty-col-select input[type="checkbox"],
.ty-select-all {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    background: #fff;
    margin: 0;
}

.ty-col-select input[type="checkbox"]:checked,
.ty-select-all:checked {
    background-color: var(--ty-primary);
    border-color: var(--ty-primary);
}

.ty-col-select input[type="checkbox"]:disabled,
.ty-variation-checkbox:disabled {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.ty-variation-row.out-of-stock {
    background-color: #fafafa;
}

.ty-variation-row.out-of-stock td {
    color: #94a3b8;
}

.ty-col-select input[type="checkbox"]:checked::after,
.ty-select-all:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Swatches */
.ty-swatch {
    display: inline-block;
    width: var(--ty-swatch-size, 22px);
    height: var(--ty-swatch-size, 22px);
    border-radius: var(--ty-swatch-radius, 50%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
    margin-inline-end: 8px;
    background-size: cover;
    background-position: center;
}

.ty-col-title {
    white-space: normal;
    word-break: break-word;
}

.ty-variation-attributes {
    display: flex;
    align-items: center;
    justify-content: var(--ty-td-flex-align, center);
    gap: 4px;
    flex-wrap: nowrap;
}

.ty-attr-with-swatch {
    display: inline-flex;
    align-items: center;
}

.ty-attr-separator {
    color: var(--ty-text-light);
    opacity: 0.6;
    margin: 0 2px;
}

/* Mobile Display Modes */
.ty-mobile-scroll .ty-variation-table {
    display: table;
}

@media (max-width: 768px) {
    /* Scroll Mode */
    .ty-mobile-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ty-mobile-scroll .ty-variation-table {
        min-width: 600px; /* Force scroll */
        width: 100%;
        margin: 0;
    }

    /* Cards Mode (Default or Explicit) */
    .ty-mobile-cards .ty-variation-table {
        width: 100%;
        margin: 0;
    }

    .ty-mobile-cards .ty-variation-table thead {
        display: none;
    }

    .ty-mobile-cards .ty-variation-table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 24px;
        background: #fff;
        border-radius: 16px;
        border: 1px solid var(--ty-border-color);
        box-shadow: var(--ty-shadow-card);
        padding: 8px 0;
        transition: background-color 0.2s;
        overflow: hidden; /* Ensure hover covers rounded corners */
    }

    .ty-mobile-cards .ty-variation-table tr:hover {
        background-color: var(--ty-row-hover);
    }

    .ty-mobile-cards .ty-variation-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed var(--ty-border-color);
        padding: 14px 20px;
        min-height: 50px;
        background: transparent !important;
        border-right: none !important;
        border-left: none !important;
        border-radius: 0 !important;
    }

    /* Remove divider from the first cell (Selection section) */
    .ty-mobile-cards .ty-variation-table td:first-child {
        border-top: none;
        padding-top: 10px;
    }

    /* Move checkbox to right in RTL */
    .ty-mobile-cards .ty-variation-table td.ty-col-select {
        flex-direction: row-reverse;
        border-bottom: 1px dashed var(--ty-border-color); /* Maintain consistency if needed, or remove if it's the very first */
    }
    
    /* If the first cell is specifically what should have no divider ABOVE it, 
       it's already handled as there is no border-top by default on TDs. 
       If the user meant the divider BELOW the select section, we can adjust.
       But usually "بالاش" means "above it". 
    */

    .ty-mobile-cards .ty-variation-table td:last-child {
        border-bottom: none;
    }

    .ty-mobile-cards .ty-variation-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 13px;
    }

    /* Remove labels for image and select columns in mobile cards */
    .ty-mobile-cards .ty-variation-table td.ty-col-image::before,
    .ty-mobile-cards .ty-variation-table td.ty-col-select::before {
        display: none;
    }

    /* Adjust layout for image and select when label is hidden */
    .ty-mobile-cards .ty-variation-table td.ty-col-image,
    .ty-mobile-cards .ty-variation-table td.ty-col-select {
        justify-content: center;
    }
    
    /* Ensure checkbox style is consistent */
    .ty-mobile-cards .ty-variation-checkbox {
        appearance: none;
        -webkit-appearance: none;
        width: 22px;
        height: 22px;
        border: 2px solid #cbd5e1;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        background: #fff;
        margin: 0;
        flex-shrink: 0;
    }

    .ty-mobile-cards .ty-variation-checkbox:checked {
        background-color: var(--ty-primary);
        border-color: var(--ty-primary);
    }

    .ty-mobile-cards .ty-variation-checkbox:checked::after {
        content: '';
        position: absolute;
        left: 6px;
        top: 2px;
        width: 6px;
        height: 11px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }
    
    /* Toolbar adjustments for mobile */
    .ty-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ty-filter-stock {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .ty-row-actions {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .ty-actions-group-primary,
    .ty-actions-group-secondary {
        display: contents !important;
    }

    .btn-ty-bulk-add {
        flex: 1 1 calc(50% - 4px) !important;
        order: 1 !important;
        justify-content: center !important;
    }

    .btn-ty-clear-filters {
        flex: 1 1 calc(50% - 4px) !important;
        order: 2 !important;
        justify-content: center !important;
    }

    .btn-ty-print-text,
    .btn-ty-copy,
    .btn-ty-csv {
        flex: 1 1 30% !important;
        order: 3 !important;
        justify-content: center !important;
    }
}

/* --- 5. List (Card) Layout Styling --- */
.ty-variation-list {
    padding: 24px;
    background: #fff;
}

.ty-list-header {
    padding: 12px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ty-header-bg);
    border-radius: var(--ty-radius);
    border: 1px solid var(--ty-border-color);
}

.ty-list-header label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ty-header-text);
    cursor: pointer;
    margin: 0;
}

.ty-list-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.ty-list-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.ty-list-item:hover {
    border-color: transparent;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.ty-list-item-cols {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 12px;
    flex-grow: 1;
}

.ty-list-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.ty-list-col:last-child {
    border-bottom: none;
}

.ty-col-label {
    color: #64748b;
    font-weight: 500;
    font-size: 12px;
}

.ty-col-content {
    color: var(--ty-text-dark);
    font-weight: 600;
    text-align: left;
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Image styling */
.ty-list-item .ty-col-image {
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- 6. Pagination Styling --- */
.ty-pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px;
    margin-top: 0;
    background: #fff;
    border-top: 1px solid var(--ty-border-color);
}

.ty-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--ty-border-color);
    border-radius: 10px;
    color: var(--ty-text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.ty-page-link:hover:not(.disabled):not(.active) {
    border-color: var(--ty-primary);
    color: var(--ty-primary);
    background: transparent;
    transform: translateY(-2px);
}

.ty-page-link.active {
    background: var(--ty-primary);
    border-color: var(--ty-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ty-page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--ty-bg-light);
}

.ty-page-prev, .ty-page-next {
    font-size: 18px;
}

.ty-page-dots {
    color: var(--ty-text-light);
    font-weight: bold;
    padding: 0 5px;
}

/* RTL Specific adjustments for pagination arrows */
.ty-rtl .ty-page-prev, 
.ty-rtl .ty-page-next {
    transform: rotate(0); /* Ensure they are not double-rotated if browser does it */
}

/* Mobile responsive pagination */
@media (max-width: 480px) {
    .ty-pagination-wrap {
        gap: 5px;
        padding: 16px 10px;
    }
    
    .ty-page-link {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 8px;
    }
}


.ty-list-item .ty-col-image .ty-col-content {
    width: 100%;
    height: 100%;
}

.ty-list-item .ty-col-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    border-radius: var(--ty-img-radius, 8px);
}

.ty-product-img {
    width: var(--ty-img-size, 40px) !important;
    height: var(--ty-img-size, 40px) !important;
    object-fit: cover !important;
    border-radius: var(--ty-img-radius, 8px) !important;
    display: block !important;
    margin: 0 auto !important;
    transition: transform 0.2s !important;
}

.ty-list-item:hover .ty-col-image img {
    transform: scale(1.05);
}

/* Title and Price emphasis */
.ty-list-item .ty-col-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.ty-list-item .ty-col-title .ty-col-label {
    display: none;
}

.ty-list-item .ty-col-title .ty-col-content {
    font-size: 16px;
    color: var(--ty-text-dark);
    font-weight: 700;
    text-align: right;
    width: 100%;
    justify-content: flex-start;
}

.ty-list-item .ty-col-price {
    background: #f8fafc;
    margin: 8px -20px;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.ty-list-item .ty-col-price .ty-col-label {
    font-weight: 600;
    color: #475569;
}

.ty-list-item .ty-col-price .ty-col-content {
    color: var(--ty-primary);
    font-size: 18px;
    font-weight: 800;
}

/* Quantity and Add to Cart */
.ty-list-item .ty-col-qty {
    margin-top: auto;
    padding-top: 12px;
}

.ty-list-item .ty-col-qty .ty-qty-input {
    width: 80px;
    height: 36px;
    border-radius: 8px;
}

.ty-list-item .ty-col-add {
    padding: 0 20px 20px;
}

.ty-list-item .btn-ty-add-to-cart {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-weight: 700;
    justify-content: center;
    background: var(--ty-primary) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(var(--ty-primary-rgb), 0.2);
    transition: all 0.2s;
}

.ty-list-item .btn-ty-add-to-cart:hover {
    background: var(--ty-primary-hover) !important;
    box-shadow: 0 6px 16px rgba(var(--ty-primary-rgb), 0.3);
    transform: translateY(-2px);
}

/* Bulk Select */
.ty-list-item .ty-col-select {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .ty-list-items {
        grid-template-columns: 1fr;
    }
}

/* Notices */
.ty-notices {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 300px;
}

.ty-message {
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-right: 4px solid var(--ty-primary);
}

.ty-message.success {
    border-right-color: #22c55e;
}

.ty-message.error {
    border-right-color: #ef4444;
}

/* Global Hide View Cart Link */
.ty-wrap .added_to_cart {
    display: none !important;
}

/* Loading Spinner */
.btn-ty-add-to-cart {
    position: relative;
    /* overflow: visible for shadow */
}

.btn-ty-add-to-cart.loading {
    opacity: 0.8 !important;
    pointer-events: none;
    color: transparent !important;
}

.btn-ty-add-to-cart.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ty-spin 0.8s linear infinite;
    display: block;
}

@keyframes ty-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-ty-bulk-add.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-ty-bulk-add.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ty-spin 0.8s linear infinite;
}

/* --- Image Lightbox --- */
.ty-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
}

.ty-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ty-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    background: #fff;
}

.ty-lightbox-overlay.active .ty-lightbox-img {
    transform: scale(1);
}

.ty-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.ty-lightbox-close:hover {
    transform: scale(1.1);
    color: #fca5a5;
}