/* --- Product Specification Table Styling (Regular CSS) --- */

.product-specs-table {
    width: 100%;                  /* 表格宽度100% */
    border-collapse: collapse;    /* 合并单元格边框 */
    margin-top: 16px;             /* 上外边距 (等同于 Tailwind my-4 的一半) */
    margin-bottom: 16px;          /* 下外边距 */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 类似 Tailwind 的默认字体栈 */
}

.product-specs-table tbody tr {
    border-bottom: 1px solid #e5e7eb; /* 行底部边框 (类似 Tailwind border-slate-200) */
}

.product-specs-table tbody tr:last-child {
    border-bottom: none; /* 最后一行无底部边框 */
}

.product-specs-table tbody td {
    padding-top: 8px;    /* 上内边距 (等同于 Tailwind py-2 的一半) */
    padding-bottom: 8px; /* 下内边距 (等同于 Tailwind py-2 的一半) */
    vertical-align: top; /* 垂直顶部对齐 */
    line-height: 1.6;    /* 设置一个舒适的行高 */
}

/* 标签列 (通常是左边那列) */
.product-specs-table td.a-span3 { /* 或者更通用地针对第一列: .product-specs-table td:first-child */
    padding-right: 12px; /* 右内边距 (等同于 Tailwind pr-3) */
    width: 30%;          /* 给标签列一个宽度，可以根据需要调整 */
                         /* 如果想用响应式，需要媒体查询 */
}

/* 内容列 (通常是右边那列) */
.product-specs-table td.a-span9 { /* 或者更通用地针对第二列: .product-specs-table td:nth-child(2) */
    padding-left: 6px;  /* 左内边距 (等同于 Tailwind pl-1.5) */
}

.product-specs-table span.a-size-base { /* 用于单元格内 span 的基础样式 */
    font-size: 0.875rem; /* 14px (等同于 Tailwind text-sm) */
                         /* 如果想更小，可以用 0.75rem (12px, Tailwind text-xs) */
    color: #4b5563;      /* 文本颜色 (类似 Tailwind text-slate-600) */
}

.product-specs-table span.a-text-bold { /* 用于加粗的标签文本 */
    font-weight: 500;   /* 字体加粗 (等同于 Tailwind font-medium) */
                         /* 如果想更粗，可以用 600 (font-semibold) */
    color: #374151;      /* 标签文本颜色 (类似 Tailwind text-slate-700) */
}

.product-specs-table span.po-break-word { /* 用于内容文本，确保换行 */
    word-break: break-word; /* 允许长单词换行 */
}

/* 响应式调整 (可选，示例：在小屏幕上标签列宽度变大，字体变小) */
@media (max-width: 640px) { /* 对应 Tailwind sm 断点 */
    .product-specs-table td.a-span3 {
        width: 40%; /* 增加标签列在小屏幕上的宽度占比 */
    }
    .product-specs-table span.a-size-base {
        font-size: 0.75rem; /* 12px */
    }
}


.product-specs-table tbody tr:nth-child(even) {
    background-color: #f9fafb; /* 类似 Tailwind bg-slate-50 */

}

/* ==========================================================================
   MODERN WOOCOMMERCE CART TABLE STYLES
   ========================================================================== */

/* --- Main Table Container --- */
/* Makes the table full-width with modern card styling */
.woocommerce-cart .shop_table.cart {
    width: 100%;
    border-collapse: separate; /* Use separate to allow for spacing and border-radius */
    border-spacing: 0;
    table-layout: fixed; /* Ensures column widths are respected */
    background-color: #ffffff;
    border-radius: 0.75rem; /* Corresponds to Tailwind's rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    overflow: hidden; /* Important for border-radius to apply correctly */
}

/* --- Table Header (thead) --- */
.woocommerce-cart .shop_table.cart thead {
    background-color: #f9fafb; /* gray-50 */
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

.woocommerce-cart .shop_table.cart th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #4b5563; /* gray-600 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Column Widths (Desktop) --- */
.woocommerce-cart .shop_table.cart th.product-remove { width: 5%; }
.woocommerce-cart .shop_table.cart th.product-thumbnail { width: 15%; } /* Wider for bigger image */
.woocommerce-cart .shop_table.cart th.product-name { width: 35%; } /* Most space for name */
.woocommerce-cart .shop_table.cart th.product-price { width: 15%; }
.woocommerce-cart .shop_table.cart th.product-quantity { width: 15%; }
.woocommerce-cart .shop_table.cart th.product-subtotal { width: 15%; }


/* --- Table Body (tbody) & Rows (tr) --- */
.woocommerce-cart .shop_table.cart tbody tr.cart_item {
    border-bottom: 1px solid #f3f4f6; /* gray-100 */
}
.woocommerce-cart .shop_table.cart tbody tr.cart_item:last-child {
    border-bottom: none;
}

.woocommerce-cart .shop_table.cart td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle; /* Key for clean alignment */
}

/* --- Specific Cell Styling --- */

/* 1. Remove Button */
.woocommerce-cart .shop_table.cart td.product-remove .remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem; /* 32px */
    height: 2rem; /* 32px */
    font-size: 1.25rem; /* Larger 'x' */
    line-height: 1;
    font-weight: bold;
    color: #9ca3af; /* gray-400 */
    text-decoration: none;
    background-color: #f9fafb; /* gray-50 */
    border-radius: 9999px; /* rounded-full */
    transition: all 0.2s ease-in-out;
}
.woocommerce-cart .shop_table.cart td.product-remove .remove:hover {
    background-color: #fee2e2; /* red-100 */
    color: #ef4444; /* red-500 */
    transform: scale(1.1) rotate(90deg);
}

/* 2. Thumbnail Image - LARGER */
.woocommerce-cart .shop_table.cart td.product-thumbnail img {
    width: 100px; /* <--- YOUR REQUEST: Larger Image */
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    max-width: none; /* Override potential theme constraints */
}

/* 3. Product Name */
.woocommerce-cart .shop_table.cart td.product-name a {
    font-weight: 600; /* font-semibold */
    color: #1f2937; /* gray-800 */
    text-decoration: none;
    transition: color 0.2s;
}
.woocommerce-cart .shop_table.cart td.product-name a:hover {
    color: #3b82f6; /* blue-500 */
}

/* 4. Price & Subtotal */
.woocommerce-cart .shop_table.cart .product-price,
.woocommerce-cart .shop_table.cart .product-subtotal {
    font-weight: 600;
    font-size: 1rem;
    color: #111827; /* gray-900 */
}

/* 5. Quantity Input */
.woocommerce-cart .shop_table.cart .quantity {
    display: inline-flex;
}
.woocommerce-cart .shop_table.cart .quantity .qty {
    width: 80px;
    text-align: center;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.woocommerce-cart .shop_table.cart .quantity .qty:focus {
    outline: none;
    border-color: #3b82f6; /* blue-500 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* --- Actions Row (Coupon & Update Cart) --- */
.woocommerce-cart .shop_table.cart td.actions {
    padding: 1.5rem;
    background-color: #f9fafb; /* gray-50 */
}

.woocommerce-cart .shop_table.cart .actions .coupon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem; /* Spacing for mobile */
}

.woocommerce-cart .shop_table.cart .actions .coupon .input-text {
    flex-grow: 1;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.625rem 1rem;
}
.woocommerce-cart .shop_table.cart .actions .coupon .button,
.woocommerce-cart .shop_table.cart .actions > .button {
    background-color: #3b82f6; /* blue-500 */
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}
.woocommerce-cart .shop_table.cart .actions .coupon .button:hover,
.woocommerce-cart .shop_table.cart .actions > .button:hover {
    background-color: #2563eb; /* blue-600 */
    transform: translateY(-1px);
}
.woocommerce-cart .shop_table.cart .actions > .button[disabled] {
    background-color: #9ca3af; /* gray-400 */
    cursor: not-allowed;
    transform: none;
}
@media (min-width: 768px) {
    .woocommerce-cart .shop_table.cart td.actions {
        text-align: right; /* Align buttons to the right on desktop */
    }
    .woocommerce-cart .shop_table.cart .actions .coupon {
        float: left; /* Coupon on the left */
        margin-bottom: 0;
    }
}


/* --- Responsive Styles for Mobile (< 768px) --- */
@media (max-width: 767px) {
    /* Hide the header on mobile as we use data-titles */
    .woocommerce-cart .shop_table.cart thead {
        display: none;
    }

    /* Make each row a "card" */
    .woocommerce-cart .shop_table.cart tbody tr.cart_item {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }
    .woocommerce-cart .shop_table.cart tbody tr.cart_item:last-child {
        margin-bottom: 0;
    }

    /* Make cells stack vertically */
    .woocommerce-cart .shop_table.cart td {
        display: block;
        text-align: right !important; /* Force right alignment */
        width: 100% !important; /* Override column widths */
        padding: 0.75rem 1rem;
        border: none;
        border-bottom: 1px dashed #e5e7eb;
    }
    .woocommerce-cart .shop_table.cart td:last-child {
        border-bottom: none;
    }

    /* Add labels before the content */
    .woocommerce-cart .shop_table.cart td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #4b5563;
        float: left; /* Align label to the left */
        margin-right: 1rem;
    }

    /* Special handling for some cells on mobile */
    .woocommerce-cart .shop_table.cart td.product-remove {
        position: absolute;
        top: 0;
        right: 0;
        padding: 0.5rem;
        border: none;
        background: transparent;
    }
    .woocommerce-cart .shop_table.cart td.product-remove::before {
        display: none; /* Hide the "Remove" label */
    }
    .woocommerce-cart .shop_table.cart td.product-thumbnail {
        padding: 1rem;
        text-align: center !important;
        border-bottom: 1px solid #e5e7eb;
    }
    .woocommerce-cart .shop_table.cart td.product-thumbnail::before {
        display: none; /* Hide the "Thumbnail" label */
    }
    .woocommerce-cart .shop_table.cart td.product-thumbnail img {
        margin: 0 auto;
    }

    .woocommerce-cart .shop_table.cart td.product-quantity .quantity {
        width: 100%;
        justify-content: flex-end;
    }
    .woocommerce-cart .shop_table.cart td.product-quantity .quantity .qty {
        width: 100px;
    }
    
    .woocommerce-cart .shop_table.cart .actions .coupon {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .woocommerce-cart .shop_table.cart .actions .button {
        width: 100%;
        margin-top: 1rem;
    }
}



















/* ==========================================================================
   WOOCOMMERCE NOTICES & MESSAGES STYLING (V2 - Icon Removed)
   ========================================================================== */

   .woocommerce-message,
   .woocommerce-info,
   .woocommerce-error {
       padding: 1rem 1.5rem;
       margin: 0 0 2rem 0;
       border-radius: 0.5rem;
       list-style: none !important;
       position: relative;
       border-left: 5px solid; /* Keep the colored border */
   }
   
   /* --- THE KEY FIX: Hide the pseudo-element completely --- */
   .woocommerce-message::before,
   .woocommerce-info::before,
   .woocommerce-error::before {
       display: none !important;
   }
   
   /* --- Message Type Styling (without icons) --- */
   .woocommerce-message {
       background-color: #f0fdf4;
       border-color: #22c55e;
       color: #15803d;
   }
   .woocommerce-message .restore-item {
       font-weight: 600;
       color: #166534;
       text-decoration: underline;
       margin-left: 0.5rem;
       transition: color 0.2s;
   }
   .woocommerce-message .restore-item:hover {
       color: #15803d;
   }
   
   .woocommerce-info {
       background-color: #eff6ff;
       border-color: #3b82f6;
       color: #1e40af;
   }
   
   .woocommerce-error {
       background-color: #fef2f2;
       border-color: #ef4444;
       color: #991b1b;
   }






/* ==========================================================================
   STICKY FOOTER FOR CART PAGE ONLY
   ========================================================================== */

/*
 * This block of code ensures that ONLY the cart page has a minimum height
 * of the full screen, pushing the footer to the bottom.
 * It uses the '.woocommerce-cart' body class as a specific trigger.
 */

/* 1. When on the cart page, make the body a full-height flex container. */
body.woocommerce-cart {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 2. On the cart page, tell the main content area to expand and fill space.
      We use your theme's specific selector '#content' for precision. */
body.woocommerce-cart #content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}
