/* ===========================================
   Cytron Pre-Order Shop - Styles
   Theme: Cytron Turquoise/Teal/Yellow
   =========================================== */

/* CSS Variables */
:root {
    --cytron-primary: #00B4AB;
    --cytron-primary-dark: #008B7F;
    --cytron-accent: #FFD600;
    --cytron-accent-dark: #E6C200;
    --cytron-white: #FFFFFF;
    --cytron-light-gray: #F5F5F5;
    --cytron-gray: #E0E0E0;
    --cytron-text: #333333;
    --cytron-text-light: #666666;
    --cytron-shadow: 0 4px 15px rgba(0, 180, 171, 0.15);
    --cytron-shadow-hover: 0 8px 25px rgba(0, 180, 171, 0.25);
}

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

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

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

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

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

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

.cytron-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(--cytron-accent);
    color: var(--cytron-primary-dark);
    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(--cytron-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
}

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

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

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

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

/* Category Tabs */
.category-tabs {
    background: var(--cytron-white);
    padding: 20px 0;
    border-bottom: 2px solid var(--cytron-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(--cytron-primary);
    background: var(--cytron-white);
    color: var(--cytron-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(--cytron-primary);
    color: var(--cytron-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(280px, 1fr));
    gap: 30px;
}

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

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

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

.product-info {
    padding: 20px;
}

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

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

.product-code {
    font-size: 0.85rem;
    color: var(--cytron-text-light);
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cytron-primary-dark);
    margin-bottom: 15px;
}

.btn-add-cart {
    width: 100%;
    padding: 14px;
    background: var(--cytron-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-detail {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    color: var(--cytron-primary);
    border: 2px solid var(--cytron-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.btn-detail:hover {
    background: var(--cytron-primary);
    color: white;
}

.btn-add-cart:hover {
    background: var(--cytron-primary-dark);
}

.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(--cytron-white);
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    background: var(--cytron-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(--cytron-gray);
}

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

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

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

.cart-item-price {
    color: var(--cytron-primary-dark);
    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(--cytron-gray);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
}

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

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

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

.cart-footer {
    padding: 20px;
    border-top: 2px solid var(--cytron-gray);
    background: var(--cytron-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(--cytron-primary-dark);
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--cytron-accent);
    color: var(--cytron-primary-dark);
    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(--cytron-accent-dark);
}

.btn-checkout:disabled {
    background: var(--cytron-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(--cytron-white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--cytron-shadow);
}

.checkout-form h3 {
    color: var(--cytron-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(--cytron-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--cytron-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(--cytron-primary);
}

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

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

.order-summary h3 {
    color: var(--cytron-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(--cytron-gray);
}

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

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

.order-item-price {
    font-weight: 600;
    color: var(--cytron-primary-dark);
}

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

.order-total span:last-child {
    color: var(--cytron-primary-dark);
}

.btn-submit-order {
    width: 100%;
    padding: 18px;
    background: var(--cytron-accent);
    color: var(--cytron-primary-dark);
    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(--cytron-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
}

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

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

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

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

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

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

.btn-continue:hover {
    background: var(--cytron-primary-dark);
}

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

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

.cytron-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;
}

/* Bundle Options Modal */
.bundle-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 4000;
    backdrop-filter: blur(4px);
}

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

.bundle-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--cytron-white);
    border-radius: 20px;
    width: 680px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 4001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
}

.bundle-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.bundle-modal-header {
    background: linear-gradient(135deg, var(--cytron-primary) 0%, var(--cytron-primary-dark) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.bundle-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.bundle-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.bundle-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.bundle-options {
    padding: 25px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.bundle-option {
    flex: 1;
    min-width: 260px;
    max-width: 300px;
    border: 2px solid var(--cytron-gray);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.bundle-option:hover {
    border-color: var(--cytron-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 180, 171, 0.2);
}

.bundle-image-wrapper {
    position: relative;
    background: var(--cytron-light-gray);
}

.bundle-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 15px;
    display: block;
}

.bundle-image-label {
    background: #555;
    color: white;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.bundle-info {
    padding: 15px 18px 20px;
    text-align: center;
}

.bundle-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cytron-text);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.bundle-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cytron-primary-dark);
    margin: 0;
}

/* Bundle Grid (many options) */
.bundle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.bundle-grid .bundle-option {
    min-width: unset;
    max-width: unset;
    flex: unset;
}

.bundle-grid .bundle-image {
    height: 150px;
}

.bundle-grid .bundle-image-label {
    font-size: 0.75rem;
    padding: 8px 10px;
}

.bundle-grid .bundle-name {
    font-size: 0.82rem;
}

.bundle-grid .bundle-price {
    font-size: 0.9rem;
}

/* Wide modal for grids */
.bundle-modal:has(.bundle-grid) {
    width: 950px;
}

/* Extra image thumbnails */
.bundle-extra-images {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bundle-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--cytron-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bundle-thumb:hover {
    border-color: var(--cytron-primary);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 180, 171, 0.3);
}

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 5001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

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

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

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

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

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

    .bundle-modal {
        width: 95vw;
    }

    .bundle-modal:has(.bundle-grid) {
        width: 95vw;
    }

    .bundle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .bundle-options {
        flex-direction: column;
        align-items: center;
    }

    .bundle-option {
        min-width: unset;
        max-width: 100%;
        width: 100%;
    }

    .bundle-image {
        height: 160px;
    }

    .bundle-grid .bundle-image {
        height: 120px;
    }
}