/*
Theme Name: Hala Gaming Pro
Theme URI: https://hala.com.tw
Description: 專為哈啦電腦設計的專業電競風格 WordPress 主題，完全支援 WooCommerce 和 Elementor。具有現代化設計、響應式布局和完整的購物功能。
Author: Manus AI
Author URI: https://manus.im
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hala-gaming-pro
Domain Path: /languages
Tags: e-commerce, gaming, dark, modern, responsive, woocommerce, elementor

Hala Gaming Pro WordPress Theme, Copyright 2024 Manus AI
Hala Gaming Pro is distributed under the terms of the GNU GPL

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

/* 基礎重置和變數 */
:root {
    --hala-primary-bg: #000000;
    --hala-secondary-bg: #111111;
    --hala-accent-cyan: #06b6d4;
    --hala-accent-purple: #8b5cf6;
    --hala-accent-pink: #ec4899;
    --hala-text-primary: #ffffff;
    --hala-text-secondary: #cccccc;
    --hala-text-muted: #888888;
    --hala-border-color: rgba(139, 92, 246, 0.2);
    --hala-gradient-primary: linear-gradient(45deg, #06b6d4, #8b5cf6);
    --hala-shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    --hala-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基礎樣式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--hala-primary-bg);
    color: var(--hala-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    padding-top: 80px; /* 為固定頁首留空間 */
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 基本排版 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--hala-accent-cyan);
    text-decoration: none;
    transition: var(--hala-transition-smooth);
}

a:hover {
    color: var(--hala-accent-purple);
}

/* 按鈕樣式 */
.button,
button,
input[type="submit"],
input[type="button"] {
    background: var(--hala-gradient-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--hala-transition-smooth);
    text-decoration: none;
    display: inline-block;
    font-family: 'Rajdhani', sans-serif;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: linear-gradient(45deg, #0891b2, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    color: white;
    text-decoration: none;
}

/* 表單樣式 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--hala-border-color);
    border-radius: 6px;
    color: var(--hala-text-primary);
    padding: 0.75rem;
    width: 100%;
    transition: var(--hala-transition-smooth);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--hala-accent-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* 輔助功能 */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* 載入動畫 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 清除浮動 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* WooCommerce 商品列表修正 */

/* 基本 Grid 佈局：手機 2 欄 */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px; /* 商品之間的間距 */
}

/* 商品卡片內文撐滿 */
.woocommerce ul.products li.product,
.woocommerce ul.products li.product .product-card {
    width: 100% !important;
    max-width: 100% !important;
}
/* 手機版：兩欄 */
@media (max-width: 768px) {
    .woocommerce ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* 手機版兩欄 */
        gap: 20px !important; /* 商品之間的間距 */
        width: 100% !important;  /* 確保 ul 寬度為 100% */
    }

    /* 強制設定每個商品的寬度 */
    .woocommerce ul.products li.product {
        width: 100% !important;
        padding: 0 !important; /* 去除多餘的間距 */
        margin: 0 !important; /* 防止額外的邊距造成錯位 */
    }
}

/* 平板版：三欄 */
@media (min-width: 768px) and (max-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important; /* 平板版三欄 */
    }
}

/* 桌機版：四欄 */
@media (min-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important; /* 電腦版四欄 */
    }
}

/* 確保商品卡片占滿每個區塊 */
.woocommerce-page .products .product {
    display: block !important;  /* 防止產品卡片改成行內塊元素 */
    width: 100% !important; /* 確保每個商品占據完整寬度 */
    margin: 0 !important; /* 防止額外的邊距造成錯位 */
    padding: 0 !important; /* 去除內邊距 */
}

/* 修正商品卡片內容顯示 */
.woocommerce-page .products .product .product-card {
    display: flex;
    flex-direction: column; /* 強制排列 */
    align-items: stretch; /* 確保卡片充滿父容器 */
    justify-content: space-between;
}
