:root {
    --scr-primary: #4f46e5;
    --scr-primary-hover: #4338ca;
    --scr-surface: rgba(255, 255, 255, 0.7);
    --scr-border: rgba(255, 255, 255, 0.6);
    --scr-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
}

.scr-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Glassmorphism Item Cards --- */
.scr-item-card {
    background: var(--scr-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--scr-border);
    border-radius: 16px;
    box-shadow: var(--scr-shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.scr-item-card:hover {
    transform: translateY(-5px) scale(1.01);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.3);
    z-index: 10;
}

/* Gradient Side Line */
.scr-item-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #4f46e5, #ec4899);
    opacity: 0.8;
}

/* RTL Support for Side Line */
[dir="rtl"] .scr-item-card::before {
    left: auto;
    right: 0;
}

.scr-item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.scr-item-card-info .scr-item-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.scr-item-card-info .scr-item-type-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Gradient Tags */
.scr-tag {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.scr-tag.reminder-date { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.scr-tag.sale-alert { background: linear-gradient(135deg, #f59e0b, #d97706); }
.scr-tag.stock-alert { background: linear-gradient(135deg, #10b981, #059669); }

/* Card Buttons */
.scr-item-card-header .button {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.scr-view-details-button {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}
.scr-view-details-button:hover {
    background: #4f46e5 !important;
    color: #fff !important;
}

.scr-delete-cart-button {
    background: #fff1f2 !important;
    color: #e11d48 !important;
}
.scr-delete-cart-button:hover {
    background: #e11d48 !important;
    color: #fff !important;
}

/* --- Settings Card --- */
.scr-settings-card-my-account {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.scr-settings-card-my-account h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #111827;
}

.scr-setting-row-my-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e5e7eb;
}

/* Modern Toggle Switch */
.scr-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-left: 10px;
    margin-right: 10px;
}
.scr-toggle-switch input { opacity: 0; width: 0; height: 0; }

.scr-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}
.scr-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.scr-toggle-switch input:checked + .scr-slider { background-color: #4f46e5; }
.scr-toggle-switch input:checked + .scr-slider:before { transform: translateX(20px); }

/* --- Hidden Details Section (In List) --- */
.scr-item-details {
    background: #f9fafb;
    padding: 0 24px 24px;
    border-top: 1px solid #f3f4f6;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* =========================================
   BASE MODAL STYLES (REQUIRED FOR ALL MODALS)
   ========================================= */
.scr-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* تیره */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* تنظیمات Flex برای وسط‌چین کردن */
    align-items: center;
    justify-content: center;

    opacity: 0;
    transition: opacity 0.3s ease;
}

/* وقتی با JS نمایش داده می‌شود */
.scr-modal[style*="display: flex"],
.scr-modal[style*="display: block"] {
    display: flex !important;
    opacity: 1;
}

/* کانتنت پیش‌فرض مودال */
.scr-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: scrPopUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scrPopUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.scr-close-button {
    position: absolute;
    top: 15px; right: 15px;
    background: #f3f4f6;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    line-height: 1;
    font-size: 20px;
    z-index: 10;
}
.scr-close-button:hover { background: #fee2e2; color: #ef4444; }


/* =========================================
   DETAILS MODAL SPECIFICS
   ========================================= */
#scr-details-modal .scr-modal-body {
    padding: 10px 5px;
}

/* Floating Table Rows */
.scr-cart-products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    margin-bottom: 25px;
}

.scr-cart-products-table thead th {
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 15px 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    text-align: right;
}
[dir="ltr"] .scr-cart-products-table thead th { text-align: left; }

.scr-cart-products-table tbody tr {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scr-cart-products-table tbody tr:hover {
    transform: scale(1.02);
    z-index: 5;
}

.scr-cart-products-table td {
    background: #ffffff;
    padding: 16px;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
    font-weight: 500;
}

.scr-cart-products-table td:first-child {
    border-right: 1px solid #f3f4f6;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
.scr-cart-products-table td:last-child {
    border-left: 1px solid #f3f4f6;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.scr-cart-products-table a {
    text-decoration: none;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: block;
    line-height: 1.4;
}
.scr-cart-products-table a:hover { color: #4f46e5; }

/* Checkboxes */
.scr-select-item, .scr-select-all {
    width: 18px; height: 18px; accent-color: #4f46e5; cursor: pointer; vertical-align: middle;
}

/* Action Buttons Area */
.scr-modal-actions {
    display: flex; gap: 12px; margin-top: 25px; flex-wrap: wrap;
}

.scr-partial-restore-button {
    flex: 2;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    color: white !important;
    border: none !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center;
}
.scr-partial-restore-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
}

.scr-share-cart-button {
    flex: 1;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    border: 1px solid #e5e7eb !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.scr-share-cart-button:hover {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Share Link Box */
.scr-share-link-wrapper {
    background: #1e293b;
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #334155;
    position: relative;
    animation: slideUpFade 0.3s ease;
}
.scr-share-link-input {
    background: transparent !important;
    border: none !important;
    color: #10b981 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    width: 100%;
    outline: none !important;
    cursor: copy;
    padding: 0 !important; margin: 0 !important; box-shadow: none !important;
}
.scr-share-link-input::selection { background: #10b981; color: #000; }

.scr-share-link-wrapper p {
    color: #94a3b8 !important;
    font-size: 12px;
    margin: 10px 0 0 0;
    display: flex; align-items: center; gap: 6px; opacity: 0.8;
}
@keyframes slideUpFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }


/* =========================================
   CUSTOM CONFIRM MODAL (Cool Alert)
   ========================================= */
#scr-confirm-modal {
    z-index: 100005 !important; /* لایه بالاتر از همه */
}

#scr-confirm-modal .scr-modal-content {
    max-width: 380px;
    padding: 35px 25px;
    text-align: center;
}

.scr-confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    animation: shake 0.5s ease-in-out;
}

.scr-confirm-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.scr-confirm-text {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 25px;
    line-height: 1.5;
}

.scr-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.scr-confirm-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.scr-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}
.scr-btn-cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.scr-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.scr-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}