/* Root variables */
:root {
    --price-color: #ff6b00;
    --bg-light: #f5f5f5;
}

/* Global styles */
body {
    font-family: 'Mitr', sans-serif;
}

/* Navbar styles */
.custom-navbar {
    height: 70px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 0;
}

.custom-navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
}

/* Search box styles */
.search-box-wrapper {
    width: 60%;
    margin: 0 auto;
}

.search-form .input-group {
    width: 100%;
    height: 40px;
}

.search-input {
    height: 100%;
    border-radius: 2px 0 0 2px;
    border: 2px solid var(--price-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.search-input:focus {
    box-shadow: none;
    border-color: var(--price-color);
}

.btn-search {
    width: 60px;
    border-radius: 0 2px 2px 0;
    background-color: var(--price-color);
    color: white;
    border: 2px solid var(--price-color);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    opacity: 0.95;
    color: white;
    background-color: var(--price-color);
}

/* Cart styles */
.cart-wrapper {
    margin-left: 1rem;
}

.cart-link {
    position: relative;
    color: #333;
    font-size: 1.2rem;
    text-decoration: none;
}

.cart-link i {
    color: var(--price-color);
    font-size: 1.4rem;
}

.cart-count {
    background: #333;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Banner section */
.banner-section {
    padding-top: 0.5rem;
    background-color: #ffffff;
}

/* แก้ไขส่วน carousel */
.carousel {
    border-radius: 10px;
    overflow: hidden;
    /* สำคัญ: ต้องเพิ่ม overflow: hidden ที่ parent */
}

.carousel-item {
    height: 450px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Category section */
.category-section {
    background-color: #ffffff;
    padding: 2rem 0;
}

.category-heading {
    font-weight: 500;
    font-size: 1.25rem;
    color: #333;
    margin: 0;
    position: relative;
    padding-bottom: 8px;
}

.category-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--price-color);
    border-radius: 2px;
}

/* Category items */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    transition: transform 0.2s ease;
}

.category-name {
    font-weight: 300;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
    padding: 8px 0;
}

.category-link {
    text-decoration: none;
}

.category-link:hover .category-name {
    color: var(--price-color);
}

.category-link:hover .category-image {
    transform: rotate(-10deg);
    animation: shake 0.5s ease;
}

/* Navigation buttons */
.navigation-buttons {
    display: flex;
    gap: 10px;
}

.navigation-buttons .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--price-color);
    border: none;
    border-radius: 4px;
    color: #fff;
}

.navigation-buttons .btn:hover {
    opacity: 0.9;
}

/* Product section */
.product-section {
    background-color: var(--bg-light);
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #ffffff;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.product-info {
    padding: 12px 3px;
}

.product-name {
    font-size: 1rem;
    font-weight: 300;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 8px 0;
    padding: 0 3px;
}

.product-price {
    color: var(--price-color);
    padding: 0 3px;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--price-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 300;
}

/* Animation */
@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }

    75% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .custom-navbar {
        height: auto;
        padding: 10px 0;
    }

    .search-box-wrapper {
        width: calc(100% - 80px);
        margin: 0;
    }

    .product-name,
    .product-price {
        font-size: 0.9rem;
    }
}

/* Pagination styles */
.pagination {
    gap: 5px;
    /* ระยะห่างระหว่างปุ่ม */
}

.page-link {
    border: none;
    color: #555;
    padding: 8px 16px;
    border-radius: 4px !important;
    /* ทำให้เป็นสี่เหลี่ยมมุมมน */
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--price-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--price-color);
    border-color: var(--price-color);
}

/* สำหรับปุ่ม Previous/Next */
.page-item:first-child .page-link,
.page-item:last-child .page-link {
    padding: 8px 12px;
}

/* Footer styles */
.footer {
    background-color: #ffffff;
    border-top: 3px solid var(--price-color);
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--price-color);
}

.footer-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.footer-contact li i {
    color: var(--price-color);
    margin-right: 10px;
    width: 16px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 36px;
    height: 36px;
    background-color: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    background-color: var(--price-color);
    color: white;
}

.footer-copyright {
    background-color: #f8f8f8;
    padding: 1rem 0;
    font-size: 0.85rem;
    color: #666;
}

/* Responsive */
@media (max-width: 767.98px) {
    .footer-heading {
        margin-top: 1rem;
    }

    .footer-social {
        justify-content: center;
    }
}

/* Footer logo */
.footer-logo {
    display: block;
    margin-bottom: 1.5rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
}

@media (max-width: 767.98px) {
    .footer-logo {
        text-align: center;
    }
}

/* Product Detail Styles */
.product-gallery {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-image {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.main-image img {
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    border: 2px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.thumb-item:hover {
    border-color: var(--price-color);
}

.thumb-item.active {
    border-color: var(--price-color);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
}

.product-price-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 1.1rem;
}

.final-price {
    color: var(--price-color);
    font-size: 1.8rem;
    font-weight: 500;
}

.description-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.product-description {
    color: #666;
    line-height: 1.6;
}

.btn-add-cart {
    background-color: var(--price-color);
    color: white;
    padding: 12px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-add-cart:hover {
    background-color: var(--price-color);
    filter: brightness(110%);
    /* ทำให้สีสว่างขึ้น 10% */
    color: white;
}

/* Quantity Selector */
.quantity-selector .form-control {
    text-align: center;
    border: 1px solid #ddd;
}

.quantity-selector .btn {
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
}

.quantity-selector .btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Responsive */
@media (max-width: 767.98px) {
    .main-image {
        height: 300px;
    }
}

/* Color Selection */
.product-colors .form-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-box:hover {
    border-color: var(--price-color);
}

.color-box.active {
    border-color: var(--price-color);
    background-color: #fff5ef;
}

.color-sample {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.color-name {
    font-size: 0.9rem;
    color: #333;
}

.discount-badge {
    background: var(--price-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Product Gallery Styles */
.product-gallery {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mainSwiper {
    width: 100%;
    height: 400px;
    margin-bottom: 15px;
}

.mainSwiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.mainSwiper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbSwiper {
    width: 100%;
    height: 100px;
    padding: 0 30px;
    /* ให้พื้นที่สำหรับปุ่ม next/prev */
}

.thumbSwiper .swiper-slide {
    width: 80px !important;
    /* กำหนดความกว้างของ thumbnail */
    height: 80px;
    opacity: 0.5;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.thumbSwiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbSwiper .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--price-color);
}

/* Swiper Navigation Buttons */
.thumbSwiper .swiper-button-next,
.thumbSwiper .swiper-button-prev {
    color: #666;
    width: 20px;
    height: 20px;
}

.thumbSwiper .swiper-button-next:after,
.thumbSwiper .swiper-button-prev:after {
    font-size: 16px;
}

.thumbSwiper .swiper-button-disabled {
    opacity: 0.3;
}

/* Product Description Section */
.description-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.description-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 500;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sub-title {
    color: #444;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #666;
}

.feature-list li:before {
    content: '•';
    color: var(--price-color);
    font-size: 1.2rem;
    position: absolute;
    left: 8px;
    top: -2px;
}

/* Spec Table */
.spec-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.spec-table tr {
    background: #f8f8f8;
}

.spec-table td {
    padding: 12px 15px;
    color: #666;
}

.spec-label {
    width: 120px;
    color: #444 !important;
    font-weight: 500;
}

/* Usage Text */
.usage-text {
    color: #666;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 767.98px) {
    .description-card {
        padding: 20px;
    }

    .spec-table td {
        padding: 10px;
    }

    .spec-label {
        width: 100px;
    }
}

.cart-link:hover {
    color: var(--price-color);
    text-decoration: none;
}

/* Cart Section Styles */
.cart-items-card,
.cart-summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-title,
.summary-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    border-bottom: 2px solid var(--price-color);
    padding-bottom: 0.5rem;
}

/* Cart Item */
.cart-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-title {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #333;
}

.item-color {
    font-size: 0.9rem;
    color: #666;
}

.item-price {
    font-weight: 500;
    color: var(--price-color);
    font-size: 1.1rem;
}

.btn-remove {
    color: #dc3545;
    padding: 4px 8px;
}

.btn-remove:hover {
    color: #bd2130;
}

/* Cart Summary */
.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #666;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-weight: 500;
    font-size: 1.1rem;
    color: #333;
}

.btn-checkout {
    background-color: var(--price-color);
    color: white;
    padding: 12px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-checkout:hover {
    background-color: #ff8533;
    color: white;
}

/* Responsive */
@media (max-width: 767.98px) {
    .cart-item {
        padding: 10px 0;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-price {
        font-size: 1rem;
    }

    .quantity-selector .input-group {
        width: 100px;
    }
}

.item-quantity {
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 767.98px) {
    .item-quantity {
        font-size: 0.85rem;
    }
}

/* Checkout Section Styles */
.checkout-card,
.checkout-summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkout-title,
.summary-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: #333;
}

.form-control,
.form-select {
    border-color: #ddd;
    padding: 0.6rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--price-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 0, 0.15);
}

.form-text {
    font-size: 0.85rem;
}

/* Summary Items */
.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.item-quantity {
    min-width: 30px;
}

.item-name {
    flex-grow: 1;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-weight: 500;
    font-size: 1.1rem;
    color: #333;
}

/* Responsive */
@media (max-width: 767.98px) {

    .checkout-card,
    .checkout-summary-card {
        padding: 15px;
    }
}

/* User Menu */
.user-link {
    color: #333;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.user-link:hover {
    color: var(--price-color);
}

.dropdown-menu {
    margin-top: 10px;
    border: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
}

.dropdown-item {
    padding: 8px 20px;
    color: #333;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.text-danger:hover {
    background-color: #fff5f5;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Profile Section Styles */
.profile-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* Address Info */
.address-info {
    color: #666;
    line-height: 1.5;
}

/* Order Table */
.order-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #333;
}

.order-table td {
    vertical-align: middle;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-primary {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-warning {
    background-color: #fff3e0;
    color: #f57c00;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 8px;
}

.modal-header {
    border-bottom-color: #eee;
}

.modal-footer {
    border-top-color: #eee;
}

/* Responsive */
@media (max-width: 767.98px) {
    .profile-card {
        padding: 15px;
    }

    .order-table {
        font-size: 0.9rem;
    }
}

/* Order Cards for Mobile */
.order-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.order-card:last-child {
    margin-bottom: 0;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.order-id {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.order-date {
    font-size: 0.9rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.total-amount {
    font-weight: 500;
    color: var(--price-color);
    font-size: 1.1rem;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-primary {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-warning {
    background-color: #fff3e0;
    color: #f57c00;
}

/* ถ้าต้องการรวมสไตล์ทั้งสองเข้าด้วยกัน สามารถใช้ */
.cart-section,
.profile-section {
    min-height: calc(100vh - 140px);
    padding-bottom: 2rem;
}