/* ===== Main Cart Section ===== */
.cart-section {
    padding: 2rem 0;
    min-height: 60vh;
}

/* Cart Items Card */
.cart-items-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff, #fafafa);
}

.cart-items-card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.cart-items-card .card-header {
    background: linear-gradient(135deg, #f0f4ff, #ffffff);
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    padding: 1.5rem 1.75rem;
}

.cart-items-card .card-header h5 {
    color: #2d3748;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.25rem;
}

.cart-items-card .card-header .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

/* Table Styles */
.cart-table {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cart-table thead {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.cart-table thead th {
    color: #2d3748;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    letter-spacing: 0.3px;
}

.cart-table thead th:first-child {
    border-radius: 10px 0 0 0;
}

.cart-table thead th:last-child {
    border-radius: 0 10px 0 0;
}

.cart-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    background: white;
}

.cart-table tbody tr:hover {
    background: linear-gradient(145deg, #fefefe, #f8f9fa);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.cart-table tbody tr:last-child {
    border-bottom: none;
}

.cart-table tbody td {
    padding: 1.5rem 1.5rem;
    vertical-align: middle;
    border: none;
    position: relative;
}

.cart-table tbody td:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05), transparent);
}

/* Cart Item Image */
.cart-item-image-wrapper {
    width: 90px;
    height: 120px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cart-item-image-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cart-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cart-item-img:hover {
    transform: scale(1.1);
}

/* Book Details */
.cart-item-details {
    padding-right: 1rem;
    position: relative;
}

.cart-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2d3748;
    line-height: 1.4;
}

.cart-item-title a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.cart-item-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.cart-item-title a:hover {
    color: #667eea;
}

.cart-item-title a:hover::after {
    width: 100%;
}

.cart-item-details small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cart-item-details small i {
    width: 16px;
    color: #888;
    font-size: 0.85rem;
}

/* Price */
.cart-item-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.quantity-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f7fafc;
}

.quantity-input {
    width: 70px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.3s ease;
    background: white;
    font-size: 0.95rem;
}

.quantity-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-info {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #f7fafc;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.stock-info::before {
    content: '📦';
    font-size: 0.9rem;
}

/* Total Price */
.cart-item-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
}

/* Remove Button */
.remove-item {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #fc8181;
    background: white;
    color: #fc8181;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(252, 129, 129, 0.1);
}

.remove-item:hover {
    background: linear-gradient(135deg, #fc8181, #f56565);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(252, 129, 129, 0.3);
}

/* Card Footer */
.cart-items-card .card-footer {
    background: linear-gradient(145deg, #f9f9f9, #f2f2f2);
    border-top: 2px solid rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.75rem;
}

#continueShoppingBtn,
#clearCartBtn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    border-width: 2px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

#continueShoppingBtn {
    border-color: #667eea;
    background: white;
    color: #667eea;
}

#continueShoppingBtn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

#clearCartBtn {
    border-color: #fc8181;
    background: white;
    color: #fc8181;
}

#clearCartBtn:hover {
    background: linear-gradient(135deg, #fc8181, #f56565);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(252, 129, 129, 0.3);
}

/* ===== Order Summary Card ===== */
.order-summary-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
    background: linear-gradient(145deg, #ffffff, #fafafa);
}

.order-summary-card .card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border: none;
}

.order-summary-card .card-header h5 {
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

/* Cart Totals */
.cart-totals {
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    margin: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cart-totals > div {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-totals > div:last-child {
    border-bottom: none;
}

.cart-totals span.text-muted {
    color: #666 !important;
    font-size: 0.95rem;
    font-weight: 500;
}

.cart-totals .fw-bold {
    font-size: 1.05rem;
    color: #2d3748;
}

.cart-totals hr {
    margin: 1.25rem 0;
    border-color: rgba(0, 0, 0, 0.08);
    border-width: 2px;
}

.cart-totals .fs-5 {
    font-size: 1.3rem !important;
    font-weight: 700;
}

.cart-totals .text-primary {
    color: #667eea !important;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Discount Section */
.discount-section {
    padding: 1.25rem;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    margin: 1rem;
    border-left: 4px solid #48bb78;
}

.discount-section label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.discount-section .text-success {
    color: #48bb78 !important;
}

.discount-section .input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.discount-section .form-control {
    border: 2px solid #e2e8f0;
    border-right: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.discount-section .form-control:focus {
    border-color: #48bb78;
    box-shadow: none;
}

.discount-section .btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: 2px solid #48bb78;
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.discount-section .btn:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    border-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

#discountMessage {
    min-height: 24px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Checkout Button Container */
.checkout-btn-container {
    padding: 1.25rem;
}

/* Button Styles */
.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Alert Styles */
.alert-info {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border: none;
    color: #1565c0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #2196f3;
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.1);
}

.alert-info .alert-link {
    color: #0d47a1;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.alert-info .alert-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* Payment Methods - نسخة محسّنة بعرض موحد 100% */
.payment-methods {
    padding: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(145deg, #f9f9f9, #f2f2f2);
    border-radius: 0 0 12px 12px;
}

.payment-methods p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 1rem !important;
    font-size: 1rem;
}

.payment-methods .text-primary {
    color: #667eea !important;
}

/* إخفاء البادجات القديمة */
.payment-badges {
    display: none !important;
}

/* الحاوي الجديد لطرق الدفع */
.payment-methods .d-flex.flex-column {
    gap: 0.75rem;
}

/* كل طريقة دفع تأخذ عرض كامل ومتساوي */
.payment-methods .d-flex.align-items-center {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.35s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* تأثير الـ hover */
.payment-methods .d-flex.align-items-center:hover {
    border-color: #667eea;
    background: #f8fbff;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.18);
}

/* الأيقونة داخل دائرة ملونة */
.payment-methods .fs-4 {
    width: 52px;
    height: 52px;
    flex-shrink: 0; /* مهم جدًا للحفاظ على حجم ثابت */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    margin-left: 0.75rem;
}

/* لون خلفية الأيقونة حسب الطريقة */
.payment-methods .d-flex.align-items-center:nth-child(1) .fs-4 {
    background: rgba(34, 197, 94, 0.15);   /* أخضر فاتح - الدفع عند الاستلام */
    color: #16a34a;
}

.payment-methods .d-flex.align-items-center:nth-child(2) .fs-4 {
    background: rgba(59, 130, 246, 0.15);   /* أزرق فاتح - التحويل البنكي */
    color: #3b82f6;
}

/* النصوص */
.payment-methods .fw-bold {
    color: #1a202c;
    font-size: 0.98rem;
    margin-bottom: 0.2rem;
}

.payment-methods small {
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.3;
}
/* Security Badges */
.security-badges {
    padding: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(145deg, #ffffff, #fafafa);
    border-radius: 0 0 15px 15px;
}

.security-badges small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.security-badges .text-success {
    color: #48bb78 !important;
}

.security-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.security-icons i {
    font-size: 1.5rem;
    color: #667eea;
    transition: all 0.3s ease;
}

.security-icons i:hover {
    color: #764ba2;
    transform: scale(1.2);
}

/* ===== Empty Cart State ===== */
.empty-cart-section {
    padding: 4rem 0;
    text-align: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    margin: 2rem 0;
}

.empty-cart-animation {
    margin-bottom: 2rem;
}

.cart-icon-wrapper {
    position: relative;
    display: inline-block;
}

.cart-icon-wrapper i {
    font-size: 6rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
    animation: cartBounce 2s ease-in-out infinite;
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cart-empty-dots {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.cart-empty-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    animation: dotsPulse 1.4s ease-in-out infinite;
}

.cart-empty-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.cart-empty-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotsPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.5); opacity: 0.5; }
}

.empty-cart-content {
    max-width: 800px;
    margin: 0 auto;
}

.empty-cart-content h1 {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.empty-cart-content .text-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-cart-content .lead {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Stats Card */
.stats-card {
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #fafafa);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stats-card .card-title {
    color: #2d3748;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.stat-item {
    padding: 1rem;
    text-align: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
    font-size: 1.5rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon .text-primary { color: #667eea; }
.stat-icon .text-success { color: #48bb78; }
.stat-icon .text-warning { color: #ed8936; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
}

/* Action Buttons Container */
.action-buttons-container {
    padding: 2rem 0;
}

.action-buttons-container h6 {
    color: #666;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn {
    min-width: 200px;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.action-btn span {
    font-size: 1rem;
    font-weight: 600;
}

.action-btn small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Quick Recommendations */
.quick-recommendations {
    padding: 2rem 0;
}

.quick-recommendations h6 {
    color: #666;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.quick-recommendations .text-warning {
    color: #ed8936 !important;
}

.recommendation-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #fafafa);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.rec-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(145deg, #f7fafc, #edf2f7);
}

.rec-icon .text-purple { color: #9f7aea; }
.rec-icon .text-danger { color: #f56565; }
.rec-icon .text-info { color: #4299e1; }

.recommendation-card h6 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.recommendation-card p {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.4;
}

/* Newsletter Section */
.newsletter-section {
    padding: 2rem 0;
}

.newsletter-section .card {
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #fafafa);
}

.newsletter-section .card-title {
    color: #2d3748;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.newsletter-form .input-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.newsletter-form .form-control-lg {
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.newsletter-form .btn-lg {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Social Proof */
.social-proof {
    padding: 2rem 0;
}

.social-proof h6 {
    color: #666;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.testimonial-badge {
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    background: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.testimonial-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.testimonial-badge .text-warning { color: #ed8936; }
.testimonial-badge .text-success { color: #48bb78; }
.testimonial-badge .text-info { color: #4299e1; }

/* ===== Related Books ===== */
.related-books-section {
    margin-top: 3rem;
}

.related-books-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background: linear-gradient(145deg, #ffffff, #fafafa);
}

.related-books-card .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 1.75rem;
}

.related-books-card .card-header h5 {
    color: #2d3748;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.25rem;
}

.related-books-card .card-body {
    padding: 1.5rem;
}

#relatedBooksContainer {
    min-height: 150px;
}

.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.2em;
    color: #667eea;
}

/* ===== Loading States ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .cart-section {
        padding: 1.5rem 0;
    }
    
    .cart-items-card .card-header,
    .order-summary-card .card-header {
        padding: 1.25rem;
    }
    
    .cart-table tbody td {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 992px) {
    .cart-table thead {
        display: none;
    }
    
    .cart-table tbody tr {
        display: block;
        margin-bottom: 1.25rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        padding: 1.25rem;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
    
    .cart-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
    }
    
    .cart-table tbody td:not(:last-child)::after {
        display: none;
    }
    
    .cart-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #667eea;
        margin-left: 1rem;
        font-size: 0.9rem;
        min-width: 100px;
        text-align: right;
    }
    
    .cart-table tbody td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 1rem;
    }
    
    .cart-item-image-wrapper {
        margin: 0;
        order: 2;
    }
    
    .cart-item-details {
        order: 1;
        flex: 1;
        padding-right: 0;
    }
    
    .quantity-controls {
        order: 3;
        justify-content: flex-end;
    }
    
    .order-summary-card {
        position: static;
        margin-top: 2rem;
    }
    
    .action-buttons-container .d-flex {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .cart-section {
        padding: 1rem 0;
    }
    
    .empty-cart-content h1 {
        font-size: 2rem;
    }
    
    .empty-cart-content .lead {
        font-size: 1rem;
    }
    
    .cart-icon-wrapper i {
        font-size: 5rem;
    }
    
    .stats-card .row > div {
        margin-bottom: 1rem;
    }
    
    .quick-recommendations .row > div {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .cart-items-card .card-header h5,
    .order-summary-card .card-header h5,
    .related-books-card .card-header h5 {
        font-size: 1.1rem;
    }
    
    .cart-table tbody tr {
        padding: 1rem;
    }
    
    .cart-table tbody td::before {
        min-width: 80px;
        font-size: 0.85rem;
    }
    
    .cart-item-image-wrapper {
        width: 70px;
        height: 95px;
    }
    
    .cart-item-title {
        font-size: 1rem;
    }
    
    .cart-item-details small {
        font-size: 0.85rem;
    }
    
    .cart-item-price,
    .cart-item-total {
        font-size: 1.05rem;
    }
    
    .quantity-input {
        width: 60px;
    }
    
    .empty-cart-section {
        padding: 2rem 0;
        margin: 1rem 0;
    }
    
    .testimonial-badge {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* ===== Accessibility Improvements ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Print Styles ===== */
@media print {
    .cart-section {
        padding: 0;
    }
    
    .cart-items-card,
    .order-summary-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn,
    #continueShoppingBtn,
    #clearCartBtn,
    .discount-section,
    .security-badges,
    .empty-cart-section,
    .related-books-section {
        display: none !important;
    }
    
    .cart-table thead th {
        background: white;
        color: black;
        border-bottom: 2px solid black;
    }
}