/* Floating Container */
.floating-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding: 15px;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 70%, transparent 100%);
}

/* Tombol dengan lebar penuh */
.floating-button {
    background-color: #FF6600;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 18px 25px;
    font-size: x-large;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    pointer-events: auto;
    text-align: center;
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Bagian kiri (Total) */
.button-left {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 15px;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.total-label {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.9;
    margin-bottom: 4px;
    display: block;
}

.total-amount {
    font-size: 22px;
    font-weight: bold;
    color: white;
    display: block;
}

/* Bagian kanan (Teks tombol) */
.button-right {
    flex: 2;
    text-align: right;
    padding-left: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0; /* Penting untuk flex shrink */
}

.button-text {
    font-size: x-large;
    font-weight: bold;
    color: white;
    white-space: nowrap; /* Hindari line break */
    overflow: hidden;
    text-overflow: ellipsis; /* Tambahkan ... jika teks terlalu panjang */
}

/* Icon panah (opsional) */
.button-icon {
    margin-left: 10px;
    font-size: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Jangan biarkan icon mengecil */
}

/* Hover effects */
.floating-button:hover {
    background-color: #E55A00;
    box-shadow: 0 -2px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

    .floating-button:hover .button-icon {
        transform: translateX(5px);
    }

.floating-button:active {
    transform: translateY(1px);
}

.floating-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

    .floating-button:disabled .total-amount {
        color: #888;
    }

/* Animasi muncul */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.floating-container {
    animation: slideUp 0.4s ease-out;
}

/* Responsive Design */
@media (max-width: 992px) {
    .floating-button {
        max-width: 95%;
        padding: 16px 20px;
    }

    .total-label {
        font-size: 13px;
    }

    .total-amount {
        font-size: 20px;
    }

    .button-text {
        font-size: large;
    }
}

/* Tablet (768px dan lebih kecil) */
@media (max-width: 768px) {
    .floating-container {
        padding: 12px 15px;
    }

    .floating-button {
        padding: 14px 18px;
        border-radius: 45px;
        min-height: 65px;
    }

    .total-label {
        font-size: 13px;
    }

    .total-amount {
        font-size: 20px;
    }

    .button-text {
        font-size: 18px; /* Sedikit lebih kecil */
    }

    .button-icon {
        font-size: 18px;
        margin-left: 8px;
    }
}

@media (max-width: 576px) {
    .floating-container {
        padding: 10px 12px;
    }

    .floating-button {
        padding: 12px 15px;
        border-radius: 35px;
        flex-direction: column;
        align-items: stretch;
    }

    .button-left,
    .button-right {
        border: none;
        padding: 0;
        text-align: center;
        width: 100%;
    }

    .button-left {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .total-label {
        font-size: 11px;
        text-align: center;
    }

    .total-amount {
        font-size: 16px;
        text-align: center;
    }

    .button-text {
        font-size: 16px;
    }

    .button-icon {
        display: none; /* Sembunyikan icon di mobile kecil */
    }
}

/* iPhone 12/13/14 (428px dan lebih kecil) */
@media (max-width: 428px) {
    .floating-container {
        padding: 10px 12px;
    }

    .floating-button {
        padding: 12px 16px;
        min-height: 60px;
        border-radius: 40px;
        justify-content: space-between; /* Pastikan tetap di kedua sisi */
        gap: 10px; /* Tambahkan gap antara kiri dan kanan */
    }

    .button-left {
        flex-shrink: 1; /* Izinkan mengecil */
        padding-right: 12px;
        min-width: 0; /* Penting untuk shrink */
    }

    .button-right {
        flex-shrink: 1; /* Izinkan mengecil */
        padding-left: 12px;
        min-width: 0;
        justify-content: flex-end;
    }

    .total-label {
        font-size: 12px;
        white-space: nowrap;
    }

    .total-amount {
        font-size: 18px;
        white-space: nowrap;
    }

    .button-text {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .button-icon {
        font-size: 16px;
        margin-left: 6px;
        flex-shrink: 0;
    }
}

/* Layar kecil (iPhone SE/5 - 375px dan lebih kecil) */
@media (max-width: 375px) {
    .floating-container {
        padding: 8px 10px;
    }
    
    .floating-button {
        padding: 10px 14px;
        min-height: 58px;
        border-radius: 35px;
    }
    
    .total-label {
        font-size: 11px;
    }
    
    .total-amount {
        font-size: 17px;
    }
    
    .button-text {
        font-size: 15px;
    }
    
    .button-icon {
        font-size: 15px;
        margin-left: 5px;
    }
    
    /* Jika teks masih terlalu panjang, singkat teks tombol */
    .button-text:before {
        content: "Pesan"; /* Alternatif: singkat teks */
    }
    
    .button-text span.long-text {
        display: none; /* Sembunyikan teks panjang */
    }
}

/* Untuk layar sangat kecil (320px) */
@media (max-width: 320px) {
    .floating-container {
        overflow-x: auto; /* Tambahkan scroll horizontal jika perlu */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .floating-button {
        min-width: 300px; /* Minimum width agar konten tetap dalam 1 baris */
        padding: 8px 12px;
    }
    
    .total-label {
        font-size: 10px;
    }
    
    .total-amount {
        font-size: 16px;
    }
    
    .button-text {
        font-size: 14px;
    }
    
    .button-icon {
        display: none; /* Sembunyikan icon di layar sangat kecil */
    }
    
    /* Alternatif: ubah teks tombol menjadi lebih pendek */
    .button-text:before {
        content: "Pesan Sekarang";
    }
}


/* Modifikasi untuk teks tombol di tengah */
.floating-button.centered-text .button-right {
    flex: 2; /* Memberikan lebih banyak ruang untuk bagian tengah */
    text-align: center;
    justify-content: center;
}

/* Atau alternatif - hapus struktur kiri/kanan dan buat satu elemen tengah */
.floating-button.simple-center {
    justify-content: center;
}

    .floating-button.simple-center .button-left,
    .floating-button.simple-center .button-right {
        display: none;
    }

.center-content {
    text-align: center;
    flex-grow: 1;
}

/* Tombol lonjong/oval */
.btn-rounded {
    border-radius: 50px !important; /* Nilai besar untuk membuat lonjong */
    padding: 12px 24px !important;
    border: none !important;
    font-size: 22px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

    /* Hover effect */
    .btn-rounded:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15) !important;
        opacity: 0.95 !important;
    }

    /* Active/click effect */
    .btn-rounded:active {
        transform: translateY(1px) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }

    /* Disabled state */
    .btn-rounded:disabled {
        opacity: 0.6 !important;
        cursor: not-allowed !important;
        transform: none !important;
    }

    /* Warna khusus untuk tombol oranye */
    .btn-rounded[style*="background-color:#FF6600"],
    .btn-rounded[backcolor="#FF6600"] {
        background-color: #FF6600 !important;
        background-image: linear-gradient(to right, #FF6600, #FF8533) !important;
    }

        .btn-rounded[style*="background-color:#FF6600"]:hover,
        .btn-rounded[backcolor="#FF6600"]:hover {
            background-color: #E55A00 !important;
            background-image: linear-gradient(to right, #E55A00, #FF6600) !important;
        }


/* Untuk Tombol Di Menu Item*/
.floating-button-wrapper {
    background-color: white;
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    pointer-events: auto;
    animation: slideUp 0.4s ease-out;
    border: 2px solid #e0e0e0; /* Garis border luar yang jelas */
}

/* Bagian kiri - Total */
.floating-left-section {
    flex: 2;
    text-align: left;
    padding-right: 20px;
}

.floating-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #969696;
    margin-bottom: 4px;
}

.floating-total {
    display: block;
    font-size: 22px;
    font-weight: bold;
    color: #676767;
}

/* Bagian tengah - Bill Button */
.floating-center-section {
    flex: 1;
    text-align: center;
    padding: 0 15px;
}

/* Bagian kanan - Pesanan Button */
.floating-right-section {
    flex: 2;
    text-align: right;
    padding-left: 20px;
}

/* Tombol Action */
.floating-action-btn {
    border: none;
    border-radius: 40px;
    padding: 12px 25px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

    /* Tombol Primary (Pesanan) */
    .floating-action-btn.btn-primary {
        background-color: #FF6600;
        color: white;
        width: 100%;
    }

        .floating-action-btn.btn-primary:hover {
            background-color: #E55A00;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
        }

    /* Tombol Outline (Bill) */
    .floating-action-btn.btn-outline {
        background-color: transparent;
        color: #17a2b8;
        border: 2px solid #17a2b8;
    }

        .floating-action-btn.btn-outline:hover {
            background-color: #17a2b8;
            color: white;
            transform: translateY(-2px);
        }

/* Badge untuk jumlah pesanan */
.floating-badge {
    background-color: white;
    color: #676767;
    border-radius: 50px;
    padding: 4px 12px;
    margin-left: 10px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Animasi */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
/* Hapus atau override media query yang terlalu kecil sebelumnya */
@media (max-width: 768px) {
    .floating-button-wrapper {
        padding: 12px 16px;
        border-radius: 45px;
        flex-wrap: nowrap;
        min-height: 70px; /* Tinggi minimum yang cukup */
    }

    .floating-label {
        font-size: 13px; /* Lebih besar dari sebelumnya */
        font-weight: 600;
        white-space: nowrap;
        margin-bottom: 3px;
        color: #666; /* Sedikit lebih gelap untuk kontras lebih baik */
    }

    .floating-total {
        font-size: 18px; /* Lebih besar dan mudah dibaca */
        font-weight: bold;
        white-space: nowrap;
        color: #333; /* Warna lebih gelap */
        line-height: 1.2;
    }

    .floating-left-section,
    .floating-center-section,
    .floating-right-section {
        flex: 1;
        min-width: 0;
        overflow: visible; /* Biarkan konten terlihat */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .floating-left-section {
        flex: 2.5; /* Lebih banyak ruang untuk total */
        text-align: left;
        padding-right: 12px;
    }

    .floating-center-section {
        flex: 1.2;
        text-align: center;
        padding: 0 8px;
    }

    .floating-right-section {
        flex: 2.5; /* Lebih banyak ruang untuk tombol pesanan */
        text-align: right;
        padding-left: 12px;
    }

    .floating-action-btn {
        padding: 10px 16px; /* Padding lebih besar */
        font-size: 16px; /* Font lebih besar untuk mobile */
        font-weight: 600;
        min-width: 75px;
        white-space: nowrap;
        height: 44px; /* Tinggi minimum untuk touch target iOS */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .floating-badge {
        padding: 4px 10px;
        font-size: 14px;
        font-weight: 600;
        margin-left: 6px;
        background-color: #fff;
        color: #333;
        border-radius: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Media query khusus untuk ukuran iPhone 12/13/14 (sekitar 390-428px width) */
@media (max-width: 428px) and (min-width: 375px) {
    .floating-container {
        padding: 10px 12px;
    }

    .floating-button-wrapper {
        padding: 12px 18px;
        min-height: 68px;
        border-radius: 40px;
    }

    .floating-label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .floating-total {
        font-size: 19px; /* Sedikit lebih besar untuk iPhone */
        font-weight: 700;
    }

    .floating-action-btn {
        font-size: 17px; /* Optimal untuk readability di iOS */
        padding: 11px 18px;
        min-width: 80px;
        height: 46px;
    }

    .floating-badge {
        font-size: 15px;
        padding: 5px 11px;
    }
}

/* Untuk layar yang sangat kecil (di bawah iPhone 12) */
@media (max-width: 374px) {
    .floating-container {
        padding: 8px 10px;
    }

    .floating-button-wrapper {
        padding: 10px 14px;
        min-height: 65px;
        border-radius: 35px;
    }

    .floating-label {
        font-size: 12px;
    }

    .floating-total {
        font-size: 17px;
    }

    .floating-action-btn {
        font-size: 15px;
        padding: 9px 14px;
        min-width: 70px;
        height: 42px;
    }

    .floating-badge {
        font-size: 13px;
        padding: 4px 9px;
    }
}

/* Untuk iPhone landscape atau tablet kecil */
@media (max-width: 768px) and (min-height: 375px) and (orientation: landscape) {
    .floating-container {
        padding: 8px 10px;
    }

    .floating-button-wrapper {
        min-height: 60px;
        padding: 10px 15px;
    }

    .floating-action-btn {
        height: 40px;
        padding: 8px 14px;
    }
}

/* Tambahkan CSS untuk memastikan kontras yang baik di berbagai kondisi */
.floating-total {
    text-shadow: 0 1px 1px rgba(0,0,0,0.1); /* Sedikit shadow untuk readability */
}

.floating-action-btn {
    letter-spacing: 0.3px; /* Sedikit spacing untuk readability */
}

.btn-primary {
    background-color: #FF6600 !important;
    background-image: linear-gradient(135deg, #FF6600, #FF8533) !important;
    border: none !important;
    box-shadow: 0 3px 8px rgba(255, 102, 0, 0.3) !important;
}

.btn-outline {
    background-color: white !important;
    color: #17a2b8 !important;
    border: 2px solid #17a2b8 !important;
    font-weight: 600 !important;
}

/* Efek hover untuk mobile (tap feedback) */
@media (hover: none) and (pointer: coarse) {
    .floating-action-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* Pastikan wrapper tidak wrap */
.floating-button-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
}

/* Tambahkan jika perlu scroll horizontal untuk layar sangat sempit */
@media (max-width: 320px) {
    .floating-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px; /* Ruang untuk scrollbar */
    }

    .floating-button-wrapper {
        min-width: 310px; /* Minimum width untuk iPhone SE/5 */
        width: max-content;
    }

    /* Scrollbar styling */
    .floating-container::-webkit-scrollbar {
        height: 4px;
    }

    .floating-container::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2);
        border-radius: 2px;
    }
}

/* CSS khusus untuk floating search panel - tidak mengganggu CSS yang ada */
.floating-search-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    animation: fadeInDown 0.4s ease-out;
}

.floating-search-wrapper {
    background-color: white;
    border-radius: 50px;
    padding: 8px 8px 8px 20px; /* Padding kiri lebih besar untuk input */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #FF6600;
    transition: all 0.3s ease;
    display: inline-block; /* Agar ukuran sesuai konten */
}

    .floating-search-wrapper:hover {
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
        transform: translateY(-2px);
    }

.floating-search-input-group {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Icon tetap di kanan */
    position: relative;
}

.floating-search-input {
    border: none !important;
    outline: none !important;
    font-size: 16px !important;
    padding: 8px 40px 8px 0 !important; /* Padding kanan untuk icon */
    background: transparent !important;
    color: #333 !important;
    min-width: 250px;
    width: 100%;
    font-family: sans-serif;
    box-sizing: border-box;
}

    .floating-search-input::placeholder {
        color: #999 !important;
        font-size: 16px !important;
    }

.floating-search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0; /* Posisi di ujung kanan */
    margin-right: 5px;
}

    .floating-search-button:hover {
        background-color: rgba(255, 102, 0, 0.1);
        transform: scale(1.1);
    }

    .floating-search-button:active {
        transform: scale(0.95);
    }

/* Animasi muncul */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive untuk floating search */
@media (max-width: 992px) {
    .floating-search-container {
        top: 15px;
        right: 15px;
    }

    .floating-search-input {
        min-width: 200px;
        padding: 8px 40px 8px 0 !important; /* Tetap padding untuk icon */
    }

    .floating-search-button {
        right: 0;
        margin-right: 5px;
    }
}

@media (max-width: 768px) {
    .floating-search-container {
        top: 15px;
        right: 15px;
        left: 15px;
        position: fixed;
    }

    .floating-search-wrapper {
        border-radius: 40px;
        padding: 6px 6px 6px 15px; /* Tetap padding kiri lebih besar */
        width: 100%;
        display: block; /* Full width di mobile */
    }

    .floating-search-input {
        min-width: unset !important;
        width: 100% !important;
        font-size: 14px !important;
        padding: 6px 40px 6px 0 !important; /* Tetap ada ruang untuk icon di kanan */
    }

    .floating-search-button {
        position: absolute;
        right: 0;
        margin-right: 5px;
    }

        .floating-search-button img {
            height: 20px !important;
        }
}

@media (max-width: 576px) {
    .floating-search-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .floating-search-wrapper {
        padding: 5px 5px 5px 12px;
    }

    .floating-search-input {
        font-size: 13px !important;
        padding: 5px 35px 5px 0 !important; /* Tetap ada ruang untuk icon */
    }

        .floating-search-input::placeholder {
            font-size: 13px !important;
        }

    .floating-search-button {
        right: 0;
        margin-right: 3px;
    }

        .floating-search-button img {
            height: 18px !important;
        }
}

@media (max-width: 360px) {
    .floating-search-wrapper {
        padding: 4px 4px 4px 10px;
    }

    .floating-search-input {
        font-size: 12px !important;
        padding: 4px 30px 4px 0 !important;
    }

    .floating-search-button img {
        height: 16px !important;
    }
}

