:root {
    --primary-orange: #ff5722;
    --primary-red: #f44336;
    --bg-gray: #f5f5f5;
    --text-dark: #222;
    --text-gray: #666;
    --text-light: #999;
    --white: #ffffff;
    --popup-bg: rgba(0, 0, 0, 0.7);
    --gold: #ffc107;
    --green-check: #4caf50;
    --gradient-flash: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hard: 0 10px 30px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #1a1a1a;
    /* Dark background for desktop */
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* --- Main App Container --- */
.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    padding-bottom: 0px;
}

/* --- Header --- */
.top-bar {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
    /* Let clicks pass through transparent parts */
}

.top-bar button {
    pointer-events: auto;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.icon-btn:active {
    background: rgba(0, 0, 0, 0.6);
}

.icon-btn:first-child {
    margin-left: 0;
}

.right-icons {
    display: flex;
}

.cart-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-orange);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid white;
    font-weight: bold;
}

/* --- Hero Slider --- */
.product-hero {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background: #eee;
    overflow: hidden;
}

.slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide {
    min-width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.3);
}

.hero-badge-alert {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

/* --- Flash Sale Bar --- */
.flash-sale-bar {
    background: #d13404;
    /* Bright Orange/Red */
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(255, 61, 0, 0.2);
}

.flash-left {
    font-weight: 800;
    font-style: italic;
    font-size: 1rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-right {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
}

.countdown {
    margin-left: 8px;
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* --- Price Section --- */
.price-section {
    padding: 16px;
    border-bottom: 8px solid var(--bg-gray);
}

.price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.current-price {
    font-size: 2.4rem;
    color: white;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}

.coupon-icon {
    color: white;
    font-size: 1.4rem;
    margin: 0 4px;
    transform: rotate(-10deg);
}

.currency-icon {
    font-size: 1.2rem;
    color: var(--primary-orange);
    font-weight: 700;
    margin-right: 4px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 1rem;
    margin-left: 4px;
}

.discount-badge {
    background: var(--primary-orange);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: auto;
}

.coupon-banner {
    border: 1px solid #ffcdd2;
    color: #d32f2f;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    background: #ffebee;
    font-weight: 600;
}

/* --- Product Info --- */
.product-info {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #111;
}

.product-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
    line-height: 1.4;
}

.rating-row {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-gray);
    flex-wrap: wrap;
    gap: 6px;
}

.stars {
    color: var(--gold);
    display: flex;
    gap: 1px;
}

.rating-score {
    font-weight: bold;
    color: var(--text-dark);
    margin-left: 4px;
}

.separator {
    color: #ddd;
}

.sold-count {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* --- Info Boxes --- */
.info-boxes {
    padding: 16px;
    border-bottom: 8px solid var(--bg-gray);
}

.info-box {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-box:last-child {
    margin-bottom: 0;
}

.info-box i {
    margin-right: 12px;
    font-size: 1.2rem;
}

.green-box {
    background: #e8f5e9;
    color: #2e7d32;
}

.green-box strong {
    color: #2e7d32;
}

.green-text-box {
    background: transparent;
    color: #2e7d32;
    padding: 0 12px;
}

/* --- Seller Info --- */
.seller-info {
    padding: 16px;
    border-bottom: 8px solid var(--bg-gray);
}

.trust-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.trust-status {
    color: #4caf50;
}

.trust-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.trust-fill {
    height: 100%;
    background: linear-gradient(to right, #ff9800, #ff5722);
}

.seller-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.stat {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-gray);
    width: 48%;
}

.stat i {
    margin-right: 4px;
    color: var(--gold);
}

.seller-card-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.8rem;
}

.verified-badge {
    color: #4caf50;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.seller-years {
    color: var(--text-gray);
}

.seller-card {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: #fff;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.seller-avatar {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    border: 1px solid #eee;
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.seller-details {
    flex: 1;
}

.seller-details h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.seller-details p {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.btn-follow {
    border: 1px solid #ddd;
    color: #333;
    background: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

/* --- Reviews Section --- */
.reviews-section {
    padding: 16px;
    border-bottom: 8px solid var(--bg-gray);
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.reviews-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.reviews-rating {
    display: flex;
    align-items: center;
}

.reviews-rating .score {
    font-weight: bold;
    margin-right: 6px;
    font-size: 1.1rem;
}

.reviews-distribution {
    margin-bottom: 30px;
}

.dist-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.stars-label {
    width: 90px;
    display: flex;
    align-items: center;
}

.stars-label i {
    font-size: 0.7rem;
    color: var(--gold);
    margin-right: 2px;
}

.stars-label i.fa-regular {
    color: #e0e0e0;
}

.dist-bar {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin: 0 12px;
    overflow: hidden;
}

.dist-fill {
    background: var(--gold);
    height: 100%;
    border-radius: 3px;
}

.dist-count {
    width: 40px;
    text-align: right;
    font-size: 0.8rem;
}

.review-card {
    border-bottom: 1px solid #eee;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.review-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.review-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-user {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.user-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.name-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.name-row .name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-right: 8px;
}

.stars-small {
    color: var(--gold);
    font-size: 0.75rem;
}

.meta-row {
    font-size: 0.75rem;
    color: var(--text-light);
}

.btn-follow-small {
    background: white;
    border: 1px solid #ddd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.review-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.review-media img {
    width: 100%;
    max-width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #eee;
}

.review-actions {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.review-actions span {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
}

.review-actions span:hover {
    color: var(--primary-orange);
}

.review-actions i {
    margin-right: 6px;
    font-size: 1.1rem;
}

.btn-view-more {
    width: 100%;
    padding: 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 30px;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-view-more:active {
    background: #f5f5f5;
}

/* --- Guarantee Footer --- */
.guarantee-footer {
    background: #e8f5e9;
    color: #2e7d32;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* --- Bottom Bar (FIXED) --- */
.bottom-bar-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 900;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.bottom-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px 12px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.nav-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    font-size: 0.7rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-icon:hover {
    color: var(--primary-orange);
}

.nav-icon i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.btn-cart-icon {
    width: 44px;
    height: 44px;
    border: 1px solid #ffccbc;
    background: #fff;
    color: var(--primary-orange);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* --- REFINED BUY BUTTON --- */
.btn-buy-large {
    flex: 1;
    background: linear-gradient(90deg, #ff5722 0%, #f44336 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 4px 12px;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
    height: 48px;
}

.btn-buy-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-buy-text .btn-title {
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-buy-text .btn-sub {
    font-size: 0.65rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* --- Popup Styles (Refined) --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--popup-bg);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s;
}

.popup-container {
    background: white;
    width: 90%;
    max-width: 340px;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: popupIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-header .badge-bf {
    background: var(--primary-orange);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.3);
}

.popup-header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    color: #111;
    font-weight: 900;
}

.popup-header p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.popup-banner {
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


.banner-img {
    width: 100%;
    display: block;
}

.cards-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-wrapper {
    width: 31%;
    aspect-ratio: 2 / 3;
    perspective: 1000px;
    cursor: pointer;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* Fix for mobile clipping */
    transform: translateZ(0);
}

.card-front {
    background: #fff;
    border: none;
}

.card-gift-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    border: 2px solid var(--primary-orange);
}

.card-back-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.btn-primary-popup {
    background: var(--primary-orange);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 87, 34, 0.3);
    transition: transform 0.1s;
}

.btn-primary-popup:active {
    transform: scale(0.98);
}

.popup-footer-text {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 16px;
}

/* --- Chat Popup --- */
.chat-popup {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    transition: bottom 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.chat-popup.active {
    bottom: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-header button {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 4px;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chat-welcome {
    display: flex;
    align-items: flex-end;
    margin-bottom: 24px;
}

.chat-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-bubble {
    background: linear-gradient(135deg, #ff512f, #dd2476);
    color: white;
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(221, 36, 118, 0.2);
    max-width: 80%;
    line-height: 1.4;
    font-weight: 500;
}

.chat-options p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
    font-weight: 500;
}

.chat-option-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid #eee;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.chat-option-btn:hover {
    background: #fff0eb;
    border-color: #ffccbc;
    color: var(--primary-orange);
}

.chat-footer-info {
    padding: 16px;
    background: #222;
    color: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.75rem;
}

/* --- Store Popup --- */
.store-popup-container {
    padding: 0;
    overflow: hidden;
}

.store-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.store-popup-body {
    padding: 24px;
}

.store-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.store-badge-row {
    margin-bottom: 10px;
}

.trusted-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.store-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.store-popup-logo img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.store-popup-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.store-products {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.store-since {
    color: #999;
    font-size: 0.8rem;
}

/* --- Buy Popup (Bottom Sheet Style) --- */
#buy-popup-overlay {
    align-items: flex-end;
    /* Align to bottom */
    padding: 0;
}

.buy-popup-container {
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    margin: 0;
    padding: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    transform: translateY(100%);
    /* Start hidden */
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.buy-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: none;
}

.buy-popup-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
}

.buy-popup-body {
    padding: 0 24px 24px 24px;
}

.buy-product-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.buy-product-img {
    width: 220px;
    /* Larger image */
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 8px;
}

.buy-product-details h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    line-height: 1.3;
}

.buy-product-details p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 16px;
}

.buy-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.badge-free-shipping {
    background: #E0F7FA;
    /* Light Cyan */
    color: #006064;
    /* Dark Cyan */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-stock {
    background: #FFEBEE;
    /* Light Red */
    color: #D32F2F;
    /* Red */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot-stock {
    width: 8px;
    height: 8px;
    background: #D32F2F;
    border-radius: 50%;
}

.buy-price-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.buy-current-price {
    color: #ff5722;
    /* Orange */
    font-weight: 900;
    font-size: 1.8rem;
}

.buy-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
}

.buy-discount {
    background: #FFCCBC;
    color: #D84315;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
}

.buy-popup-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-secondary-popup {
    width: 100%;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 14px;
    border-radius: 30px;
    /* Rounded pill */
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.btn-confirm-buy {
    width: 100%;
    background: #ff5722;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 30px;
    /* Rounded pill */
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    margin-top: 0;
    /* Remove margin */
}

/* --- Responsive Tweaks --- */
@media (min-width: 481px) {
    body {
        display: flex;
        justify-content: center;
        background: #1a1a1a;
    }

    .top-bar,
    .bottom-bar-container,
    .chat-popup {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* --- Dynamic Classes --- */
.success-message-box {
    background: #FFF3E0;
    color: #E65100;
    padding: 16px;
    border-radius: 16px;
    margin-top: 12px;
    animation: popupIn 0.4s;
    border: 1px solid #FFE0B2;
}

.success-message-box h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    font-weight: 800;
}

.success-message-box p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #E65100;
}

.selection-message-box {
    background: #FFF3E0;
    color: #E65100;
    padding: 12px;
    border-radius: 12px;
    margin-top: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    animation: popupIn 0.3s;
    border: 1px solid #FFE0B2;
}

/* --- Chat Messages (Dynamic) --- */
.chat-message {
    margin-bottom: 12px;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: popupIn 0.3s;
}

.chat-message.user {
    background: #e0e0e0;
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.chat-message.seller {
    background: linear-gradient(135deg, #ff512f, #dd2476);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-typing {
    align-self: flex-start;
    background: #f0f0f0;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: popupIn 0.3s;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #aaa;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.chat-content-area {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

/* --- Product Description Section --- */
.product-description-section {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
}

.product-desc-text h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-desc-text p {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* --- Product Images Grid --- */
.product-images-section {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.images-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.images-grid img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* --- Features List --- */
.features-section {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.features-list {
    list-style: none;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.features-list li i {
    color: #4caf50;
    font-size: 1rem;
}

/* --- Items Included Table --- */
.items-section {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.items-subtitle {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 12px;
    font-weight: 500;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.items-table th {
    text-align: left;
    padding: 10px;
    background: #f9f9f9;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.items-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: var(--text-dark);
}

.items-table tr:last-child td {
    border-bottom: none;
}

/* --- Tech Specs --- */
.specs-section {
    padding: 16px;
    border-bottom: 8px solid var(--bg-gray);
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}

.spec-item i {
    color: var(--primary-orange);
    font-size: 1.1rem;
    margin-top: 2px;
    width: 20px;
    text-align: center;
}

.spec-item span {
    color: var(--text-dark);
    line-height: 1.4;
}

/* --- Large Info Boxes --- */
.large-info-boxes {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 8px solid var(--bg-gray);
}

.info-box-large {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid;
}

.info-box-large.green {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.info-box-large.blue {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1565c0;
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.info-box-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* --- Footer Links --- */
.footer-links {
    padding: 20px 16px;
    background: white;
}

.footer-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111;
}

.footer-link-list {
    list-style: none;
}

.footer-link-list li {
    margin-bottom: 12px;
}

.footer-link-list a {
    text-decoration: none;
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* --- Flash Sale & Price Section (Restored) --- */
.flash-sale-bar {
    background: #ff3d00;
    /* Solid orange to match price section */
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.flash-left {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flash-right {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.95rem;
}

.price-section {
    background: #f35d2f;
    padding: 0 16px 16px 16px;
    /* No top padding to merge with flash bar */
    color: white;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.coupon-icon {
    font-size: 1.2rem;
    margin-right: 4px;
}

.currency-icon {
    display: none;
}

.original-price {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
}

.discount-badge {
    background: #f06820;
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    margin-left: 8px;
}

.coupon-banner {
    margin-top: 8px;
    background: white;
    color: #ff3d00;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    /* Pill shape */
    display: inline-block;
    border: 1px solid #ff3d00;
    font-weight: 500;
}

/* --- Footer Refinements --- */
.footer-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.center-title {
    text-align: center;
    margin-bottom: 20px;
}

.footer-guarantees-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 16px;
}

.footer-guarantee-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.footer-guarantee-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.footer-guarantee-item .dot.green {
    background-color: #4caf50;
}