/* CSS Variables */
:root {
    /* Main Brand Colors */
    --main: #f0d58aec;
    --main-hover: #e0d49ee7;

    --main-button: #4f3716;
    --main-button-hover: #e0d49e;

    /* Background Colors */
    --bg-primary: #1a1813;
    --bg-secondary: #2a2520;
    --bg-card: #1d1a16;

    /* Border Colors */
    --border-color: #4a453d;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #a4a4a4;


}

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

/* Body Styles */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary), var(--font-fallback);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Font Classes */
.font_textx_font {
    font-family: var(--font-primary), var(--font-fallback);
    font-weight: 500;
}

/* Navigation Styles */
.navbar {
    background-color: var(--bg-secondary) !important;
    border-bottom: 2px solid var(--border-color);
}

.navbar-brand {
    color: var(--main) !important;
    font-weight: 500;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 400;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--main) !important;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Common Button Styles */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-action:hover {
    border-color: var(--main);
}

.btn-primary {
    background: var(--main-hover);
    color: var(--text-primary);
}


.btn-primary:hover {
    background: var(--main);
    color:  var(--text-primary);

}


.btn-buy {
    flex: 1;
    background: linear-gradient(to bottom, var(--main), var(--main-hover));
    color: var(--bg-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.925rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-buy:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-buy:disabled,
.btn-buy.disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

/* Product Card Styles */
.product-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    border-color: var(--main);
}

.product-card.out-of-stock {
    background: #252525 !important;
    border-color: #404040 !important;
}

.product-card.out-of-stock:hover {
    border-color: #404040 !important;
    transform: none !important;
}

.product-image {
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.product-card.out-of-stock .product-image img {
    filter: grayscale(100%) brightness(0.5) contrast(0.8);
    opacity: 0.6;
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.out-of-stock-badge {
    background: #dc2626;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: none;
    font-weight: 500;
}

.warranty-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.warranty-badge.out-of-stock {
    background: #3a3a3a;
    color: #888888;
    border: 1px solid #505050;
}

.product-info {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    color: var(--text-primary);
    font-size: 1.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-name.out-of-stock {
    color: #888888;
}

.product-pricing {
    text-align: center;
}

.price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.product-price.out-of-stock {
    color: #888888;
}

.discount-badge {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

.discount-badge.out-of-stock {
    background: #3a3a3a;
    color: #888888;
    border: 1px solid #505050;
}

.section-title {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 500;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.section-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: var(--text-primary);
}

/* Back to Top Button */
.back-to-top {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0 2rem;
}

.btn-back-top {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-back-top:hover {
    border-color: var(--main);
}

/* Thai text optimizations */
.section-title,
.product-name {
    font-family: var(--font-primary), var(--font-fallback);
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
}

.section-subtitle {
    font-family: var(--font-primary), var(--font-fallback);
    font-weight: 400;
}

.product-price {
    font-family: var(--font-primary), var(--font-fallback);
    font-weight: 500;
}

.thai-text {
    line-height: 1.6;
    word-break: break-word;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Hide scrollbar for all browsers - Comprehensive approach */
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
    display: none !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: transparent !important;
    display: none !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: transparent !important;
    display: none !important;
}

html {
    overflow: -moz-scrollbars-none;
}

html::-webkit-scrollbar-track-piece,
body::-webkit-scrollbar-track-piece,
*::-webkit-scrollbar-track-piece {
    display: none !important;
}
