/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    color: var(--text-dark);
    background-color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly buttons */
a, button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Top Bar */
.top-bar {
    background-color: var(--bg-light);
    padding: 8px 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.top-bar a {
    color: var(--text-dark);
    transition: color 0.3s;
}

.top-bar a:hover {
    color: var(--secondary-color);
}

/* Logo */
.site-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.logo-circle-footer {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #ffffff;
    background-image: url('../../logo-spl.png');
    background-size: 75%;
    background-repeat: no-repeat;
    background-position: center;
    border: 2px solid var(--border-color);
}

/* Navigation */
.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color) !important;
}

.btn-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.25rem;
}

.btn-link:hover {
    color: var(--secondary-color);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    color: white;
    height: 400px;
    margin-bottom: 3rem;
}

.hero-video {
    position: absolute;
    top: -30%;
    left: 50%;
    min-width: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%);
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 79, 175, 0.75);
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.8);
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.8);
}

.btn-hero {
    padding: 12px 32px;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
}

/* Category Cards */
.category-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-sm);
    background: white;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.category-card img {
    height: 180px;
    object-fit: cover;
}

.category-card .no-picture-category {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px dashed #dee2e6;
}

.category-card-body {
    padding: 1.5rem;
    text-align: center;
}

.category-card h5 {
    font-weight: 600;
    color: var(--primary-color);
}

/* Product Card */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
}

.product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.no-picture {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px dashed #dee2e6;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-badge.bestseller {
    background: #f39c12;
}

.product-body {
    padding: 1.25rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.product-old-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-rating {
    color: #f39c12;
    font-size: 0.9rem;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-add-cart:hover {
    background: #2980b9;
}

/* Section Title */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* Product Detail */
.product-detail-wrap {
    align-items: flex-start;
}

.detail-main-image-wrap {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.detail-main-image {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
}

.detail-no-image {
    width: 100%;
    height: 520px;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-thumb-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.detail-thumb-btn {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.detail-thumb-btn img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.detail-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.detail-price {
    font-size: 2rem;
    line-height: 1;
    color: var(--accent-color);
    font-weight: 700;
}

.detail-old-price {
    color: var(--text-light);
    text-decoration: line-through;
}

.detail-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.detail-spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.detail-spec-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.detail-spec-list li:last-child {
    border-bottom: 0;
}

/* Footer */
.footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.footer h5,
.footer h6 {
    color: var(--primary-color);
}

.social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    /* Top Bar - Hide on mobile */
    .top-bar {
        font-size: 0.75rem;
        padding: 6px 0;
    }
    
    .top-bar .col-md-6:last-child {
        display: none;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .site-logo {
        width: 48px;
        height: 48px;
    }
    
    .btn-link {
        font-size: 1.1rem;
    }
    
    /* Hero Section */
    .hero-section {
        height: 320px;
    }
    
    .hero-video {
        top: -20%;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-section p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        padding: 0 15px;
    }
    
    .btn-hero {
        padding: 10px 24px;
        font-size: 1rem;
    }
    
    /* Category Cards */
    .category-card img {
        height: 120px;
    }
    
    .category-card-body {
        padding: 1rem;
    }
    
    .category-card h5 {
        font-size: 0.95rem;
    }
    
    .category-card-body i {
        font-size: 1.5rem !important;
    }
    
    /* Product Cards */
    .product-image img {
        height: 180px;
    }

    .detail-main-image,
    .detail-no-image {
        height: 420px;
    }
    
    .product-body {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .product-old-price {
        font-size: 0.85rem;
    }
    
    .btn-add-cart {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    /* Section Title */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Footer */
    .footer {
        font-size: 0.9rem;
    }
    
    .footer .col-md-4,
    .footer .col-md-2,
    .footer .col-md-3 {
        margin-bottom: 2rem;
    }
}

/* Extra Small Devices */
@media (max-width: 576px) {
    .hero-section {
        height: 280px;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.85rem;
    }
    
    .btn-hero {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    .detail-main-image,
    .detail-no-image {
        height: 320px;
    }

    .detail-thumb-btn img {
        height: 72px;
    }
    
    /* Product Cards - 2 columns on very small screens */
    .product-image img {
        height: 150px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
}

/* Large Tablets */
@media (min-width: 769px) and (max-width: 991px) {
    .hero-section {
        height: 380px;
    }
    
    .hero-section h1 {
        font-size: 2.3rem;
    }
    
    .product-image img {
        height: 220px;
    }
}
