/* CSS Variables */
:root {
    --cyan: #00d4ff;
    --magenta: #ff1757;
    --yellow: #ffd700;
    --pink: #ff69b4;
    --orange: #ff8c00;
    --green: #00ff7f;
    --purple: #9370db;
    --dark: #000000;
    --darker: #000000;
    --card-bg: #1a1a1a;
    --white: #ffffff;
    --text-muted: #8a8a8a;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.8);
    --font-heading: 'Space Mono', 'Chakra Petch', 'Kanit', monospace;
    --font-body: 'Space Mono', 'IBM Plex Sans Thai', 'Prompt', monospace;
    
    /* Product border colors to match the image */
    --red-border: #ff0000;
    --blue-border: #0066ff;
    --green-border: #00ff00;
    --pink-border: #ff0099;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--dark);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #000000; /* Pure black background */
}

/* Circuit Background Animation */
.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    z-index: -1;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(0, 212, 255, 0.03) 25%, rgba(0, 212, 255, 0.03) 26%, transparent 27%, transparent 74%, rgba(0, 212, 255, 0.03) 75%, rgba(0, 212, 255, 0.03) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 23, 87, 0.03) 25%, rgba(255, 23, 87, 0.03) 26%, transparent 27%, transparent 74%, rgba(255, 23, 87, 0.03) 75%, rgba(255, 23, 87, 0.03) 76%, transparent 77%, transparent);
    background-size: 60px 60px;
    animation: circuit-move 15s linear infinite;
}

@keyframes circuit-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Myhighs Header */
.Myhighs-header {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    backdrop-filter: blur(20px);
}

.selling-banner {
    background: transparent;
    color: #ff4757;
    text-align: center;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    padding: 15px 0;
    text-align: center;
}

.header-center {
    flex: 1;
    text-align: center;
}

.Myhighs-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
}

.Myhighs-logo .highlight {
    color: var(--magenta);
}

.header-right {
    display: flex;
    justify-content: flex-end;
    min-width: 250px;
}

.main-nav {
    display: flex;
    gap: 15px;
}

.nav-btn {
    padding: 8px 20px;
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    background: transparent;
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.shop-btn {
    background: var(--cyan);
    color: var(--dark);
    border-color: var(--cyan);
}

.shop-btn:hover {
    background: rgba(0, 191, 255, 0.8);
}

/* Cart badge for checkout button */
.checkout-nav-btn {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
    transition: all 0.3s ease;
    border: 2px solid var(--dark);
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
    display: none;
}

.cart-badge.has-items {
    display: flex;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(255, 68, 68, 0.5);
    }
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.shop-btn.active {
    background: var(--cyan);
    color: var(--dark);
    border-color: var(--cyan);
}

/* Hero Section */
.hero-section {
    padding: 60px 0;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.feature h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
}

.feature p {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 10px;
}

.feature small {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.4;
}

.price-info {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 40px;
}

.explosion-effect {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background: radial-gradient(circle, 
        rgba(0, 191, 255, 0.3) 0%,
        rgba(255, 20, 147, 0.3) 25%,
        rgba(255, 215, 0, 0.3) 50%,
        rgba(147, 112, 219, 0.3) 75%,
        transparent 100%);
    border-radius: 50%;
    animation: explosion-pulse 3s ease-in-out infinite;
    position: relative;
}

.explosion-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(0, 191, 255, 0.2) 30%,
        rgba(255, 20, 147, 0.2) 60%,
        transparent 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: explosion-rotate 8s linear infinite;
}

@keyframes explosion-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes explosion-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Header */
@media (max-width: 768px) {
    .selling-banner {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 10px 0;
    }
    
    .header-right {
        min-width: auto;
        justify-content: center;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .Myhighs-logo {
        font-size: 1.2rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .feature h3 {
        font-size: 1.5rem;
    }
}

/* Floating Contact Buttons */
.floating-contacts {
    position: fixed;
    right: 30px;
    bottom: 30px;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.contact-float {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.line-btn {
    background: linear-gradient(45deg, #00C300, #00E600);
}

.line-btn:hover {
    background: linear-gradient(45deg, #00E600, #00FF00);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 195, 0, 0.4);
}

.phone-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.phone-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.1);
}

.cart-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.2);
}

.cart-float-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
    transition: all 0.3s ease;
    border: 2px solid var(--dark);
}

.cart-float-badge:empty,
.cart-float-badge[data-count="0"] {
    display: none !important;
}

.cart-float-badge.has-items {
    display: flex;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        background: #ff4444;
    }
    50% {
        transform: scale(1.1);
        background: #ff6666;
    }
}

.contact-float::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.contact-float:active::before {
    width: 200px;
    height: 200px;
}

.contact-float i,
.contact-float svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-contacts {
        right: 8px;
        bottom: 20px;
        left: auto;
        transform: none;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .contact-float {
        width: 50px;
        height: 50px;
    }
    
    .contact-float i,
    .contact-float svg {
        width: 24px;
        height: 24px;
    }
}

/* Main Content */
.main-content {
    padding: 40px 0 100px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 0;
    max-width: 800px;
    margin: 0 auto;
}

/* Product Card - Myhighs Style */
.product-card {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 15px;
    padding: 15px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid var(--glass-border);
}

/* Color-specific borders to match the image */
.product-card[data-product-id="1"] {
    border: 2px solid var(--red-border);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.1);
}

.product-card[data-product-id="2"] {
    border: 2px solid var(--blue-border);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.1);
}

.product-card[data-product-id="3"] {
    border: 2px solid var(--green-border);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.1);
}

.product-card[data-product-id="4"] {
    border: 2px solid var(--pink-border);
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.1);
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-width: 3px;
}

/* Product Image - Myhighs Style */
.product-image {
    width: 100%;
    height: 120px;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image span {
    font-size: 3rem !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Product Name - Myhighs Style */
.product-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--white);
    text-align: center;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

/* Star Rating */
.product-card .product-rating {
    justify-content: flex-start;
    width: 100%;
}

.star {
    color: #ffffff;
    font-size: 0.9rem;
}

.star.empty {
    color: rgba(255, 255, 255, 0.2);
}

/* Price Display - Myhighs Style */
.product-price {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cyan);
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    letter-spacing: 0.05em;
}

/* Buy Now Button - Myhighs Style (Hidden - Card is clickable) */
.add-to-cart {
    display: none;
}

/* Responsive Product Grid */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        max-width: 700px;
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 0;
        max-width: 280px;
    }
    
    .product-card {
        min-height: 250px;
    }
}

/* Removed shine effect - ลบเอฟเฟกต์ที่บังรูป */

/* Product Details */
.product-desc {
    background: rgba(0, 0, 0, 0.5) !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 15px;
}

/* Product Detail Page Styles */
.product-detail-main {
    padding: 35px 0 40px;
    min-height: 100vh;
}

.product-image-large {
    width: 1050px;
    height: 1050px;
    margin: 0;
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 40px;
    position: relative;
    border-bottom: 1px solid #ffffff;
}

.product-image-large::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 100vw;
    height: 1px;
    background: #ffffff;
    transform: translateX(-50%);
    pointer-events: none;
}

.product-image-large img {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.product-info-grid {
    display: grid;
    grid-template-columns: 1050px 1fr 400px;
    gap: 24px;
    margin-bottom: 45px;
    align-items: start;
    /* removed divider, will use on image section */
}

.product-details {
    max-width: 700px;
}

.product-badge {
    background: var(--cyan);
    color: var(--dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 20px;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 5px;
    line-height: 1.1;
}

.product-subtitle {
    display: none;
}

.product-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    margin-left: -2px;
}

.product-rating .star {
    color: #ffffff;
    font-size: 2.4rem;
}

.product-rating .star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.product-price-section {
    margin-bottom: 20px;
}

.price-main {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    color: var(--cyan);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.6);
    letter-spacing: 0.05em;
    text-align: center;
}

.product-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Buy Now Box */
.buy-now-box {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 36px 30px;
    backdrop-filter: blur(15px);
    position: sticky;
    top: 30px;
    height: fit-content;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.buy-title {
    display: none;
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 34px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 22px;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.3);
    color: var(--white);
    font-size: 1.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.quantity {
    font-family: var(--font-heading);
    font-size: 2.28rem;
    font-weight: 700;
    color: var(--white);
    min-width: 72px;
    text-align: center;
}

.add-to-cart-btn {
    width: 100%;
    padding: 14.4px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.08rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.add-to-cart-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.checkout-btn-main {
    width: 100%;
    padding: 16.8px;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 18px;
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.checkout-btn-main:hover {
    background: linear-gradient(45deg, #0099cc, #00d4ff);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 212, 255, 0.4);
}

/* Recommended Products */
.recommended-section {
    margin-top: 30px;
    margin-bottom: 30px;
    padding-top: 25px;
    position: relative;
    border-top: none;
}

.recommended-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    height: 2px;
    background: #ffffff;
    transform: translateX(-50%);
    pointer-events: none;
}

.recommended-title {
    font-family: var(--font-heading);
    font-size: 1.725rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 35px;
}

.recommended-grid {
    display: flex;
    gap: 17px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    border-top: none;
}

.recommended-item {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 17px;
    padding: 18px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    flex: 0 0 184px; /* card width */
    scroll-snap-align: start;
    min-height: 310px;
    position: relative;
}

.recommended-item:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    z-index: 5;
}

.rec-image {
    width: 190px;
    height: 190px;
    margin: 0 auto 17px;
}

.rec-details h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 9px;
}

.rec-price {
    font-size: 1.265rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 9px;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.4);
}

.rec-rating {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.rec-rating .star {
    color: #ffffff;
    font-size: 0.92rem;
}

.rec-rating .star.empty {
    color: rgba(255, 255, 255, 0.2);
}

/* Responsive Product Detail */
@media (max-width: 1200px) {
    .product-info-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .buy-now-box {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .product-info-grid {
        grid-template-columns: 2fr 1fr;
        grid-template-areas:
            "image image"
            "details buy";
        gap: 12.5px;
    }
    .product-image-large {
        grid-area: image;
        width: 100%;
        height: auto;
        max-height: 720px;
        margin: 0 auto;
    }
    .product-details {
        grid-area: details;
    }
    .buy-now-box {
        grid-area: buy;
        max-width: 95%;
        padding: 9px 7.5px;
        margin-right: 4px;
    }
    .product-title {
        font-size: 1.3rem;
    }
    .product-description {
        font-size: 0.95rem;
    }
    .product-price-section {
        display: none;
    }
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8.625px;
    }
    .recommended-item {
        flex: 0 0 280px; /* wider */
        min-height: 160px;
    }
    .rec-image {
        width: 175px;
        height: 142px;
    }
    .rec-details h4 {
        font-size: 1.1rem; /* ลดฟอนต์ */
    }
    .recommended-section {
        margin-top: 20px;
    }
    .recommended-title {
        position: absolute;
        top: -26px; /* สูงกว่าเส้น ::before (2px) + เว้นระยะอีกเล็กน้อย */
        left: 0;
        transform: none;
        margin: 0;
        font-size: 0.95rem;
        text-align: left;
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    /* further shrink gaps */
    .product-info-grid {
        gap: 25px;
    }
    /* --- keep original image size override --- */
    .product-image-large {
        width: 200px;
        height: 200px;
        padding-bottom: 8px;
    }
    .recommended-section {
        margin-top: 6px;
    }
    /* even smaller buy-now */
    .buy-now-box {
        padding: 1.8px 1.5px;
        margin-right: 2px;
    }
    .quantity-selector {
        gap: 1.2px;
        padding: 1.2px;
        margin-bottom: 3px;
    }
    .qty-btn {
        width: 29px;
        height: 29px;
        font-size: 0.96rem;
    }
    .quantity {
        font-size: 0.36rem;
    }
    .add-to-cart-btn {
        padding: 1.8px;
        font-size: 0.3rem;
        margin-bottom: 2.4px;
    }
    .checkout-btn-main {
        padding: 1.8px;
        font-size: 0.3rem;
    }
    .recommended-title {
        top: -22px;
        font-size: 0.75rem;
    }
    .recommended-item {
        flex: 0 0 300px; /* กว้างขึ้นอีก */
        min-height: 70px;
    }
    .rec-image {
        width: 99px;
        height: 77px;
    }
    .rec-details {
        flex: 1;
        text-align: left;
    }
    .rec-details h4 {
        font-size: 0.9rem; /* ลดฟอนต์ชื่อสินค้าแนะนำ */
        margin-bottom: 3px;
    }
    .rec-price {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    .rec-rating {
        justify-content: flex-start;
    }
    .rec-rating .star {
        font-size: 0.9rem;
    }
    /* make the anchor inside card flex as well */
    .recommended-item > a {
        display: flex;
        align-items: center;
        width: 100%;
    }
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.cart-modal.active {
    display: flex;
}

.cart-content {
    background: var(--dark);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    animation: modal-appear 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.cart-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--cyan);
    cursor: pointer;
    padding: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.close-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.4s ease;
}

.close-btn:hover {
    color: var(--white);
    background: var(--magenta);
    border-color: var(--magenta);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 
        0 0 15px rgba(255, 20, 147, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-btn:hover::before {
    left: 100%;
}

.cart-items {
    padding: 20px;
    max-height: 55vh;
    overflow-y: auto;
}

.cart-items:empty::after {
    content: "ตะกร้าสินค้าว่างเปล่า";
    display: block;
    text-align: center;
    opacity: 0.6;
    padding: 40px 20px;
    font-style: italic;
}

.cart-item {
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    margin-bottom: 15px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.total-price {
    color: var(--magenta);
    text-shadow: 0 0 10px var(--magenta);
}

.checkout-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(45deg, var(--cyan), var(--magenta));
    border: 2px solid transparent;
    border-radius: 15px;
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 20px rgba(0, 191, 255, 0.4),
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.checkout-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.checkout-btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(45deg, var(--magenta), var(--cyan));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(255, 20, 147, 0.6),
        0 0 50px rgba(0, 191, 255, 0.4),
        0 15px 35px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: checkout-pulse 0.6s ease-in-out;
}

.checkout-btn:hover::before {
    left: 100%;
}

.checkout-btn:active::after {
    width: 300px;
    height: 300px;
}

.checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.checkout-btn:disabled:hover {
    transform: none;
    animation: none;
}

@keyframes checkout-pulse {
    0%, 100% { 
        transform: translateY(-3px) scale(1.02); 
    }
    50% { 
        transform: translateY(-5px) scale(1.05);
        box-shadow: 
            0 0 40px rgba(255, 20, 147, 0.8),
            0 0 60px rgba(0, 191, 255, 0.6),
            0 20px 40px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile Menu */
.mobile-menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: var(--cyan);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--cyan);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 2px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 80px 30px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.mobile-menu-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--cyan);
    margin: 0;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-nav-item {
    display: block;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-nav-item:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateX(5px);
}

.mobile-nav-item:hover::before {
    left: 100%;
}

.mobile-nav-item.active {
    background: var(--cyan);
    color: var(--dark);
    border-color: var(--cyan);
    font-weight: 600;
}

/* Checkout button in mobile menu */
.checkout-mobile-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.checkout-mobile-btn:hover {
    background: rgba(0, 191, 255, 0.1) !important;
    border-color: var(--cyan) !important;
    color: var(--cyan) !important;
    transform: translateX(5px) !important;
}

.cart-badge-mobile {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: #ff4444;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

.cart-badge-mobile:empty,
.cart-badge-mobile[data-count="0"] {
    display: none;
}

.cart-badge-mobile.has-items {
    display: flex;
    animation: badge-pulse 2s ease-in-out infinite;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cyan), var(--magenta));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--magenta), var(--cyan));
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0 30px;
    }

    .logo {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mobile-menu-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles */
button:focus,
a:focus {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Thai Language Support */
html[lang="th"] {
    word-break: break-word;
}

html[lang="th"] .product-name,
html[lang="th"] .tagline,
html[lang="th"] .product-desc {
    line-height: 1.6;
    word-spacing: 0.1em;
}

html[lang="th"] .add-to-cart,
html[lang="th"] .checkout-btn {
    font-weight: 500;
}

/* Better Thai number display */
html[lang="th"] .product-price,
html[lang="th"] .total-price {
    font-feature-settings: "tnum";
}

/* ราคาใน Buy Box */
.buy-price {
    font-family: var(--font-heading);
    font-size: 1.92rem;
    font-weight: 800;
    color: var(--cyan);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.4);
}

/* Responsive adjustments for very small screens */
@media (max-width: 600px) {
    .product-info-grid {
        grid-template-columns: 55% 45%;
        gap: 7.5px;
    }
    .product-title {
        font-size: 1.1rem;
    }
    .product-rating .star {
        font-size: 1.8rem;
    }
    .product-description {
        font-size: 0.85rem;
    }
    .buy-now-box {
        padding: 7.2px 6px;
        margin-right: 4px;
    }
    .buy-title {
        font-size: 0.84rem;
        margin-bottom: 12px;
    }
    .quantity-selector {
        gap: 12px;
        padding: 7.2px;
        margin-bottom: 15px;
    }
    .qty-btn {
        width: 29px;
        height: 29px;
        font-size: 0.96rem;
    }
    .quantity {
        font-size: 0.96rem;
    }
    .add-to-cart-btn {
        padding: 8.4px;
        font-size: 0.54rem;
        margin-bottom: 10.8px;
    }
    .checkout-btn-main {
        padding: 8.4px;
        font-size: 0.6rem;
    }
    .buy-price {
        font-size: 0.78rem;
        margin-bottom: 10.8px;
    }
}

/* === Product Page Mobile Adjustments === */

/* 1) Make product image divider pure white */
.product-image-large {
    /* previously rgba(255,255,255,0.15) */
    border-bottom: 1px solid #ffffff;
}

/* 2) Remove previous top divider on recommended section */
.recommended-section {
    border-top: none;
}

/* 2.1) Add new divider directly above the recommended grid so that the heading sits above the line */
.recommended-grid {
    border-top: none;
}

/* 3) Recommended card – enlarge height & image, increase title font (mobile) */
@media (max-width: 768px) {
    .recommended-item {
        flex: 0 0 280px; /* wider */
        min-height: 140px;
    }
    .rec-image {
        width: 150px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .recommended-item {
        flex: 0 0 220px; /* wider on very small screens */
        min-height: 80px;
    }
    .rec-image {
        width: 90px;
        height: 70px;
    }
}

/* 4) Align main product rating further left (mobile tweak) */
@media (max-width: 768px) {
    .product-rating {
        margin-left: 0 !important;
    }
}

/* 5) Hide floating contact buttons on mobile – items now accessible via hamburger */
@media (max-width: 768px) {
    .floating-contacts {
        display: none !important;
    }
}

/* End of Product Page Mobile Adjustments */

/* --- Mobile Menu icon buttons at bottom --- */
.mobile-nav-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}
.mobile-nav-icons a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: var(--white);
    transition: all .3s;
}
.mobile-nav-icons a:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: scale(1.1);
}
.mobile-nav-icons .line-icon {
    background: linear-gradient(45deg,#00C300,#00E600);
    border:none;
}
.mobile-nav-icons .line-icon:hover{
    background:linear-gradient(45deg,#00E600,#00FF00);
}

/* -------------------------------------------------------------------
   Product page mobile spacing relaxation (2024-06-24)
   เพิ่มระยะห่างแนวตั้งขององค์ประกอบในหน้า product บนอุปกรณ์มือถือ
------------------------------------------------------------------- */

@media (max-width: 768px) {
    /* เพิ่ม padding ด้านบน/ล่างของเนื้อหาหลักให้โปร่งขึ้น */
    .product-detail-main {
        padding-top: 35px;
        padding-bottom: 40px;
    }

    /* เพิ่มช่องว่างด้านล่างภาพสินค้า */
    .product-image-large {
        padding-bottom: 40px;
    }

    /* เพิ่มระยะห่างระหว่างส่วน image, details และ buy box */
    .product-info-grid {
        gap: 24px;
        margin-bottom: 45px;
    }

    /* เว้นช่องไฟระหว่างองค์ประกอบย่อยภายในรายละเอียดสินค้า */
    .product-details > *:not(:last-child) {
        margin-bottom: 12px;
    }

    /* เว้นระยะเหนือส่วนสินค้าแนะนำให้หายใจได้มากขึ้น */
    .recommended-section {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .product-detail-main {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .product-image-large {
        padding-bottom: 25px;
    }

    .product-info-grid {
        gap: 16px;
        margin-bottom: 35px;
    }

    .recommended-section {
        margin-top: 25px;
        margin-bottom: 25px;
    }
}

/* === Shop page tweaks (remove category filters) === */
#categoryFilters {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reduce top padding of product grid when filters hidden */
.product-grid {
    padding-top: 10px;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.5);
    margin-bottom: 25px;
    cursor: pointer;
}
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
}
.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}
@media (max-width: 768px) {
    .hero-slider {
        height: 260px;
    }
}

.hero-slider .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}
.hero-slider .slider-nav:hover {
    background: rgba(0,0,0,0.6);
}
.hero-slider .slider-nav.prev { left: 15px; }
.hero-slider .slider-nav.next { right: 15px; }
@media (max-width: 768px) {
    .hero-slider .slider-nav {
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
    }
}

/* Hero Slider Mobile Tweaks */
@media(max-width:768px){
  .hero-content{max-width:100%;}
  .hero-slider{height:55vw;}
}
@media(max-width:480px){
  .hero-slider{height:65vw;}
}

.hero-slide img{display:block;width:100%;height:100%;object-fit:cover;} 