﻿/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', Arial, sans-serif;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    padding: 10px;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-align: center;
    padding: 25px 20px;
    position: relative;
}

    .header::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: white;
        border-radius: 20px 20px 0 0;
    }

    .header h1 {
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 8px;
    }

    .header h2 {
        font-size: 16px;
        font-weight: normal;
        margin-bottom: 8px;
        opacity: 0.9;
    }

    .header p {
        font-size: 14px;
        opacity: 0.95;
    }

/* Cart Info in Header */
.cart-info {
    margin-top: 15px;
}

.cart-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
}

    .cart-link:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
    }

.cart-badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

/* Navigation Links */
.nav-links {
    margin-top: 15px;
}

/* Content */
.content {
    padding: 30px 20px 20px;
}

/* Search Section */
.search-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

    .search-section label {
        font-weight: bold;
        color: #333;
        margin-bottom: 8px;
        display: block;
    }

.search-input-container {
    display: flex;
    gap: 10px;
}

    .search-input-container input {
        flex: 1;
        padding: 10px 15px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-size: 14px;
        transition: border-color 0.3s ease;
    }

        .search-input-container input:focus {
            outline: none;
            border-color: #28a745;
        }

    .search-input-container button {
        padding: 10px 15px;
        background: #6c757d;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 12px;
        transition: background-color 0.3s ease;
    }

        .search-input-container button:hover {
            background: #545b62;
        }

/* Pagination Section */
.pagination-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.page-size-dropdown {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.items-info {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-btn, .page-number-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 40px;
    text-align: center;
}

    .pagination-btn:hover, .page-number-btn:hover {
        background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
        border-color: #adb5bd;
        transform: translateY(-1px);
    }

    .page-number-btn.active {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        border-color: #28a745;
        color: white;
    }

.pagination-summary {
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    font-weight: bold;
}

/* Product Section */
.product-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.section-subtitle {
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-item {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 16px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

    .product-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        border-color: #28a745;
    }

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .product-image:hover {
        border-color: #28a745;
    }

.no-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #6c757d;
    text-align: center;
    font-weight: bold;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name {
    font-weight: bold;
    color: #333;
    font-size: 15px;
    line-height: 1.3;
}

.product-price {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.product-weight {
    color: #666;
    font-size: 12px;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
}

.btn-add-cart {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 5px;
}

    .btn-add-cart:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

/* Cart Items */
.cart-section {
    margin-bottom: 25px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.no-image-small {
    width: 60px;
    height: 60px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #6c757d;
    text-align: center;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.cart-item-price {
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.cart-item-weight {
    color: #666;
    font-size: 12px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #28a745;
    background: white;
    color: #28a745;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

    .qty-btn:hover {
        background: #28a745;
        color: white;
    }

.qty-input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.cart-item-total {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

    .btn-remove:hover {
        background: #c82333;
    }

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

    .empty-cart h3 {
        color: #333;
        margin-bottom: 10px;
    }

    .empty-cart p {
        margin-bottom: 20px;
    }

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border: 2px solid #b8daff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.total-amount {
    border-top: 2px solid #28a745;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
}

.shipping-note {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    border-radius: 12px;
    padding: 12px;
    margin-top: 15px;
    font-size: 13px;
    text-align: center;
    color: #155724;
}

.weight-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: #856404;
    font-weight: bold;
}

.weight-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: #721c24;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Customer Info */
.customer-info {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: bold;
        color: #333;
        font-size: 14px;
    }

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

    .form-control:focus {
        outline: none;
        border-color: #28a745;
        box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    }

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-size: 16px;
    padding: 15px 25px;
}

    .btn-success:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

.btn-secondary {
    background: #6c757d;
    color: white;
}

    .btn-secondary:hover {
        background: #545b62;
    }

/* Payment Options */
.payment-section {
    margin-top: 10px;
}

.payment-options {
    display: flex;
    gap: 10px;
}

.payment-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

    .payment-option:hover, .payment-option.selected {
        border-color: #28a745;
        background: #f8fff9;
        color: #28a745;
    }

/* Order Summary Page */
.order-summary-section {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 30px;
    border-radius: 12px;
    border: 3px solid #28a745;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

    .order-summary-section h2 {
        color: #28a745;
        margin-bottom: 20px;
        font-size: 24px;
    }

    .order-summary-section p {
        font-size: 18px;
        margin-bottom: 20px;
    }

.bank-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #ffc107;
    margin: 20px 0;
    text-align: left;
}

    .bank-info h4 {
        color: #856404;
        margin-bottom: 15px;
        text-align: center;
    }

    .bank-info p {
        margin: 8px 0;
        font-size: 14px;
    }

.transfer-amount {
    font-size: 18px;
    color: #dc3545;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

.download-notice {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 2px solid #17a2b8;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
    color: #0c5460;
}

    .download-notice .icon {
        font-size: 24px;
        margin-bottom: 10px;
        display: block;
    }

.order-image-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #28a745;
}

    .order-image-section h5 {
        color: #28a745;
        margin-bottom: 15px;
        text-align: center;
    }

.image-container {
    text-align: center;
}

.order-image {
    max-width: 100%;
    height: auto;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-help {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.action-buttons {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.order-details-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
    border: 2px solid #dee2e6;
}

    .order-details-section h5 {
        color: #333;
        margin-bottom: 15px;
    }

.order-details {
    line-height: 1.6;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    cursor: pointer;
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.image-modal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

    .image-modal-close:hover {
        color: #ccc;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 5px;
    }

    .content {
        padding: 20px 15px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .pagination-info {
        flex-direction: column;
        text-align: center;
    }

    .pagination-controls {
        gap: 4px;
    }

    .pagination-btn, .page-number-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    .search-input-container {
        flex-direction: column;
    }

    .payment-options {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .cart-item {
        flex-direction: column;
        gap: 10px;
    }

    .cart-item-image, .no-image-small {
        align-self: center;
    }
}
