:root {
    --primary-color: #008F97;
    --white: #fff;
    --light-gray: #f4f4f4;
    --text-color: #333;
    --accent-color: #ffc107;
    --link-color: #007bff;
    --error-color: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-decoration: none;
    outline: none;
    border: none;
    text-transform: capitalize;
    transition: all .2s linear;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-padding-top: 7rem;
    scroll-behavior: smooth;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 9%;
    background: var(--primary-color);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .1);
    z-index: 1000;
}

.header .logo a {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--white);
}

.header .navbar a {
    font-size: 1.7rem;
    color: var(--white);
    margin-left: 2.5rem;
}

.header .navbar a:hover {
    color: var(--light-gray);
}

.header .icons {
    display: flex;
    align-items: center;
}

.header .icons .cart-icon-container {
    position: relative;
    cursor: pointer;
    margin-left: 2rem;
}

.header .icons .cart-icon-container #keranjang {
    font-size: 2.5rem;
    color: var(--white);
}

.header .icons .cart-icon-container #keranjang:hover {
    color: var(--light-gray);
}

.header .icons .cart-count {
    position: absolute;
    top: -0.5rem;
    right: -1rem;
    background-color: red;
    color: white;
    font-size: 1.2rem;
    border-radius: 50%;
    padding: 0.2rem 0.6rem;
    font-weight: bold;
    display: none;
}

#hamburger-btn {
    font-size: 2.5rem;
    color: var(--white);
    cursor: pointer;
    margin-left: 2rem;
    display: none;
}

#hamburger-btn:hover {
    color: var(--light-gray);
}

/* --- Konten Utama & Bagian Produk --- */
.main-content {
    padding: 10rem 9% 3rem;
}

.search-bar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.search-input {
    width: 60%;
    padding: 1.5rem 2rem;
    font-size: 1.6rem;
    border: 1px solid #ddd;
    border-radius: .5rem;
}

.search-button {
    padding: 1.5rem 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.6rem;
    border-radius: .5rem;
    cursor: pointer;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: .2rem;
}

.product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.product-card {
    background: var(--white);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .1);
    overflow: hidden;
    padding: 2rem;
    text-align: center;
    width: calc(50% - 1rem);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-image {
    width: 100%;
    height: auto;
    border-radius: .5rem;
    margin-bottom: 1.5rem;
}

.product-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-description {
    font-size: 1.4rem;
    color: var(--text-color);
    flex-grow: 1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.product-price {
    margin-bottom: 1.5rem;
}

.original-price {
    font-size: 1.4rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 1rem;
}

.discount-price {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.add-to-cart, .view-details {
    padding: 1.2rem;
    font-size: 1.4rem;
    border-radius: .5rem;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--white);
}

.view-details {
    background-color: var(--light-gray);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.add-to-cart:hover, .view-details:hover {
    opacity: 0.8;
}

/* --- Animasi Produk --- */
.animate-product {
    position: absolute;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background-color: rgba(0, 143, 151, 0.5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 1s ease-in, top 1s ease-in, left 1s ease-in, opacity 1s ease-in;
    opacity: 1;
    pointer-events: none;
    z-index: 9999;
}

/* --- Pop-up Keranjang --- */
.cart-popup {
    position: fixed;
    width: 30rem;
    max-width: 90vw;
    background-color: var(--white);
    border-radius: 1rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,0.1);
    padding: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.cart-popup.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.cart-popup::before {
    content: '';
    position: absolute;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--white);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.cart-header h3 {
    font-size: 2rem;
    color: var(--primary-color);
}

.cart-items {
    max-height: 25rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    font-size: 1.6rem;
    width: 60%;
}

.cart-item-name {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.cart-item-price-quantity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 40%;
}

.cart-item-price {
    color: var(--text-color);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-display {
    font-size: 1.6rem;
    width: 2rem;
    text-align: center;
}

.cart-footer {
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.summary-label {
    font-weight: bold;
    color: var(--primary-color);
}

.total-price-container {
    display: flex;
    justify-content: space-between;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.6rem;
    border-radius: .5rem;
    cursor: pointer;
}

/* --- Responsive Layout --- */
@media (max-width: 991px) {
    html {
        font-size: 55%;
    }
    .header {
        padding: 2rem;
    }
    .main-content {
        padding: 10rem 2rem 3rem;
    }
}

@media (max-width: 768px) {
    #hamburger-btn {
        display: inline-block;
    }
    .header .navbar {
        position: absolute;
        top: 100%;
        right: -100%;
        background: var(--primary-color);
        width: 30rem;
        height: calc(100vh - 9rem);
        display: flex;
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        transition: right .3s ease-in-out;
    }
    .header .navbar.active {
        right: 0;
    }
    .header .navbar a {
        font-size: 2rem;
        color: var(--white);
        margin: 1.5rem 0;
    }
    .product-card {
        width: calc(50% - 1rem);
    }
    .close-cart-btn {
        display: block;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        font-size: 3rem;
        color: var(--text-color);
        cursor: pointer;
    }
    .cart-popup {
        left: 50%;
        transform: translateX(-50%);
        top: 8rem;
    }
    .cart-popup::before {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

@media (max-width: 450px) {
    .cart-popup {
        width: 90%;
        max-width: 100%;
    }
}

/* --- Gaya Pop-up Detail Produk --- */
.product-detail-popup, .tutor-detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.product-detail-popup.active, .tutor-detail-popup.active {
    display: flex;
}

.popup-content {
    background-color: var(--white);
    padding: 3rem;
    border-radius: 1rem;
    position: relative;
    max-width: 50rem;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.product-detail-popup.active .popup-content, .tutor-detail-popup.active .popup-content {
    transform: scale(1);
}

.close-popup-btn, .close-popup-btn-tutor {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    cursor: pointer;
    color: var(--text-color);
}

#popup-product-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#popup-product-description {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

#popup-product-price {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.attention-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 1.5rem;
    border: 1px solid #ffeeba;
    border-radius: 0.5rem;
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.add-to-cart-popup {
    padding: 1.5rem;
    font-size: 1.6rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
}

/* --- Bagian Tutor Profesional --- */
.section-description {
    font-size: 1.6rem;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 3rem;
    max-width: 70rem;
    margin-left: auto;
    margin-right: auto;
}

.tutor-container {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.tutor-container::-webkit-scrollbar {
    height: 8px;
}

.tutor-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.tutor-container::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.tutor-card {
    min-width: 25rem;
    flex-shrink: 0;
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .1);
    padding: 2rem;
    text-align: center;
    scroll-snap-align: center;
}

.tutor-photo {
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 3px solid var(--primary-color);
}

.tutor-name {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tutor-short-desc {
    font-size: 1.4rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.view-tutor-details {
    padding: 1.2rem 2.5rem;
    font-size: 1.6rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
}

/* --- Gaya Pop-up Detail Tutor --- */
.tutor-detail-popup .popup-content {
    max-width: 45rem;
    width: 90%;
    padding: 3rem;
    text-align: left;
}

.close-popup-btn-tutor {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    cursor: pointer;
    color: var(--text-color);
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2rem;
}

.popup-tutor-photo {
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    object-fit: cover;
}

#popup-tutor-name {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.popup-info p {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.popup-info strong {
    color: var(--primary-color);
}

.select-tutor-btn {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0.5rem;
    cursor: pointer;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .tutor-container {
        justify-content: flex-start;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* --- Bagian Rating & Ulasan --- */
.review-section {
    padding: 1rem 9%;
}

.invalid-link-message {
    text-align: center;
    padding: 5rem 0;
}

.whatsapp-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.2rem 3rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    background-color: #25D366; /* Warna hijau WhatsApp */
    border-radius: 5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
    transition: all .3s ease;
    margin-top: 2rem;
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-.3rem);
}

.whatsapp-btn i {
    margin-right: 1rem;
}

/* Tata letak slider untuk daftar ulasan */
.review-list-container {
    max-width: 1200px; /* Lebar maksimum untuk kontainer */
    margin: 2rem auto; /* Pusatkan kontainer */
    padding: 0 2rem; /* Tambahkan padding agar ada ruang di samping pada layar kecil */
}

#reviews-list {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 1rem; /* Padding di bawah untuk scrollbar */
    scroll-snap-type: x mandatory;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-color) var(--light-gray); /* Firefox */
}

#reviews-list::-webkit-scrollbar {
    height: 8px;
}

#reviews-list::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 10px;
}

#reviews-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.review-item {
    min-width: 320px; /* Menyesuaikan lebar minimum untuk setiap item ulasan */
    width: 350px; /* Lebar default untuk setiap item ulasan */
    max-width: calc(100% - 4rem); /* Pastikan item tidak lebih lebar dari kontainer pada layar sangat kecil */
    flex-shrink: 0;
    scroll-snap-align: start;
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    display: flex; /* Menggunakan flexbox untuk tata letak internal */
    flex-direction: column;
}

.review-item:hover {
    transform: translateY(-5px);
}

.review-item .review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.review-item .reviewer-info {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--text-color);
}

.review-item .review-rating {
    color: var(--accent-color);
    font-size: 1.8rem;
}

.review-item .review-service {
    font-size: 1.4rem;
    color: #666;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.review-item .review-text {
    font-size: 1.4rem;
    color: #666;
    line-height: 1.6;
    flex-grow: 1; /* Agar teks ulasan mengisi ruang yang tersedia */
}

/* --- Media Queries untuk responsivitas ulasan --- */
@media (max-width: 768px) {
    .review-list-container {
        padding: 0 1rem;
    }
    .review-item {
        min-width: 280px; /* Ukuran yang lebih kecil untuk layar tablet */
        width: 300px;
    }
}

@media (max-width: 480px) {
    .review-list-container {
        padding: 0 0.5rem;
    }
    .review-item {
        min-width: calc(100% - 2rem); /* Hampir 100% lebar layar pada mobile */
        width: calc(100% - 2rem);
    }
}

/* --- Bagian Jasa Lain --- */
#other-services {
    padding: 4rem 9%;
    text-align: center;
}

.services-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-btn {
    padding: 1.5rem 2.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.6rem;
    font-weight: bold;
    border-radius: 0.8rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.service-btn:hover {
    background-color: #007c84;
    transform: translateY(-0.5rem);
}

/* --- Footer --- */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 2rem 9%;
}

.footer p {
    font-size: 1.4rem;
    margin: 0;
}

.footer a {
    color: var(--white);
    text-decoration: underline;
    font-weight: bold;
}

/* --- Tombol WhatsApp Mengambang --- */
.whatsapp-float-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #25D366;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.6rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    animation: bounce 2s infinite;
}

.whatsapp-float-btn:hover {
    background-color: #128C7E;
    transform: scale(1.05);
    animation: none; /* Hentikan animasi saat di-hover */
}

.whatsapp-float-btn i {
    font-size: 2.2rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* --- Pop-up Kustom (Alert & Confirm) --- */
.custom-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.custom-popup-content {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.3s ease-in-out;
}

.custom-popup-content span {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2rem;
    display: block;
}

.custom-popup-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.custom-popup-btn:hover {
    transform: translateY(-2px);
}

.custom-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.confirm-yes {
    background-color: #4CAF50;
    color: white;
}

.confirm-yes:hover {
    background-color: #45a049;
}

.confirm-no {
    background-color: var(--error-color);
    color: white;
}

.confirm-no:hover {
    background-color: #da190b;
}

#custom-alert-close {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    font-weight: bold;
}

#custom-alert-close:hover {
    background-color: #3e8e41;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Gaya Pop-up Pembayaran --- */
#payment-popup .custom-popup-content h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

#payment-popup .custom-popup-content .form-group {
    text-align: left;
    margin-bottom: 2rem;
}

#payment-popup .custom-popup-content .form-group label {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

#payment-popup .custom-popup-content .form-group input,
#payment-popup .custom-popup-content .form-group select {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background-color: var(--white);
    color: var(--text-color);
}

#payment-popup .custom-popup-content .btn {
    width: 100%;
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.6rem;
    border-radius: .5rem;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
}

