/*
 * Luồng đặt hàng (order form standard_cart): danh sách gói kiểu thẻ giá của landing gachcloud.net/minecraft,
 * và màu nút mua, nút tiếp tục, nút thanh toán theo CTA của brand.
 * Màu lấy từ token trong gachcloud.css (sáng/tối); bóng nút khối giống --v9-cta-shadow của landing.
 * Markup: templates/orderforms/standard_cart/products.tpl, dữ liệu: includes/hooks/gachcloud_store_page.php.
 */

:root {
    --gc-cta-shadow: #2f5f33;
    --gc-store-radius: 1.5rem;
    --gc-store-radius-sm: 0.875rem;
    --gc-badge-best: #be123c; /* nhãn "Bán chạy" như landing (rose-700), chữ trắng 6,4:1 */
}

[data-theme="dark"] {
    --gc-cta-shadow: #1f5429;
}

/* Bỏ cột "Sản Phẩm"/"Hành động" và hai khung dropdown ở mọi bước đặt hàng: chọn họ gói bằng tab ở trang
   danh sách gói, giỏ hàng có nút ở header. Nội dung chiếm cả chiều rộng. */
body #order-standard_cart .cart-sidebar,
body #order-standard_cart .sidebar-collapsed {
    display: none;
}

body #order-standard_cart .cart-body {
    float: none;
    width: 100%;
}

/* Nút mua, tiếp tục, thanh toán: theme nexus tô nền --bg-inverted (đen) bằng selector có "footer",
   cụ thể hơn quy tắc trong gachcloud.css, nên phải nhắc lại ở đây. */
body #order-standard_cart .products .product footer .btn-order-now,
body #order-standard_cart .btn-order-now,
body #order-standard_cart .btn-checkout,
body #order-standard_cart #btnCompleteProductConfig,
body #order-standard_cart #checkout,
body #order-standard_cart #btnCompleteOrder {
    color: var(--gc-on-primary);
    background: var(--gc-primary);
    border-color: var(--gc-primary);
    box-shadow: 0 4px 0 var(--gc-cta-shadow);
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body #order-standard_cart .products .product footer .btn-order-now:hover,
body #order-standard_cart .btn-order-now:hover,
body #order-standard_cart .btn-checkout:hover,
body #order-standard_cart #btnCompleteProductConfig:hover,
body #order-standard_cart #checkout:hover,
body #order-standard_cart #btnCompleteOrder:hover {
    color: var(--gc-on-primary);
    background: var(--gc-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--gc-cta-shadow);
}

body #order-standard_cart .btn-order-now:active,
body #order-standard_cart .btn-checkout:active,
body #order-standard_cart #btnCompleteProductConfig:active,
body #order-standard_cart #checkout:active,
body #order-standard_cart #btnCompleteOrder:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--gc-cta-shadow);
}

/* ---------- Tab họ gói ---------- */

.gc-store .gc-family-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 2rem;
}

.gc-store .gc-family-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 64px;
    padding: 0.5rem 0.875rem 0.5rem 0.5rem;
    border: 2px solid var(--gc-border);
    border-radius: var(--gc-store-radius-sm);
    background: var(--gc-surface);
    color: var(--gc-ink);
    text-decoration: none;
    box-shadow: var(--gc-shadow);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.gc-store .gc-family-tab:hover {
    border-color: var(--gc-border-strong);
    color: var(--gc-ink);
    text-decoration: none;
    transform: translateY(-2px);
}

.gc-store .gc-family-tab.is-current {
    border-color: var(--gc-primary);
    background: color-mix(in srgb, var(--gc-grass) 12%, var(--gc-surface));
}

.gc-store .gc-family-tab img,
.gc-store .gc-family-tab-icon {
    flex: none;
    width: 64px;
    height: 44px;
    border-radius: 0.5rem;
    object-fit: contain; /* ảnh 16:9 của landing, mob ở giữa: hiện trọn con vật thay vì cắt */
    background: var(--gc-surface-soft);
}

.gc-store .gc-family-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gc-link);
}

.gc-store .gc-family-tab-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.gc-store .gc-family-tab-name {
    font-weight: 800;
    font-size: 1rem;
}

.gc-store .gc-family-tab-price {
    font-size: 0.8125rem;
    color: var(--gc-ink-soft);
    white-space: nowrap;
}

/* ---------- Đầu trang nhóm ---------- */

.gc-store .gc-store-head {
    margin-bottom: 1.75rem;
}

.gc-store .gc-store-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--gc-ink);
    text-wrap: balance;
}

.gc-store .gc-store-tagline {
    max-width: 80ch;
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--gc-ink-soft);
}

.gc-store .gc-store-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.875rem;
    padding: 0;
    list-style: none;
}

.gc-store .gc-store-chips li {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--gc-border);
    border-radius: 999px;
    background: var(--gc-surface-soft);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gc-ink);
}

.gc-store .gc-store-help {
    margin: 0;
    font-size: 0.9375rem;
}

.gc-store .gc-store-help a {
    color: var(--gc-link);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Lưới thẻ gói ---------- */

body #order-standard_cart .gc-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
}

body #order-standard_cart .products .product.gc-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 1.5rem;
    border: 1px solid var(--gc-border);
    border-radius: var(--gc-store-radius);
    background: var(--gc-surface);
    box-shadow: var(--gc-shadow);
    transition: transform 0.2s ease;
}

body #order-standard_cart .products .product.gc-plan:hover {
    transform: translateY(-4px);
}

body #order-standard_cart .products .product.gc-plan--best {
    border: 2px solid var(--gc-primary);
}

body #order-standard_cart .products .product.gc-plan--out {
    opacity: 0.72;
}

body #order-standard_cart .products .product.gc-plan--out:hover {
    transform: none;
}

body #order-standard_cart .products .product.gc-plan header.gc-plan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body #order-standard_cart .gc-plan-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gc-ink);
}

body #order-standard_cart .products .product.gc-plan header .gc-plan-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--gc-badge-best);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body #order-standard_cart .products .product.gc-plan header .gc-plan-stock {
    position: static;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gc-ink-soft);
}

body #order-standard_cart .products .product.gc-plan .gc-plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.375rem;
    margin: 0.75rem 0 1rem;
    float: none;
    width: auto;
    text-align: left;
    font-size: 1rem;
}

body #order-standard_cart .products .product.gc-plan .gc-plan-amount {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--gc-ink);
    font-variant-numeric: tabular-nums;
}

body #order-standard_cart .gc-plan-unit,
body #order-standard_cart .gc-plan-setup {
    font-size: 0.875rem;
    color: var(--gc-ink-soft);
}

body #order-standard_cart .products .product.gc-plan div.product-desc {
    flex: 1;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
}

body #order-standard_cart .gc-plan-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 1rem;
}

body #order-standard_cart .gc-plan-tile {
    padding: 0.625rem 0.5rem;
    border-radius: 0.75rem;
    background: var(--gc-surface-soft);
    box-shadow: inset 0 -3px 0 var(--gc-border);
    text-align: center;
}

body #order-standard_cart .gc-plan-tile dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gc-ink-soft);
}

body #order-standard_cart .gc-plan-tile dd {
    margin: 0.125rem 0 0;
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--gc-ink);
    white-space: nowrap;
}

body #order-standard_cart .products .product.gc-plan ul.gc-plan-specs {
    margin: 0;
    padding: 0;
    list-style: none;
}

body #order-standard_cart .products .product.gc-plan ul.gc-plan-specs li {
    position: relative;
    padding: 0.25rem 0 0.25rem 1.5rem;
    color: var(--gc-ink);
}

/* Dấu tích vẽ bằng CSS (font icon của theme đang ra ô rỗng). */
body #order-standard_cart .products .product.gc-plan ul.gc-plan-specs li::before {
    content: "";
    position: absolute;
    left: 0.25rem;
    top: 0.6rem;
    width: 0.5rem;
    height: 0.8rem;
    border: solid var(--gc-link);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

body #order-standard_cart .products .product.gc-plan footer.gc-plan-foot {
    margin: 1.25rem 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    float: none;
    width: auto;
    text-align: left;
}

body #order-standard_cart .products .product.gc-plan footer .btn-order-now {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 1rem;
}

body #order-standard_cart .products .product.gc-plan footer .btn-order-now.gc-out-of-stock {
    color: var(--gc-ink-soft);
    background: var(--gc-surface-soft);
    border-color: var(--gc-border-strong);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
    opacity: 1;
}

/* ---------- Ghi chú dưới lưới ---------- */

.gc-store .gc-store-family-notes {
    margin: 2rem 0 0;
    padding: 1.5rem;
    border: 1px solid var(--gc-border);
    border-radius: var(--gc-store-radius);
    background: var(--gc-surface-soft);
}

.gc-store .gc-store-notes-title {
    margin: 0 0 0.75rem;
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--gc-ink);
}

.gc-store .gc-store-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.gc-store .gc-store-features li {
    color: var(--gc-ink);
}

.gc-store .gc-store-features li::before {
    content: "✓ ";
    font-weight: 800;
    color: var(--gc-link);
}

.gc-store .gc-store-cpu-note {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gc-ink-soft);
}

/* ---------- Gợi ý mã giảm giá ở giỏ hàng ---------- */

#order-standard_cart .gc-promo-hint {
    margin: 0 0 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    background: var(--gc-warn-bg);
    color: var(--gc-ink);
    font-size: 0.9375rem;
}

#order-standard_cart .gc-promo-hint-code {
    padding: 0.125rem 0.5rem;
    border: 1px dashed var(--gc-ink-soft);
    border-radius: 0.375rem;
    background: var(--gc-surface);
    color: var(--gc-ink);
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}

/* ---------- Màn hình nhỏ ---------- */

@media (max-width: 1199px) {
    .gc-store .gc-family-tabs {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 0.5rem;
    }

    .gc-store .gc-family-tab {
        flex: 0 0 auto;
        min-width: 180px;
        scroll-snap-align: start;
    }
}

@media (max-width: 991px) {
    body #order-standard_cart .gc-plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    body #order-standard_cart .gc-plan-grid {
        grid-template-columns: 1fr;
    }

    .gc-store .gc-family-tab {
        min-width: 160px;
    }

    /* Điện thoại: thu gọn phần đầu để thẻ gói đầu tiên lên gần màn đầu. */
    .gc-store .gc-family-tabs {
        margin-bottom: 1.25rem;
    }

    .gc-store .gc-store-head {
        margin-bottom: 1.25rem;
    }

    .gc-store .gc-store-tagline {
        margin-bottom: 0.75rem;
        font-size: 0.9375rem;
    }

    .gc-store .gc-store-chips {
        gap: 0.375rem;
        margin-bottom: 0.625rem;
    }

    .gc-store .gc-store-chips li {
        padding: 0.25rem 0.625rem;
        font-size: 0.8125rem;
    }

    body #order-standard_cart .products .product.gc-plan {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gc-store .gc-family-tab,
    body #order-standard_cart .products .product.gc-plan,
    body #order-standard_cart .btn-order-now,
    body #order-standard_cart .btn-checkout,
    body #order-standard_cart #btnCompleteProductConfig,
    body #order-standard_cart #checkout,
    body #order-standard_cart #btnCompleteOrder {
        transition: none;
    }

    .gc-store .gc-family-tab:hover,
    body #order-standard_cart .products .product.gc-plan:hover,
    body #order-standard_cart .btn-order-now:hover,
    body #order-standard_cart .btn-checkout:hover,
    body #order-standard_cart #btnCompleteProductConfig:hover,
    body #order-standard_cart #checkout:hover,
    body #order-standard_cart #btnCompleteOrder:hover {
        transform: none;
    }
}
