/*
 Theme Name:   Noofno Child
 Theme URI:    https://noofno.com
 Description:  Astra 子主题 — noofno.com 定制开发
 Author:       Noofno
 Author URI:   https://noofno.com
 Template:     astra
 Version:      1.0.3
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  noofno-child
*/

/* 子主题自定义样式放在这里 */
/* 父主题 Astra 的样式会自动加载 */

/* ──────────────────────────────────────────────────
   Grouped Product — Amazon 式 Swatch Grid
   ────────────────────────────────────────────────── */

.noofno-grouped-form {
    margin-top: 1.5rem;
}

.noofno-grouped-price-range {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #B12704; /* Amazon-style price red */
}

.noofno-grouped-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.noofno-variant-label {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.noofno-variant-count {
    font-size: 0.85rem;
    color: #666;
}

/* Swatch Grid — 紧凑网格 */
.noofno-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
}

.noofno-swatch-item {
    display: flex;
    flex-direction: column;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
    background: #fff;
}

.noofno-swatch-item:hover,
.noofno-swatch-item:focus {
    border-color: #FF9900;
    box-shadow: 0 1px 6px rgba(255, 153, 0, 0.25);
    transform: scale(1.05);
    text-decoration: none;
    color: inherit;
    z-index: 1;
}

.noofno-swatch-item:focus-visible {
    outline: 2px solid #FF9900;
    outline-offset: 2px;
}

.noofno-swatch-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.noofno-swatch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.noofno-swatch-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.noofno-swatch-placeholder img {
    width: 60%;
    height: auto;
    opacity: 0.3;
}

.noofno-swatch-info {
    padding: 2px 3px;
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
}

/* 80px 紧凑模式 — 仅显示图片+价格，标题 hover 才显示 */
.noofno-swatch-title {
    display: none;
}

.noofno-swatch-price {
    font-size: 0.6rem;
    font-weight: 600;
    color: #111;
    text-align: center;
}

.noofno-swatch-oos {
    font-size: 0.55rem;
    color: #d32f2f;
    font-weight: 500;
    text-align: center;
}

/* ──────────────────────────────────────────────────
   Sibling Navigation — 子体页面：和父体一样的 swatch grid
   ────────────────────────────────────────────────── */

.noofno-sibling-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.noofno-sibling-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

/* 子体页面的 sibling grid 复用 swatch grid 样式 */
.noofno-sibling-nav .noofno-swatch-grid {
    /* 完全复用父体 swatch grid 的紧凑布局 */
}

/* 子体页面高亮当前正在查看的商品 */
.noofno-swatch-item.current {
    border-color: #FF9900;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.35);
    cursor: default;
    opacity: 0.6;
    pointer-events: none;
}

/* ──────────────────────────────────────────────────
   Parent Link — 子体页面顶部"属于"链接
   ────────────────────────────────────────────────── */

.noofno-parent-link {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.noofno-parent-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.noofno-parent-link a:hover {
    color: #FF9900;
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .noofno-swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 4px;
    }

    .noofno-grouped-price-range {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .noofno-swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 3px;
    }
}
