/*
 Theme Name: Kadence Child
 Template: kadence
*/

/* ---------------------------------------------
   GRID SYSTEM (保持你的原样)
--------------------------------------------- */
.dm-term-grid,
.dm-product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.dm-term-card,
.dm-product-card {
    flex: 1 1 calc(25% - 24px);
    min-width: 220px;
    border: 1px solid #eee;
    padding: 16px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    transition: box-shadow .2s ease, transform .2s ease;
}

.dm-term-card:hover,
.dm-product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transform: translateY(-3px);
}

@media (max-width: 1024px) {
    .dm-term-card,
    .dm-product-card {
        flex: 1 1 calc(33.333% - 24px);
    }
}

@media (max-width: 768px) {
    .dm-term-card,
    .dm-product-card {
        flex: 1 1 calc(50% - 24px);
    }
}

@media (max-width: 480px) {
    .dm-term-card,
    .dm-product-card {
        flex: 1 1 100%;
    }
}

/* ---------------------------------------------
   BUTTON SYSTEM
--------------------------------------------- */
.dm-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    transition: background .2s ease, transform .2s ease;
}

.dm-btn:hover {
    background: #000;
    transform: translateY(-2px);
}

.dm-btn-secondary {
    background: #555;
}

.dm-btn-secondary:hover {
    background: #333;
}

/* ---------------------------------------------
   PRODUCT PAGE (single-product.php)
--------------------------------------------- */
.dm-product-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dm-product-title {
    font-size: 32px;
    margin-bottom: 20px;
}

.dm-product-top {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.dm-product-images {
    flex: 1;
    min-width: 300px;
}

.dm-product-main-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dm-product-gallery {
    display: flex;
    gap: 10px;
}

.dm-product-gallery-image {
    width: 30%;
    border-radius: 6px;
}

.dm-product-info {
    flex: 1;
    min-width: 300px;
}

.dm-product-info-list li {
    margin-bottom: 6px;
}

/* ---------------------------------------------
   SHARE MODAL
--------------------------------------------- */
.dm-share-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.dm-share-modal-inner {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.dm-share-qrcode {
    margin: 15px auto;
}

.dm-share-url-text {
    margin-top: 10px;
    font-size: 13px;
    color: #555;
    word-break: break-all;
}

/* ---------------------------------------------
   CART PAGE CARD UI (/cart/)
--------------------------------------------- */
.dm-cart-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.dm-cart-card-image {
    width: 120px;
    border-radius: 6px;
    flex-shrink: 0;
}

.dm-cart-card-title {
    font-size: 18px;
    margin: 0 0 6px;
}

.dm-cart-card-code {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.dm-cart-spec-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    font-size: 13px;
}

.dm-cart-qty {
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dm-cart-notes {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ---------------------------------------------
   CART BADGE (菜单栏红心徽标)
--------------------------------------------- */
.dm-cart-menu-wrapper {
    position: relative;
}

.dm-cart-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #e60023;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
    display: none; /* JS 控制显示 */
}

.dm-cart-menu-link svg {
    transition: transform .2s ease;
}

.dm-cart-menu-link:hover svg {
    transform: scale(1.15);
}

.dm-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #111;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s ease, transform .3s ease;
    z-index: 99999;
}

.dm-toast.show {
    opacity: 1;
    transform: translateY(0);
}
