/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-blue: #2c96f4;
    --dark-blue: #002b5c; 
    --white: #ffffff;
    --light-gray: #f4f4f4;
}

body {
    background-color: var(--white);
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
header {
    background-color: var(--white);
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: 0.3s;
}

nav ul li a:hover {
    color: var(--primary-blue);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar {
    display: flex;
    background: var(--light-gray);
    padding: 5px 15px;
    border-radius: 20px;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 5px;
    outline: none;
}

.search-bar button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--primary-blue);
}

.login-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.login-btn:hover {
    background-color: #1a7dc0;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    background: linear-gradient(rgba(0, 43, 92, 0.4), rgba(0, 43, 92, 0.4)), 
                url('https://images.unsplash.com/photo-1522771739844-6a9f6d5f14af?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
    color: white;
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    margin-right: 10px;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: #1a7dc0;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    backdrop-filter: blur(5px);
    display: inline-block;
    transition: 0.3s;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-blue);
}

.btn-shop-now {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 25px;
    border: 1.5px solid var(--primary-blue);
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: 0.3s;
}

.btn-shop-now:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-outline {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-outline-white {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--primary-blue); 
    color: var(--primary-blue); 
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-outline-white:hover {
    background-color: var(--primary-blue);
    color: white;
}

/* ==========================================================================
   Main Content Sections & Grids
   ========================================================================== */
.content-section {
    padding: 60px 5%;
    text-align: center;
}

.bg-light {
    background-color: #f9f9f9;
}

.section-header {
    margin-bottom: 40px;
}

.blue-text {
    color: var(--primary-blue);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

/* ---------------------------------------------------
   บังคับให้จัดเรียง 4 คอลัมน์ (4 กล่องต่อ 1 แถวเสมอ)
   --------------------------------------------------- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* บังคับ 4 คอลัมน์ */
    gap: 25px;
}

/* รองรับหน้าจอแท็บเล็ตและมือถือ */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr); /* หน้าจอเล็กลงให้เหลือ 2 คอลัมน์ */
    }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: repeat(1, 1fr); /* หน้าจอมือถือให้เหลือ 1 คอลัมน์ */
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* ==========================================================================
   Cards (Categories & Products)
   ========================================================================== */
.category-card, .product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.category-card:hover, .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-card img, .product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.category-card h3, .product-card h3 {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.product-card h3 {
    padding-bottom: 5px;
}

/* ==========================================================================
   Custom Solution Section
   ========================================================================== */
.custom-solution {
    padding: 60px 5%;
}

.custom-container {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.custom-img {
    flex: 1;
    min-width: 300px;
}

.custom-text {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.custom-img img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.custom-text h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.custom-text p {
    margin-bottom: 20px;
}

.custom-text ul {
    list-style: none;
    margin-bottom: 25px;
}

.custom-text ul li {
    margin-bottom: 10px;
    font-size: 1rem;
}

.custom-text ul li::before {
    content: "•";
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* ==========================================================================
   Reviews Section
   ========================================================================== */
.reviews {
    margin-bottom: 30px;
}

.review-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: 0.3s;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.customer-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    border: 3px solid var(--light-gray);
}

.stars {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.review-card p {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
}

.review-card strong {
    color: #333;
    display: block;
    margin-top: 10px;
}

.center-btn {
    text-align: center;
    margin-top: 40px;
}
.center-btn .btn-secondary{
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.center-btn .btn-secondary:hover{
    color: white;
    background-color: var(--primary-blue);
}

/* ==========================================================================
   Size Guide Section
   ========================================================================== */
.size-guide {
    background-color: var(--white);
}

.size-text {
    flex: 1.5;
    text-align: left;
}

table {
    width: 100%;
    margin: 25px 0;
    border-collapse: collapse;
    text-align: left;
}

table th, table td {
    padding: 15px 12px;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

table tr:hover {
    background-color: #fcfcfc;
}

.size-img-overlay {
    flex: 1;
    background: url('https://images.unsplash.com/photo-1554188248-986adbb73be4?q=80&w=800') center/cover no-repeat;
    border-radius: 10px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.overlay-box {
    background: rgba(255, 255, 255, 0.85); /* สีขาวกึ่งโปร่งใส */
    color: #333; 
    width: 100%; 
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(5px); 
}

.overlay-box h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.overlay-box p {
    margin-bottom: 25px;
    font-weight: 500;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
footer {
    background-color: var(--dark-blue);
    color: white;
    padding: 60px 5% 40px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.footer-col h2, .footer-col h3 {
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.footer-col p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    opacity: 1;
    padding-left: 5px;
    color: var(--primary-blue);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    transition: 0.3s;
}

.social-icons a:hover {
    transform: translateY(-3px);
    color: var(--primary-blue);
}

/* Chat Apps */
.chat-apps {
    display: flex;
    gap: 15px;
    margin: 15px 0 25px;
}

.chat-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: 0.3s;
}

.chat-logo:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Shop Logos */
.shop-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.shop-logos img {
    width: 50px;
    height: 50px;
    background: white;
    padding: 10px;
    border-radius: 50%;
    object-fit: contain;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.shop-logos img:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* LINE SHOP Circle */
.line-shop-circle {
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.line-shop-circle img {
    width: 25px;
    height: auto;
    padding: 0;
    box-shadow: none;
}

.line-shop-circle img:hover {
     transform: none; 
}

.line-shop-circle:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.login-page {
    background-color: var(--light-gray); 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-header {
    background-color: var(--white);
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-box {
    background-color: var(--white);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.login-box h2 {
    color: var(--dark-blue);
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

/* Form Styles */
.login-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(44, 150, 244, 0.2);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    color: #555;
}

.forgot-password {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Divider (Or login with) */
.divider {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: #999;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Small Social Login Icons */
.social-login-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
    color: white;
}

.social-icon.google { background-color: #DB4437; }
.social-icon.facebook { background-color: #1877F2; }
.social-icon.instagram { 
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); 
}

/* Main Login Button */
.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-submit:hover {
    background-color: #1a7dc0;
}

.signup-link {
    margin-top: 25px;
    font-size: 0.95rem;
}

.signup-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: bold;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Modal (Popup) Styles สำหรับหน้า Sign Up
   ========================================================================== */
.modal-overlay {
    display: none; /* ซ่อนไว้เป็นค่าเริ่มต้น */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* พื้นหลังสีดำโปร่งใส */
    backdrop-filter: blur(4px); /* เบลอฉากหลังให้ Popup ลอยเด่น */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-box {
    background-color: var(--white);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    animation: modalFadeIn 0.3s ease; /* แอนิเมชันเด้งขึ้นมานุ่มๆ */
    /* ป้องกันไม่ให้กล่องล้นจอมือถือ */
    max-height: 90vh;
    overflow-y: auto; 
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--primary-blue);
    transform: scale(1.1);
}

.modal-box h2 {
    color: var(--dark-blue);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-box p {
    color: #666;
    margin-bottom: 25px;
}

/* ==========================================================================
   Success Popup Styles (หลังจากสมัครสมาชิกสำเร็จ)
   ========================================================================== */
.success-box {
    max-width: 400px !important;
    padding: 50px 40px !important;
}

.success-icon {
    font-size: 4rem;
    color: #2ecc71; /* สีเขียวสำหรับความสำเร็จ */
    margin-bottom: 20px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#successTitle {
    color: var(--dark-blue);
    margin-bottom: 10px;
}

#successMessage {
    color: #666;
    margin-bottom: 30px;
}
/* ==========================================================================
   Logout Modal Styles (ป๊อปอัพออกจากระบบ)
   ========================================================================== */
.logout-icon {
    font-size: 4rem;
    color: #e74c3c; /* สีแดงสื่อถึงการออกจากระบบ */
    margin-bottom: 20px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-cancel {
    flex: 1;
    padding: 10px 20px;
    border: 2px solid #ccc;
    background: transparent;
    color: #666;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-cancel:hover {
    background: #eee;
    color: #333;
}

.btn-danger {
    flex: 1;
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-danger:hover {
    background-color: #c0392b;
}
/* ==========================================================================
   User Profile & Logout Button
   ========================================================================== */
.btn-logout {
    padding: 6px 15px;
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #e74c3c;
    color: white;
}
/* ==========================================================================
   Password Rules (หลักเกณฑ์รหัสผ่าน)
   ========================================================================== */
.password-rules {
    list-style: none;
    margin-top: 8px;
    padding-left: 0;
    font-size: 0.8rem;
    color: #666;
}

.password-rules li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-rules i {
    color: var(--primary-blue);
    font-size: 0.9rem;
}
/* ตกแต่งหน้าต่าง OTP Modal */
#otpModal .modal-box {
    border-top: 5px solid #0056b3; /* เพิ่มแถบสีน้ำเงินด้านบนเพื่อให้ดูเป็นระบบความปลอดภัย */
    max-width: 400px;
}

/* ตกแต่งช่องกรอกรหัส 6 หลัก */
#otp_input {
    letter-spacing: 12px; /* แยกตัวเลขให้ห่างกันเพื่อให้มองง่าย */
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    color: #0056b3;
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

#otp_input:focus {
    border-color: #0056b3;
    box-shadow: 0 0 10px rgba(0, 86, 179, 0.2);
    outline: none;
}

/* ปรับแต่งปุ่ม Verify */
#btnVerifyOTP {
    width: 85%;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}
/* สไตล์เพิ่มเติมสำหรับ Error Modal */
#errorModal .modal-box {
    border-top: 5px solid #e74c3c;
    animation: modalBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalBounce {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#errorModal i {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}