/* ========================================
   Shopping Cart - Advanced Styles
======================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --text-color: #374151;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --light-bg: #f9fafb;
}

/* ========================================
   Container
======================================== */
.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Cart Section
======================================== */
.cart-section {
    padding: 40px 0 80px;
    background: var(--light-bg);
    min-height: calc(100vh - 200px);
}

/* ========================================
   Cart Header
======================================== */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.cart-header h1 {
    font-size: 2rem;
    color: var(--dark-color);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.cart-header h1 svg {
    width: 32px;
    height: 32px;
    stroke: var(--primary-color);
}

.cart-count-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ========================================
   Empty Cart
======================================== */
.empty-cart {
    background: white;
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-cart h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.empty-cart p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.empty-cart .btn-primary {
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s;
}

.empty-cart .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Cart Layout
======================================== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* ========================================
   View Toggle
======================================== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: fit-content;
}

.view-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   Cart Items
======================================== */
.cart-items {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Cart Item
======================================== */
.cart-item {
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s;
    background: white;
}

.cart-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

/* ========================================
   Item Header
======================================== */
.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.item-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.item-domain {
    flex: 1;
}

.domain-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.domain-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.item-price {
    text-align: right;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--dark-color);
}

.btn-remove {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    border-color: var(--danger-color);
    background: var(--danger-color);
}

.btn-remove:hover svg {
    stroke: white;
}

.btn-remove svg {
    width: 20px;
    height: 20px;
    stroke: var(--danger-color);
    transition: all 0.3s;
}

/* ========================================
   Item Options
======================================== */
.item-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 12px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.option-label svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-color);
}

.option-price {
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 700;
}

.option-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s;
}

.option-select:hover,
.option-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ========================================
   Toggle Switch
======================================== */
.toggle-wrapper {
    position: relative;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 52px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background: var(--success-color);
}

.toggle-input:checked + .toggle-label::after {
    left: 27px;
}

/* ========================================
   Button Link
======================================== */
.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    padding: 8px 0;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Premium Option
======================================== */
.premium-option {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #fbbf24;
}

.badge-new {
    background: var(--danger-color);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ========================================
   Item Summary
======================================== */
.item-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
}

/* ========================================
   Bulk Actions
======================================== */
.bulk-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-outline {
    padding: 12px 25px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Order Summary
======================================== */
.order-summary {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
}

.order-summary h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0 0 25px 0;
    font-weight: 800;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-color);
}

.summary-row.sub {
    font-size: 0.9rem;
    color: var(--text-light);
    padding-left: 15px;
}

.summary-row.tax {
    font-weight: 600;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark-color);
    padding-top: 15px;
}

.summary-row.total span:last-child {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

/* ========================================
   Discount Section
======================================== */
.discount-section {
    margin: 20px 0;
}

.discount-toggle {
    width: 100%;
    padding: 12px 15px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.discount-toggle:hover {
    border-color: var(--primary-color);
    background: white;
}

.discount-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--warning-color);
}

.discount-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.discount-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
}

.discount-form button {
    padding: 12px 25px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.discount-form button:hover {
    background: #059669;
}

/* ========================================
   Checkout Button
======================================== */
.btn-checkout {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.btn-checkout svg {
    width: 22px;
    height: 22px;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.85rem;
}

.security-note svg {
    width: 16px;
    height: 16px;
    stroke: var(--success-color);
}

/* ========================================
   Modal
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
    font-weight: 800;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ========================================
   Radio Group
======================================== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-option input:checked ~ .radio-content {
    color: var(--primary-color);
}

.radio-content {
    flex: 1;
}

.radio-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
}

.radio-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   Custom NS Fields
======================================== */
.custom-ns-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.custom-ns-fields input {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
}

/* ========================================
   Modal Buttons
======================================== */
.modal-footer .btn-secondary,
.modal-footer .btn-primary {
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ========================================
   Toast
======================================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    background: var(--success-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transform: translateY(-100px);
    transition: all 0.4s ease-out;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--danger-color);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-items {
        order: 1; /* يظهر أولاً */
        padding-bottom: 100px; /* مسافة للزر الثابت */
    }
    
    .order-summary {
        position: static;
        order: 2; /* يظهر ثانياً */
    }
    
    .item-options {
        grid-template-columns: 1fr;
    }
    
    /* جعل الزر فقط ثابت */
    .btn-checkout {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }
}
@media (max-width: 768px) {
    .cart-header h1 {
        font-size: 1.5rem;
    }
    
    .cart-items {
        padding: 20px;
    }
    
    .item-header {
        flex-wrap: wrap;
    }
    
    .domain-name {
        font-size: 1.1rem;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
        justify-content: center;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .btn-outline {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container-wide {
        padding: 0 15px;
    }
    
    .cart-section {
        padding: 20px 0 60px;
    }
    
    .cart-items {
        padding: 15px;
    }
    
    .item-check {
        display: none;
    }
    
    .modal-content {
        margin: 0 10px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
    }
}