:root {
    --primary-color: #198754;
    --primary-light: #28a745;
    --accent-color: #20c997;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

[data-bs-theme="dark"] {
    --primary-color: #2ecc71;
    --primary-light: #27ae60;
    --accent-color: #1abc9c;
    --bg-light: #1a1d23;
    --text-dark: #e9ecef;
    --text-muted: #adb5bd;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.3);
    --shadow-md: 0 0.5rem 1rem rgba(0,0,0,0.5);
}

* {
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f5f6fa;
}
[data-bs-theme="dark"] body {
    background-color: #121416;
}

/* Header Style */
.checkout-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.checkout-header h1 {
    color: white;
    font-weight: 600;
    margin: 0;
}

/* Stepper */
.stepper-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    padding: 0 1rem;
}

.stepper-item {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.stepper-item .step-counter {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 3px solid #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #adb5bd;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.stepper-item .step-counter .bi-check-lg {
    font-size: 1.2rem;
}

.stepper-item.active .step-counter {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 5px rgba(25,135,84,0.15);
}

.stepper-item.completed .step-counter {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.stepper-item.pending .step-counter {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #adb5bd;
}

.stepper-item .step-name {
    margin-left: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #adb5bd;
    transition: all 0.3s ease;
}

.stepper-item.active .step-name,
.stepper-item.completed .step-name {
    color: var(--primary-color);
}

.stepper-item.pending .step-name {
    color: #ced4da;
}

.stepper-item .step-line {
    width: 70px;
    height: 3px;
    background: #e0e0e0;
    margin: 0 12px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.stepper-item.completed .step-line {
    background: var(--primary-color);
}

.stepper-item.pending .step-line {
    background: #e8e8e8;
}

.stepper-item:hover .step-counter {
    transform: scale(1.08);
}
.stepper-item.active:hover .step-counter {
    transform: scale(1);
}

@media (max-width: 576px) {
    .stepper-wrapper { padding: 0 0.5rem; margin: 1.5rem 0; }
    .stepper-item .step-name { display: none; }
    .stepper-item .step-line { width: 28px; margin: 0 6px; }
    .stepper-item .step-counter { width: 36px; height: 36px; font-size: 0.85rem; }
}
@media (max-width: 400px) {
    .stepper-item .step-line { width: 16px; margin: 0 3px; }
    .stepper-item .step-counter { width: 32px; height: 32px; font-size: 0.78rem; }
}

/* Step content containers */
.step-content {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.step-content.d-none {
    display: none !important;
}
.step-content.fade-in {
    animation: stepFadeIn 0.4s ease forwards;
}
@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
.step-content.fade-out {
    animation: stepFadeOut 0.3s ease forwards;
}
@keyframes stepFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-30px); }
}

/* Step navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}
.step-navigation .btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.step-navigation .btn-outline-secondary:hover {
    background: #e9ecef;
    transform: translateX(-3px);
}
.step-navigation .btn-primary-custom {
    padding: 0.75rem 2rem;
}
#step2 .modern-card,
#step3 .modern-card {
    margin-bottom: 0.25rem;
}
#step2 .modern-card .card-header,
#step3 .modern-card .card-header {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}
#step2 .modern-card .card-body,
#step3 .modern-card .card-body {
    padding: 0.75rem 1rem;
}
#step2 .order-summary,
#step3 .order-summary {
    padding: 0.75rem 1rem;
}
#step2 .order-summary .summary-row,
#step3 .order-summary .summary-row {
    padding: 0.4rem 0;
    font-size: 0.85rem;
}
#step2 .order-summary .summary-row:last-child,
#step3 .order-summary .summary-row:last-child {
    font-size: 1rem;
}
@media (max-width: 576px) {
    .step-navigation {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .step-navigation .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Cards */
.modern-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: none;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}
[data-bs-theme="dark"] .modern-card {
    background: #1a1d23;
    box-shadow: var(--shadow-sm);
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.modern-card .card-header {
    background: white;
    border-bottom: 2px solid var(--bg-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}
[data-bs-theme="dark"] .modern-card .card-header {
    background: #1a1d23;
    border-bottom-color: #2a2d33;
}

.modern-card .card-body {
    padding: 1.5rem;
}

/* Product Items */
.product-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.product-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}
[data-bs-theme="dark"] .product-item:hover {
    background: #25282e;
}

.product-item .product-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
}

.product-item .product-info {
    flex: 1;
    margin-left: 0.6rem;
}

.product-item .product-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.1rem;
    font-size: 0.9rem;
}

.product-item .product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
}

.product-item .product-quantity {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-item .quantity-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
[data-bs-theme="dark"] .product-item .quantity-btn {
    background: #2a2d33;
    border-color: #495057;
    color: var(--text-dark);
}

.product-item .quantity-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.product-item .quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.15rem;
    font-size: 0.85rem;
}
[data-bs-theme="dark"] .product-item .quantity-input {
    background: #2a2d33;
    border-color: #495057;
    color: var(--text-dark);
}

.product-item .delete-btn {
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.product-item .delete-btn:hover {
    transform: scale(1.2);
}

/* Collapse toggle */
.collapse-toggle .collapse-chevron {
    transition: transform 0.3s ease;
    display: inline-block;
}
.collapse-toggle[aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

/* Order Summary */
.order-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}
[data-bs-theme="dark"] .order-summary {
    background: linear-gradient(135deg, #1a1d23 0%, #25282e 100%);
}

.order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}
[data-bs-theme="dark"] .order-summary .summary-row {
    border-bottom-color: #2a2d33;
}

.order-summary .summary-row:last-child {
    border-bottom: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.order-summary .discount-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.order-summary .cupon-row {
    color: var(--bs-success);
}

.order-summary .cupon-badge {
    background: var(--bs-success);
}

[data-bs-theme="dark"] .order-summary .cupon-row {
    color: #75b798;
}

/* Form Controls */
.form-floating > label {
    color: var(--text-muted);
}

.form-control, .form-select {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #2a2d33;
    border-color: #495057;
    color: var(--text-dark);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: #dc3545;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.btn-primary-custom:active {
    transform: translateY(0);
}

/* Icons */
.icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(25, 135, 84, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
    font-size: 0.85rem;
}

/* Modal */
.modern-modal .modal-content {
    border: none;
    border-radius: var(--border-radius);
}
[data-bs-theme="dark"] .modern-modal .modal-content {
    background: #1a1d23;
    color: var(--text-dark);
}

.modern-modal .modal-header {
    border-bottom: none;
}

.modern-modal .modal-footer {
    border-top: none;
}

/* Loading Spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Info */
.user-info-card {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.05) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.user-info-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.user-info-item i {
    color: var(--primary-color);
    margin-right: 0.75rem;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart i {
    font-size: 5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 6px;
}
[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2d33 25%, #3a3d43 50%, #2a2d33 75%);
    background-size: 200% 100%;
}
@keyframes skeletonPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-product-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    background: var(--bg-light);
}
.skeleton-product-item .skeleton-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    flex-shrink: 0;
}
.skeleton-product-item .skeleton-text {
    flex: 1;
    margin-left: 1rem;
}
.skeleton-product-item .skeleton-text .skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    width: 60%;
}
.skeleton-product-item .skeleton-text .skeleton-line.short {
    width: 35%;
}
.skeleton-product-item .skeleton-qty {
    width: 120px;
    height: 35px;
    border-radius: 6px;
    flex-shrink: 0;
}
.skeleton-product-item .skeleton-price {
    width: 80px;
    height: 24px;
    border-radius: 6px;
    margin-left: 1rem;
    flex-shrink: 0;
}

/* Skeleton for checkout forms */
.skeleton-form-group {
    margin-bottom: 1rem;
}
.skeleton-form-group .skeleton-label {
    height: 14px;
    width: 30%;
    margin-bottom: 6px;
}
.skeleton-form-group .skeleton-input {
    height: 50px;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .product-item {
        flex-wrap: wrap;
    }
    
    .product-item .product-info {
        margin-left: 0;
        margin-top: 1rem;
        flex: 100%;
    }
    
    .product-item .product-quantity {
        margin-top: 0.5rem;
    }
}

/* Toast custom styles */
.toast-container {
    font-family: 'Poppins', sans-serif;
}

.bg-success {
    background-color: var(--primary-color) !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.toast {
    min-width: 250px;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.toast-header {
    border-radius: 8px 8px 0 0;
}

.toast-body {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}
.dark-mode-toggle:active {
    transform: scale(0.95);
}
.dark-mode-toggle i {
    font-size: 1.1rem;
}
[data-bs-theme="dark"] .dark-mode-toggle {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.15);
}

/* Coupon quick-apply buttons */
.coupon-quick {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.coupon-quick:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Sticky sidebar for step 2 */
.sticky-sidebar {
    position: sticky;
    top: 1.5rem;
}
@media (max-width: 991.98px) {
    .sticky-sidebar {
        position: static;
    }
}

/* Smaller summary for sidebar */
.sticky-sidebar .order-summary {
    padding: 1rem;
}
.sticky-sidebar .order-summary .summary-row {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
.sticky-sidebar .order-summary .summary-row:last-child {
    font-size: 1.1rem;
}
