/* Back to Top Button Styles */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: #fff;       
    color: #222;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    cursor: pointer;
    z-index: 1000;
}
.back-to-top:hover {
    background: #f0f0f0;
}

/* Spacing for order form inside cart sidebar */
.cart-step-order .form-input,
.cart-step-order select,
.cart-step-order textarea,
.cart-step-order .cart-section-title {
    margin-bottom: 0.75rem;
}
.cart-step-order .cart-section-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.cart-step-order .form-input:first-child {
    margin-top: 0.5rem;
}

/* =========================
   CART FOOTER (TAMPILAN STRUK)
   ========================= */

.cart-footer {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
}

/* Baris seperti struk kasir */
.cart-footer .row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    width: 100%;
    margin-bottom: 6px;
}

/* Hapus gaya bootstrap jika ada */
.cart-footer .col-6 {
    width: auto !important;
    flex: none !important;
    padding: 0 !important;
}

/* Rata kiri dan kanan ala struk */
.cart-footer .text-start {
    text-align: left !important;
    color: #374151;
}

.cart-footer .text-end {
    text-align: right !important;
    font-weight: 500;
}

/* Garis pemisah sebelum total */
.cart-footer .row.fw-bold {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
    font-size: 15px;
}

/* =========================
   ONGKIR SECTION LEBIH RAPI VERTIKAL
   ========================= */

.shipping-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.shipping-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    transition: 0.2s ease;
}

.shipping-option:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.shipping-option.selected {
    background: #e8f0fe;
    border-color: #667eea;
    border-width: 2px;
}

.shipping-option input[type="radio"] {
    margin-top: 3px;
    cursor: pointer;
}

.shipping-option {
    cursor: pointer;
}

.option-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* =========================
   TOMBOL FULL WIDTH
   ========================= */

.cart-footer .btn {
    width: 100% !important;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 15px;
}

/* Spasi antar tombol */
.cart-footer .row.g-2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Footer tetap rapi di mobile */
@media (max-width: 768px) {
    .cart-footer {
        padding: 14px;
    }
}

/* Order Preview Modal */
.order-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.order-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.order-preview-card {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.order-preview-modal.active .order-preview-card {
    transform: scale(1);
}

.order-preview-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.order-preview-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1e293b;
}

.order-preview-body {
    padding: 20px;
}

.order-preview-section {
    margin-bottom: 24px;
}

.order-preview-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #1e293b;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.order-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.order-preview-table th,
.order-preview-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.order-preview-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.order-preview-table td {
    color: #64748b;
}

.order-preview-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.summary-row.total {
    border-top: 2px solid #1e293b;
    border-bottom: none;
    padding-top: 12px;
    margin-top: 8px;
    font-size: 16px;
}

.order-preview-info {
    color: #64748b;
    line-height: 1.8;
}

.order-preview-info p {
    margin: 4px 0;
}

.order-preview-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: white;
}

.order-preview-footer .btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.order-preview-footer .btn-secondary {
    background: #e5e7eb;
    color: #475569;
}

.order-preview-footer .btn-secondary:hover {
    background: #d1d5db;
}

.order-preview-footer .btn-primary {
    background: #2563eb;
    color: white;
}

.order-preview-footer .btn-primary:hover {
    background: #1e40af;
}

.order-preview-footer .btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

#orderPreviewClose {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

#orderPreviewClose:hover {
    background: #f1f5f9;
    color: #1e293b;
}

@media (max-width: 768px) {
    .order-preview-card {
        width: 95%;
        max-height: 95vh;
    }

    .order-preview-table {
        font-size: 12px;
    }

    .order-preview-table th,
    .order-preview-table td {
        padding: 6px;
    }
}

