/**
 * LY Shop 前端樣式
 */

/* 變量 */
:root {
    --ly-shop-primary: #ff6b9d;
    --ly-shop-secondary: #00d4ff;
    --ly-shop-dark: #1a1a2e;
    --ly-shop-dark-light: #252542;
    --ly-shop-text: #ffffff;
    --ly-shop-text-muted: #a0a0b0;
    --ly-shop-border: rgba(255, 255, 255, 0.1);
    --ly-shop-success: #28a745;
    --ly-shop-danger: #dc3545;
    --ly-shop-radius: 10px;
}

/* 通用樣式 */
.ly-shop-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ly-shop-primary), #ff8fab);
    color: #fff;
    border: none;
    border-radius: var(--ly-shop-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ly-shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
    color: #fff;
}

/* 商品列表 */
.ly-shop-products {
    display: grid;
    gap: 20px;
}

.ly-shop-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ly-shop-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ly-shop-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* 商品卡片 */
.ly-shop-product {
    background: var(--ly-shop-dark-light);
    border-radius: var(--ly-shop-radius);
    overflow: hidden;
    border: 1px solid var(--ly-shop-border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.ly-shop-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ly-shop-product-inner {
    position: relative;
}

.ly-shop-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--ly-shop-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.ly-shop-product-image {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.ly-shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ly-shop-product:hover .ly-shop-product-image img {
    transform: scale(1.05);
}

.ly-shop-product-info {
    padding: 15px;
}

.ly-shop-product-title {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.4;
}

.ly-shop-product-title a {
    color: var(--ly-shop-text);
    text-decoration: none;
}

.ly-shop-product-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--ly-shop-primary);
    margin-bottom: 12px;
}

.ly-shop-product-price del {
    color: var(--ly-shop-text-muted);
    font-size: 13px;
    margin-right: 8px;
}

.ly-shop-product-price ins {
    text-decoration: none;
}

.ly-shop-product .ly-shop-btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

.ly-shop-out-of-stock {
    display: block;
    padding: 10px;
    text-align: center;
    background: var(--ly-shop-dark);
    color: var(--ly-shop-text-muted);
    border-radius: var(--ly-shop-radius);
    font-size: 13px;
}

/* 購物車 */
.ly-shop-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--ly-shop-dark-light);
    border-radius: var(--ly-shop-radius);
}

.ly-shop-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.ly-shop-cart-table th,
.ly-shop-cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-cart-table th {
    background: var(--ly-shop-dark-light);
    font-weight: 600;
}

.ly-shop-cart-table .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.ly-shop-cart-table .product-name a {
    color: var(--ly-shop-text);
    text-decoration: none;
}

.ly-shop-cart-table .product-subtotal {
    font-weight: 600;
    color: var(--ly-shop-primary);
}

/* 數量選擇器 */
.ly-shop-quantity {
    display: inline-flex;
    align-items: center;
    background: var(--ly-shop-dark);
    border-radius: 8px;
    overflow: hidden;
}

.ly-shop-quantity button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ly-shop-text);
    font-size: 18px;
    cursor: pointer;
}

.ly-shop-quantity button:hover {
    background: var(--ly-shop-border);
}

.ly-shop-qty-input {
    width: 50px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ly-shop-text);
    text-align: center;
    font-size: 14px;
    appearance: textfield;
    -moz-appearance: textfield;
}

.ly-shop-qty-input::-webkit-outer-spin-button,
.ly-shop-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.ly-shop-remove-item {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--ly-shop-danger);
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ly-shop-remove-item:hover {
    opacity: 0.8;
}

/* 購物車總計 */
.ly-shop-cart-totals {
    max-width: 400px;
    margin-left: auto;
    background: var(--ly-shop-dark-light);
    padding: 25px;
    border-radius: var(--ly-shop-radius);
}

.ly-shop-cart-totals h3 {
    margin: 0 0 20px;
    font-size: 18px;
}

.ly-shop-cart-totals table {
    width: 100%;
    margin-bottom: 20px;
}

.ly-shop-cart-totals th,
.ly-shop-cart-totals td {
    padding: 10px 0;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-cart-totals th {
    text-align: left;
    font-weight: 400;
    color: var(--ly-shop-text-muted);
}

.ly-shop-cart-totals td {
    text-align: right;
}

.ly-shop-cart-totals .order-total td {
    font-size: 20px;
    color: var(--ly-shop-primary);
}

.ly-shop-btn-checkout {
    width: 100%;
    text-align: center;
}

/* 結帳頁 */
.ly-shop-checkout-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.ly-shop-checkout h3 {
    margin: 0 0 25px;
    font-size: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-form-row {
    margin-bottom: 20px;
}

.ly-shop-form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--ly-shop-text-muted);
}

.ly-shop-form-row .required {
    color: var(--ly-shop-primary);
}

.ly-shop-form-row input,
.ly-shop-form-row select,
.ly-shop-form-row textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--ly-shop-dark-light);
    border: 1px solid var(--ly-shop-border);
    border-radius: 8px;
    color: var(--ly-shop-text);
    font-size: 14px;
    transition: border-color 0.2s;
}

.ly-shop-form-row input:focus,
.ly-shop-form-row select:focus,
.ly-shop-form-row textarea:focus {
    outline: none;
    border-color: var(--ly-shop-secondary);
}

.ly-shop-form-row textarea {
    min-height: 100px;
    resize: vertical;
}

/* 訂單摘要 */
.ly-shop-checkout-order {
    background: var(--ly-shop-dark-light);
    padding: 25px;
    border-radius: var(--ly-shop-radius);
    position: sticky;
    top: 20px;
}

.ly-shop-order-table {
    width: 100%;
    margin-bottom: 20px;
}

.ly-shop-order-table th,
.ly-shop-order-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-order-table thead th {
    font-weight: 600;
    text-align: left;
}

.ly-shop-order-table tbody td .quantity {
    color: var(--ly-shop-text-muted);
    margin-left: 5px;
}

.ly-shop-order-table tfoot th {
    text-align: left;
    font-weight: 400;
    color: var(--ly-shop-text-muted);
}

.ly-shop-order-table tfoot td {
    text-align: right;
}

.ly-shop-order-table .order-total td {
    font-size: 18px;
    color: var(--ly-shop-primary);
}

/* 付款方式 */
.ly-shop-payment-methods {
    margin: 25px 0;
}

.ly-shop-payment-methods h4 {
    margin: 0 0 15px;
    font-size: 16px;
}

.ly-shop-payment-method {
    background: var(--ly-shop-dark);
    border: 1px solid var(--ly-shop-border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px;
}

.ly-shop-payment-method label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.ly-shop-payment-method input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--ly-shop-primary);
}

.ly-shop-payment-method .payment-description {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ly-shop-border);
    font-size: 13px;
    color: var(--ly-shop-text-muted);
}

.ly-shop-btn-place-order {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

/* 訂單完成頁 */
.ly-shop-order-received {
    max-width: 700px;
    margin: 0 auto;
}

.ly-shop-order-received-header {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 107, 157, 0.1));
    border-radius: var(--ly-shop-radius);
    margin-bottom: 30px;
}

.ly-shop-success-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: linear-gradient(135deg, var(--ly-shop-primary), #ff8fab);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.ly-shop-order-received-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.ly-shop-order-received-header p {
    margin: 0;
    color: var(--ly-shop-text-muted);
}

.ly-shop-order-overview ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    background: var(--ly-shop-dark-light);
    border-radius: var(--ly-shop-radius);
    overflow: hidden;
}

.ly-shop-order-overview li {
    flex: 1;
    padding: 20px;
    text-align: center;
    border-right: 1px solid var(--ly-shop-border);
}

.ly-shop-order-overview li:last-child {
    border-right: none;
}

.ly-shop-order-overview .label {
    display: block;
    font-size: 13px;
    color: var(--ly-shop-text-muted);
    margin-bottom: 5px;
}

.ly-shop-order-overview .value {
    font-size: 16px;
    font-weight: 600;
}

.ly-shop-order-details,
.ly-shop-customer-details {
    background: var(--ly-shop-dark-light);
    padding: 25px;
    border-radius: var(--ly-shop-radius);
    margin-bottom: 20px;
}

.ly-shop-order-details h3,
.ly-shop-customer-details h3 {
    margin: 0 0 20px;
    font-size: 18px;
}

.ly-shop-order-items-table {
    width: 100%;
}

.ly-shop-order-items-table th,
.ly-shop-order-items-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-order-items-table .quantity {
    color: var(--ly-shop-text-muted);
}

.ly-shop-order-items-table tfoot .order-total td {
    color: var(--ly-shop-primary);
    font-size: 18px;
}

.ly-shop-order-actions {
    text-align: center;
    margin-top: 30px;
}

/* 通知 */
.ly-shop-notice {
    padding: 20px;
    border-radius: var(--ly-shop-radius);
    margin-bottom: 20px;
}

.ly-shop-notice-info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.ly-shop-notice-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.ly-shop-notice-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* 分頁 */
.ly-shop-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.ly-shop-pagination a,
.ly-shop-pagination span {
    padding: 10px 15px;
    background: var(--ly-shop-dark-light);
    border-radius: 5px;
    color: var(--ly-shop-text);
    text-decoration: none;
}

.ly-shop-pagination .current {
    background: var(--ly-shop-primary);
}

/* 地址三級聯動 */
.ly-shop-address-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ly-shop-address-fields .ly-shop-form-row:last-child {
    grid-column: 1 / -1;
}

/* 優惠券區域 */
.ly-shop-coupon-section {
    margin: 20px 0;
    padding: 20px;
    background: var(--ly-shop-dark);
    border-radius: var(--ly-shop-radius);
}

.ly-shop-coupon-section h4 {
    margin: 0 0 15px;
    font-size: 14px;
}

.ly-shop-coupon-form {
    display: flex;
    gap: 10px;
}

.ly-shop-coupon-form input {
    flex: 1;
    padding: 12px 15px;
    background: var(--ly-shop-dark-light);
    border: 1px solid var(--ly-shop-border);
    border-radius: 8px;
    color: var(--ly-shop-text);
    font-size: 14px;
    text-transform: uppercase;
}

.ly-shop-coupon-form input:focus {
    outline: none;
    border-color: var(--ly-shop-secondary);
}

.ly-shop-coupon-form .ly-shop-btn {
    padding: 12px 20px;
    white-space: nowrap;
}

.ly-shop-coupon-applied {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ly-shop-coupon-applied .coupon-badge {
    background: linear-gradient(135deg, var(--ly-shop-primary), #ff8fab);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.ly-shop-coupon-applied .coupon-discount {
    color: var(--ly-shop-success);
    font-weight: 600;
}

.ly-shop-coupon-applied .ly-shop-remove-coupon {
    color: var(--ly-shop-danger);
    text-decoration: none;
    font-size: 13px;
}

/* 訂單表格優惠券折扣 */
.ly-shop-order-table .coupon-discount th {
    color: var(--ly-shop-success);
}

.ly-shop-order-table .coupon-discount .coupon-code {
    font-size: 12px;
    opacity: 0.8;
}

.ly-shop-order-table .coupon-discount .ly-shop-remove-coupon {
    color: var(--ly-shop-danger);
    text-decoration: none;
    margin-left: 5px;
}

.ly-shop-order-table .coupon-discount td {
    color: var(--ly-shop-success);
}

/* 複選框和單選按鈕樣式 */
.ly-shop-checkbox,
.ly-shop-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

.ly-shop-checkbox input,
.ly-shop-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--ly-shop-primary);
}

/* 商品分類 */
.ly-shop-categories {
    display: grid;
    gap: 20px;
}

.ly-shop-category-item a {
    display: block;
    text-decoration: none;
    color: var(--ly-shop-text);
    background: var(--ly-shop-dark);
    border-radius: var(--ly-shop-radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ly-shop-category-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ly-shop-category-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.ly-shop-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ly-shop-category-item a:hover .ly-shop-category-image img {
    transform: scale(1.1);
}

.ly-shop-category-info {
    padding: 15px;
    text-align: center;
}

.ly-shop-category-info h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.ly-shop-category-info .count {
    font-size: 13px;
    color: var(--ly-shop-text-muted);
}

/* 搜索表單 */
.ly-shop-search-form {
    display: flex;
    gap: 0;
    max-width: 400px;
}

.ly-shop-search-input {
    flex: 1;
    padding: 12px 15px;
    background: var(--ly-shop-dark);
    border: 1px solid var(--ly-shop-border);
    border-right: 0;
    border-radius: var(--ly-shop-radius) 0 0 var(--ly-shop-radius);
    color: var(--ly-shop-text);
    font-size: 14px;
}

.ly-shop-search-input:focus {
    outline: none;
    border-color: var(--ly-shop-primary);
}

.ly-shop-search-btn {
    padding: 12px 18px;
    background: var(--ly-shop-primary);
    border: none;
    border-radius: 0 var(--ly-shop-radius) var(--ly-shop-radius) 0;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.ly-shop-search-btn:hover {
    background: var(--ly-shop-secondary);
}

.ly-shop-search-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* 購物車圖標 */
.ly-shop-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ly-shop-text);
}

.ly-shop-cart-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ly-shop-cart-icon .ly-shop-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--ly-shop-primary);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* 麵包屑 */
.ly-shop-breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--ly-shop-text-muted);
}

.ly-shop-breadcrumb a {
    color: var(--ly-shop-text-muted);
    text-decoration: none;
}

.ly-shop-breadcrumb a:hover {
    color: var(--ly-shop-primary);
}

.ly-shop-breadcrumb .sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* 訂單追蹤 */
.ly-shop-order-tracking {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: var(--ly-shop-dark);
    border-radius: var(--ly-shop-radius);
}

.ly-shop-tracking-form .form-row {
    margin-bottom: 20px;
}

.ly-shop-tracking-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.ly-shop-tracking-form input[type="text"],
.ly-shop-tracking-form input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    background: var(--ly-shop-dark-light);
    border: 1px solid var(--ly-shop-border);
    border-radius: 8px;
    color: var(--ly-shop-text);
    font-size: 14px;
}

.ly-shop-order-result {
    text-align: center;
}

.ly-shop-order-result h3 {
    margin-bottom: 20px;
    color: var(--ly-shop-primary);
}

.ly-shop-order-details {
    width: 100%;
    margin: 20px 0;
    text-align: left;
}

.ly-shop-order-details th,
.ly-shop-order-details td {
    padding: 12px;
    border-bottom: 1px solid var(--ly-shop-border);
}

.ly-shop-order-details th {
    width: 40%;
    color: var(--ly-shop-text-muted);
}

/* 加入購物車短代碼 */
.ly-shop-add-to-cart-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.ly-shop-add-to-cart-shortcode .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--ly-shop-primary);
}

/* 商品輪播 */
.ly-shop-products-slider {
    position: relative;
    overflow: hidden;
}

.ly-slider-wrapper {
    display: flex;
    transition: transform 0.3s;
}

.ly-slider-item {
    flex: 0 0 25%;
    padding: 0 10px;
    box-sizing: border-box;
}

.ly-slider-prev,
.ly-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--ly-shop-dark);
    border: 1px solid var(--ly-shop-border);
    border-radius: 50%;
    color: var(--ly-shop-text);
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.ly-slider-prev:hover,
.ly-slider-next:hover {
    background: var(--ly-shop-primary);
}

.ly-slider-prev { left: 10px; }
.ly-slider-next { right: 10px; }

/* 響應式 */
@media (max-width: 991px) {
    .ly-shop-columns-4 { grid-template-columns: repeat(3, 1fr); }
    .ly-shop-checkout-columns { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .ly-shop-columns-3,
    .ly-shop-columns-4 { grid-template-columns: repeat(2, 1fr); }
    
    .ly-shop-cart-table thead { display: none; }
    
    .ly-shop-cart-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 15px 0;
        border-bottom: 1px solid var(--ly-shop-border);
    }
    
    .ly-shop-cart-table td {
        border: none;
        padding: 5px;
    }
    
    .ly-shop-cart-table .product-thumbnail { width: 80px; }
    .ly-shop-cart-table .product-name { flex: 1; }
    .ly-shop-cart-table .product-price,
    .ly-shop-cart-table .product-quantity,
    .ly-shop-cart-table .product-subtotal { width: 33.33%; text-align: center; }
    .ly-shop-cart-table .product-remove { position: absolute; right: 0; top: 15px; }
    
    .ly-shop-cart-item { position: relative; }
    
    .ly-shop-order-overview ul { flex-direction: column; }
    .ly-shop-order-overview li { border-right: none; border-bottom: 1px solid var(--ly-shop-border); }
    .ly-shop-order-overview li:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
    .ly-shop-columns-2,
    .ly-shop-columns-3,
    .ly-shop-columns-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    .ly-shop-product-info { padding: 10px; }
    .ly-shop-product-title { font-size: 13px; }
    .ly-shop-product-price { font-size: 14px; }
    
    .ly-shop-address-fields { grid-template-columns: 1fr; }
    
    .ly-shop-coupon-form { flex-direction: column; }
    .ly-shop-coupon-form .ly-shop-btn { width: 100%; }
}
