/* ===========================================
   Education Automation System Pre-Order Shop - Styles
   Theme: EAT Blue/Green
   =========================================== */

/* CSS Variables */
:root {
    --eat-primary: #1e3a5f;
    --eat-primary-dark: #1a365d;
    --eat-secondary: #2c5282;
    --eat-accent: #48bb78;
    --eat-accent-dark: #38a169;
    --eat-white: #FFFFFF;
    --eat-light-gray: #F5F5F5;
    --eat-gray: #E0E0E0;
    --eat-text: #333333;
    --eat-text-light: #666666;
    --eat-shadow: 0 4px 15px rgba(30, 58, 95, 0.15);
    --eat-shadow-hover: 0 8px 25px rgba(30, 58, 95, 0.25);
}

/* Shop Page Layout */
.eat-shop-page {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--eat-light-gray);
    min-height: 100vh;
}

/* Header */
.eat-header {
    background: var(--eat-primary);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.eat-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eat-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.eat-logo img {
    height: 45px;
    width: auto;
}

.eat-logo h1 {
    color: var(--eat-white);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.eat-logo span {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

/* Cart Button */
.cart-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--eat-accent);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cart-button:hover {
    background: var(--eat-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.cart-count {
    background: var(--eat-white);
    color: var(--eat-accent);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Hero Banner */
.eat-hero {
    background: linear-gradient(135deg, var(--eat-primary) 0%, var(--eat-secondary) 100%);
    padding: 60px 0;
    text-align: center;
    color: white;
}

.eat-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.eat-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Category Tabs */
.category-tabs {
    background: var(--eat-white);
    padding: 20px 0;
    border-bottom: 2px solid var(--eat-gray);
}

.category-tabs .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    padding: 12px 28px;
    border: 2px solid var(--eat-primary);
    background: var(--eat-white);
    color: var(--eat-primary);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab:hover,
.category-tab.active {
    background: var(--eat-primary);
    color: var(--eat-white);
}

/* Products Grid */
.products-section {
    padding: 50px 0;
}

.products-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Product Card */
.product-card {
    background: var(--eat-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--eat-shadow);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--eat-shadow-hover);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: var(--eat-light-gray);
    padding: 20px;
}

.product-info {
    padding: 20px;
}

.product-category {
    display: inline-block;
    background: var(--eat-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--eat-text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--eat-text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--eat-accent);
    margin-bottom: 15px;
}

.btn-add-cart {
    width: 100%;
    padding: 14px;
    background: var(--eat-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover {
    background: var(--eat-secondary);
}

.btn-add-cart.added {
    background: #28a745;
}

/* Cart Sidebar */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: var(--eat-white);
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    background: var(--eat-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--eat-gray);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: var(--eat-light-gray);
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--eat-accent);
    font-weight: 600;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--eat-gray);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
}

.qty-btn:hover {
    background: var(--eat-light-gray);
}

.cart-item-remove {
    color: #E60012;
    cursor: pointer;
    font-size: 0.85rem;
}

.cart-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--eat-text-light);
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid var(--eat-gray);
    background: var(--eat-light-gray);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-total span:last-child {
    color: var(--eat-accent);
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--eat-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-checkout:hover {
    background: var(--eat-accent-dark);
}

.btn-checkout:disabled {
    background: var(--eat-gray);
    cursor: not-allowed;
}

/* Checkout Page */
.checkout-section {
    padding: 50px 0;
}

.checkout-section .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.checkout-form {
    background: var(--eat-white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--eat-shadow);
}

.checkout-form h3 {
    color: var(--eat-primary);
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--eat-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--eat-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--eat-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.order-summary {
    background: var(--eat-white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--eat-shadow);
}

.order-summary h3 {
    color: var(--eat-primary);
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.order-items {
    max-height: 300px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--eat-gray);
}

.order-item-name {
    font-weight: 500;
}

.order-item-qty {
    color: var(--eat-text-light);
    font-size: 0.9rem;
}

.order-item-price {
    font-weight: 600;
    color: var(--eat-accent);
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    font-size: 1.4rem;
    font-weight: 700;
    border-top: 2px solid var(--eat-primary);
    margin-top: 20px;
}

.order-total span:last-child {
    color: var(--eat-accent);
}

.btn-submit-order {
    width: 100%;
    padding: 18px;
    background: var(--eat-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-submit-order:hover {
    background: var(--eat-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-submit-order:disabled {
    background: var(--eat-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success Message */
.order-success {
    text-align: center;
    padding: 60px 20px;
    background: var(--eat-white);
    border-radius: 16px;
    box-shadow: var(--eat-shadow);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.order-success h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.order-success p {
    color: var(--eat-text-light);
    margin-bottom: 30px;
}

.btn-continue {
    display: inline-block;
    padding: 14px 40px;
    background: var(--eat-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-continue:hover {
    background: var(--eat-secondary);
}

/* Footer */
.eat-footer {
    background: var(--eat-primary-dark);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.eat-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.eat-footer a:hover {
    color: white;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #E60012;
}

/* Responsive */
@media (max-width: 768px) {
    .eat-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .eat-hero h2 {
        font-size: 1.8rem;
    }
}