/* =========================================
   1. Root Variables & Basic Setup
   ========================================= */
:root {
    --primary-dark: #1a1a2e;
    --primary-red: #c41e3a;
    --primary-navy: #1a2d5e;
    --primary-purple: #4a1c40;
    --card-bg: #EBEDF4;
    --privilege-bg: #9899A2;
    --tab-inactive: #a6abbd;
    --gray-banner: #EBEDF4;
    --ease-gradient: linear-gradient(135deg, #1a1a2e 0%, #c41e3a 100%);
}

body {
    font-family: 'Poppins', 'Kanit', sans-serif !important;
    background-color: #f4f5f7;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* =========================================
   2. Header & Navbar
   ========================================= */
.navbar-main-header {
    background-size: cover;
    background-position: center;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.navbar-container { display: flex; flex-direction: column; width: 100%; }
.navbar-top-row {
    display: flex; justify-content: flex-end; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); margin-bottom: 10px;
}
.nav-icons { display: flex; align-items: center; gap: 20px; }
.nav-icon-item {
    color: white; text-decoration: none; display: flex;
    align-items: center; gap: 5px; font-size: 0.85rem; transition: opacity 0.3s;
}
.nav-icon-item:hover { color: #f1c40f; }

.header-dropdown .btn-dropdown {
    color: white; background: transparent; border: none; font-size: 0.85rem;
    padding: 0; display: flex; align-items: center; gap: 5px;
}
.header-dropdown .dropdown-menu {
    min-width: 160px; background: var(--primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.1); margin-top: 10px !important; z-index: 1050;
}
.header-dropdown .dropdown-item { color: white; font-size: 0.85rem; padding: 8px 15px; }
.header-dropdown .dropdown-item:hover { background: var(--primary-red); color: white; }

.navbar-bottom-row { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand img { height: 50px; }

.search-container { position: relative; width: 100%; max-width: 500px; }
.search-input { border-radius: 25px; padding: 8px 50px 8px 20px; border: none; width: 100%; font-size: 0.95rem; }
.search-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: transparent; color: #666; border: none; font-size: 1.1rem; }

.cart-section { display: flex; align-items: center; gap: 15px; }
.cart-icon { font-size: 1.5rem; color: white; transition: color 0.3s;}
.cart-icon:hover { color: #f1c40f; }
.points-badge {
    background: white; color: var(--primary-red); border-radius: 20px;
    padding: 5px 15px; font-weight: bold; display: inline-flex;
    align-items: center; gap: 5px; font-size: 0.9rem;
}

.main-navigation-bar { background: #fff; border-bottom: 1px solid #eee; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02); z-index: 1000; }
.nav-link-custom { font-weight: 500; color: var(--primary-dark); padding: 15px 20px !important; transition: all 0.3s; border-bottom: 3px solid transparent; }
.nav-link-custom:hover, .nav-link-custom.active { color: var(--primary-red); border-bottom: 3px solid var(--primary-red); }

.breadcrumb-bar { background: #f8f9fa; padding: 10px 0; }

/* =========================================
   3. Common Components & Cards
   ========================================= */
.container-950 { max-width: 950px; margin: 0 auto; padding: 0 15px; }
.carousel-item img { height: 400px; object-fit: cover; border-radius: 15px; }

.service-card {
    border: none; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease; height: 100%; background: var(--card-bg);
}
.service-card:hover { transform: translateY(-5px); }
.service-card img { height: 370px; object-fit: cover; width: 100%; }
.service-card-body { padding: 20px; text-align: center; }

.btn-service, .btn-redeem-pill {
    background: var(--ease-gradient); color: white; border: none; border-radius: 20px;
    padding: 8px 25px; font-size: 0.9rem;
}

.age-service-box { background-color: var(--card-bg) !important; border-radius: 15px; padding: 20px; display: flex; align-items: center; }
.age-icon { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; margin-right: 15px; }

.rec-card { border-radius: 15px; overflow: hidden; position: relative; height: 556px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); background: var(--card-bg); transition: transform 0.3s ease; }
.rec-card:hover { transform: scale(1.02); }
.rec-card img { width: 100%; height: 100%; object-fit: cover; }
.rec-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); padding: 20px; color: white; text-align: center; }

.privilege-section { background: var(--privilege-bg); }
.privilege-card { background: var(--card-bg); border-radius: 15px; overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform 0.3s ease; }
.privilege-card:hover { transform: translateY(-5px); }
.privilege-card img { width: 100%; height: 200px; object-fit: cover; }

/* =========================================
   4. Page: My Account
   ========================================= */
.card-custom { background: var(--card-bg); border-radius: 25px; padding: 30px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04); }
.member-card-visual { background: var(--ease-gradient); height: 200px; padding: 20px; border-radius: 15px; color: white; position: relative; }
.card-label-top { font-weight: 700; font-size: 0.9rem; }
.card-brand-main { margin-top: 30px; }
.card-brand-main h2 { font-weight: 800; margin: 0; }
.card-footer-label { font-size: 0.8rem; position: absolute; bottom: 20px; }
.info-label { font-size: 0.8rem; color: #888; font-weight: 600; margin-bottom: 5px; }
.info-value { font-weight: 700; font-size: 1rem; color: var(--primary-dark); margin-bottom: 15px; }
.btn-navy { background-color: var(--primary-navy); color: white; border-radius: 25px; padding: 8px 25px; font-weight: 600; }
.address-item { background: white; border-radius: 15px; padding: 20px; margin-bottom: 15px; border: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;}

/* =========================================
   5. Page: Packages & Product Detail
   ========================================= */
.tab-nav-container { display: flex; justify-content: center; margin-bottom: 40px; gap: 15px; }
.tab-btn { border: none; padding: 12px 0; width: 250px; border-radius: 12px; font-weight: 600; font-size: 1rem; color: white; transition: 0.3s; text-align: center; }
.tab-btn.active { background-color: var(--primary-navy); }
.tab-btn.inactive { background-color: var(--tab-inactive); }
.tab-pane { display: none; }
.tab-pane.show { display: block; }

.package-card { background: white; border-radius: 35px; border: 1px solid #f0f0f0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); padding: 30px; margin-bottom: 25px; max-width: 850px; margin-left: auto; margin-right: auto; display: flex; align-items: flex-start; gap: 30px; }
.package-img-box { width: 320px; height: 200px; border-radius: 15px; overflow: hidden; flex-shrink: 0; }
.package-img-box img { width: 100%; height: 100%; object-fit: cover; }
.package-info { flex-grow: 1; }
.package-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.package-title { font-weight: 700; font-size: 1.2rem; color: var(--primary-navy); margin: 0; }
.status-badge { font-weight: 700; font-size: 0.85rem; }
.status-active { color: #28a745; }
.status-expired { color: #999; }
.date-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.info-item span { display: block; font-weight: 700; font-size: 0.9rem; color: var(--primary-red); }
.info-item .val-dark { color: #333; }
.points-pill { background: #fff5f6; color: var(--primary-red); border: 1px solid #ffdadd; padding: 2px 10px; border-radius: 20px; font-weight: 600; font-size: 0.75rem; display: inline-block;}
.card-btn-group { display: flex; gap: 10px; }
.btn-navy-small { background-color: var(--primary-navy); color: white; border-radius: 8px; padding: 8px 30px; font-weight: 600; font-size: 0.9rem; flex: 1; text-align: center; text-decoration: none; }
.btn-red-full { background-color: var(--primary-red); color: white; border-radius: 10px; padding: 10px 0; width: 100%; font-weight: 700; font-size: 1rem; margin-top: 10px; text-align: center; text-decoration: none; display: block; }
.btn-navy-small:hover, .btn-red-full:hover { opacity: 0.9; color: white; }

/* Detail Page Specific */
.detail-main-wrapper { padding: 60px 0 100px; }
.detail-card { background: white; border-radius: 40px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05); padding: 50px; border: 1px solid #eee; }
.detail-top-hero { display: flex; gap: 40px; margin-bottom: 45px; padding-bottom: 30px; border-bottom: 1px solid #f2f2f2; }
.detail-img-box { width: 320px; height: 220px; border-radius: 18px; overflow: hidden; flex-shrink: 0; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); }
.detail-img-box img { width: 100%; height: 100%; object-fit: cover; }
.detail-main-title { font-weight: 700; font-size: 1.6rem; color: var(--primary-navy); margin: 0; }
.info-value-navy { font-weight: 700; color: var(--primary-navy); font-size: 1rem; margin-bottom: 15px; }
.section-label-bold { display: block; font-weight: 700; font-size: 1.15rem; color: #000; margin-bottom: 12px; }
.btn-history-pill { background-color: var(--primary-navy); color: white !important; border-radius: 10px; padding: 8px 30px; font-weight: 600; text-decoration: none; transition: 0.3s; }
.service-scope-list { list-style: none; padding-left: 0; margin-bottom: 50px; }
.service-scope-list li { position: relative; padding-left: 20px; font-size: 0.95rem; color: #555; margin-bottom: 8px; }
.service-scope-list li::before { content: "•"; position: absolute; left: 0; color: var(--primary-red); font-weight: 900; font-size: 1.3rem; }

/* =========================================
   6. Page: Rewards & Feedback
   ========================================= */
.reward-banner-gray { background-color: var(--gray-banner); text-align: center; padding: 10px 0; font-size: 0.85rem; font-weight: 600; color: #c41e3a; }
.hero-gradient-box { background: var(--ease-gradient); color: white; padding: 40px 0; }
.hero-inner { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.reward-img-frame { flex: 1; }
.reward-img-frame img { width: 100%; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.hero-text-side { flex: 1; }
.btn-redeem-pill { display: inline-flex; align-items: center; background: white; border: none; border-radius: 30px; padding: 5px; margin-top: 20px; font-weight: 700; }
.btn-redeem-pill .lbl { padding: 5px 20px; color: var(--primary-red); }
.btn-redeem-pill .pts { background: #f8f9fa; border: 1px solid #ddd; border-radius: 25px; padding: 5px 15px; color: #333; }

.feedback-wrapper { padding: 50px 0 100px; }
.feedback-grid { display: flex; gap: 40px; }
.col-left { flex: 0 0 350px; }
.col-right { flex: 1; }
.star-rating i { font-size: 1.8rem; color: #ddd; cursor: pointer; transition: 0.2s; }
.star-rating i.selected { color: #f1c40f; }
.custom-textarea { background-color: var(--card-bg); border: none; border-radius: 12px; padding: 20px; width: 100%; min-height: 220px; resize: none; }
.btn-navy-pill { background-color: var(--primary-navy); color: white !important; border: none; border-radius: 10px; padding: 10px 45px; font-weight: 600; text-decoration: none; }

/* =========================================
   7. Footer
   ========================================= */
footer { background: var(--ease-gradient); color: white; padding: 50px 0 20px; margin-top: auto; }
.footer-divider { border-right: 2px solid rgba(255, 255, 255, 0.3) !important; }
.social-icons a, .social-icons-footer a { color: white; font-size: 1.3rem; margin: 0 10px; transition: color 0.3s; }
.social-icons a:hover, .social-icons-footer a:hover { color: #f1c40f; }
.copyright-text { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); }

/* =========================================
   8. Responsive Design
   ========================================= */
@media (max-width: 991px) {
    .navbar-top-row { display: none; }
    .carousel-item img { height: 250px; }
    .footer-column { text-align: center !important; margin-bottom: 20px; border-right: none !important; }
    .copyright-text { text-align: center; margin-top: 15px; }
    .rec-card { height: 400px; }
    .package-card { flex-direction: column; padding: 20px; border-radius: 25px; }
    .package-img-box, .detail-img-box { width: 100%; height: 200px; }
    .detail-top-hero { flex-direction: column; gap: 25px; }
    .feedback-grid { flex-direction: column; gap: 30px; }
    .col-left { width: 100%; }
    .navbar-toggler { border-color: rgba(255, 255, 255, 0.7) !important; }
    .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important; }
}

/* =========================================
   9. Page: Cart (ตะกร้าสินค้า)
   ========================================= */
.custom-radio { cursor: pointer; width: 18px; height: 18px; background-color: #ddd; border-radius: 50%; display: inline-block; position: relative; transition: 0.3s; }
.radio-active { background-color: var(--primary-red) !important; }

.cart-main { padding: 60px 0 100px; min-height: 70vh; }
.cart-header { display: flex; align-items: center; gap: 15px; max-width: 800px; margin: 0 auto 30px; padding: 0 15px; cursor: pointer; }
.select-all-text { font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); }

.cart-item-card { background: white; border: 1px solid #eee; border-radius: 20px; max-width: 800px; margin: 0 auto 20px; padding: 25px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); transition: 0.3s; cursor: pointer; }
.cart-item-card:hover { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06); }

.item-info-group { display: flex; align-items: center; gap: 25px; flex-grow: 1; }
.item-image-box { width: 180px; height: 120px; border-radius: 12px; overflow: hidden; background: #fcfcfc; display: flex; align-items: center; justify-content: center; border: 1px solid #f0f0f0; }
.item-image-box img { width: 100%; height: 100%; object-fit: cover; }
.item-details { text-align: left; }
.item-title { font-weight: 700; font-size: 1.3rem; color: var(--primary-dark); margin-bottom: 5px; }
.item-subtitle { font-size: 0.95rem; color: #777; margin-bottom: 0; }

.cart-actions { display: flex; justify-content: center; gap: 20px; margin-top: 60px; }
.btn-cart { background: linear-gradient(90deg, #4a1c40 0%, #c41e3a 100%); color: white !important; border: none; border-radius: 50px; padding: 12px 45px; font-size: 1.1rem; font-weight: 600; min-width: 220px; text-decoration: none; text-align: center; box-shadow: 0 4px 15px rgba(196, 30, 58, 0.2); transition: 0.3s; }
.btn-cart:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(196, 30, 58, 0.3); opacity: 0.95; }

/* QR Modal */
.modal-qr-content { border-radius: 20px !important; border: none; overflow: hidden; box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3); }
.modal-qr-blue-section { background-color: var(--primary-dark); color: white; padding: 25px 20px 40px; text-align: center; position: relative; }
.modal-qr-title { font-weight: 700; margin-bottom: 25px; font-size: 1.5rem; letter-spacing: 0.5px; }
.btn-qr-close { position: absolute; right: 20px; top: 20px; background: transparent; border: none; color: white; font-size: 1.2rem; cursor: pointer; transition: 0.2s; opacity: 0.8; z-index: 10; }
.btn-qr-close:hover { opacity: 1; transform: scale(1.1); }
.qr-image-container { display: inline-block; background: white; padding: 12px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
.qr-image-container img { width: 150px; height: 150px; display: block; }
.qr-footer-info { background-color: white; padding: 30px 20px; text-align: center; }
.qr-instruction { font-size: 0.95rem; color: #333; margin: 0; font-weight: 400; letter-spacing: 0.2px; }

/* Floating Chat */
.floating-icon { position: fixed; bottom: 40px; right: 40px; z-index: 1000; }
.chat-btn { width: 60px; height: 60px; background: white; border-radius: 50%; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12); display: flex; align-items: center; justify-content: center; border: 1px solid #f0f0f0; cursor: pointer; transition: transform 0.3s; }
.chat-btn:hover { transform: scale(1.1); }

@media (max-width: 992px) {
    .item-info-group { gap: 15px; }
    .item-image-box { width: 120px; height: 90px; }
    .item-title { font-size: 1.1rem; }
    .cart-actions { flex-direction: column; align-items: center; gap: 15px; }
    .btn-cart { width: 100%; max-width: 320px; }
}