/**
 * Custom CSS for BangXi Rubber Theme
 *
 * @package BangXiRubber
 */

/* ============================================
   WooCommerce Customizations
   ============================================ */
.woocommerce ul.products li.product {
    background: var(--bx-bg-white);
    border-radius: var(--bx-radius-lg);
    overflow: hidden;
    transition: all var(--bx-transition-base);
    box-shadow: var(--bx-shadow-md);
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: var(--bx-shadow-xl);
}

.woocommerce ul.products li.product a img {
    margin: 0;
    border-radius: 0;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: var(--bx-spacing-md) var(--bx-spacing-md) 0;
    font-size: var(--bx-font-size-lg);
    font-weight: 600;
}

.woocommerce ul.products li.product .price {
    color: var(--bx-accent);
    padding: 0 var(--bx-spacing-md) var(--bx-spacing-md);
}

.woocommerce .woocommerce-ordering select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--bx-border-gray);
    border-radius: var(--bx-radius-md);
    background: var(--bx-bg-white);
    cursor: pointer;
}

/* ============================================
   Form Styles
   ============================================ */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea,
.wpcf7-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bx-border-gray);
    border-radius: var(--bx-radius-md);
    font-size: var(--bx-font-size-base);
    transition: all var(--bx-transition-fast);
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
    outline: none;
    border-color: var(--bx-secondary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.wpcf7-submit {
    background-color: var(--bx-accent);
    color: var(--bx-text-white);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--bx-radius-md);
    font-size: var(--bx-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bx-transition-base);
}

.wpcf7-submit:hover {
    background-color: var(--bx-accent-dark);
    transform: translateY(-2px);
}

/* ============================================
   Search Form
   ============================================ */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bx-border-gray);
    border-radius: var(--bx-radius-md);
    font-size: var(--bx-font-size-base);
}

.search-form .search-submit {
    padding: 0.75rem 1.5rem;
    background-color: var(--bx-accent);
    color: var(--bx-text-white);
    border: none;
    border-radius: var(--bx-radius-md);
    cursor: pointer;
    transition: all var(--bx-transition-base);
}

.search-form .search-submit:hover {
    background-color: var(--bx-accent-dark);
}

/* ============================================
   Widget Styles
   ============================================ */
.widget {
    margin-bottom: var(--bx-spacing-xl);
}

.widgettitle,
.widget-title {
    font-size: var(--bx-font-size-lg);
    font-weight: 600;
    color: var(--bx-primary);
    margin-bottom: var(--bx-spacing-md);
    padding-bottom: var(--bx-spacing-sm);
    border-bottom: 2px solid var(--bx-accent);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    margin-bottom: var(--bx-spacing-sm);
    padding-bottom: var(--bx-spacing-sm);
    border-bottom: 1px solid var(--bx-border-light);
}

.widget li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget a {
    color: var(--bx-text-gray);
    transition: color var(--bx-transition-fast);
}

.widget a:hover {
    color: var(--bx-accent);
}

/* ============================================
   Comment Styles
   ============================================ */
.comments-area {
    margin-top: var(--bx-spacing-3xl);
}

.comments-title {
    font-size: var(--bx-font-size-2xl);
    margin-bottom: var(--bx-spacing-xl);
    color: var(--bx-primary);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: var(--bx-spacing-xl);
    padding-bottom: var(--bx-spacing-xl);
    border-bottom: 1px solid var(--bx-border-light);
}

.comment:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-body {
    display: flex;
    gap: var(--bx-spacing-lg);
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--bx-primary);
}

.comment-metadata {
    font-size: var(--bx-font-size-sm);
    color: var(--bx-text-light);
    margin-bottom: var(--bx-spacing-sm);
}

.comment-content {
    color: var(--bx-text-gray);
    line-height: 1.7;
}

.reply {
    margin-top: var(--bx-spacing-sm);
}

.comment-reply-link {
    font-size: var(--bx-font-size-sm);
    font-weight: 500;
    color: var(--bx-secondary);
}

/* ============================================
   Pagination
   ============================================ */
.pagination,
.woocommerce-pagination {
    display: flex;
    justify-content: center;
    gap: var(--bx-spacing-xs);
    margin-top: var(--bx-spacing-3xl);
}

.pagination .page-numbers,
.woocommerce-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--bx-spacing-sm);
    background: var(--bx-bg-white);
    border: 1px solid var(--bx-border-light);
    border-radius: var(--bx-radius-md);
    font-weight: 500;
    color: var(--bx-text-dark);
    transition: all var(--bx-transition-fast);
}

.pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers:hover {
    background: var(--bx-primary);
    color: var(--bx-text-white);
    border-color: var(--bx-primary);
}

.pagination .page-numbers.current,
.woocommerce-pagination .page-numbers.current {
    background: var(--bx-accent);
    color: var(--bx-text-white);
    border-color: var(--bx-accent);
}

/* ============================================
   Entry Content Styles
   ============================================ */
.entry-content {
    max-width: 100%;
}

.entry-content h2 {
    margin-top: var(--bx-spacing-2xl);
    margin-bottom: var(--bx-spacing-md);
}

.entry-content h3 {
    margin-top: var(--bx-spacing-xl);
    margin-bottom: var(--bx-spacing-md);
}

.entry-content img {
    border-radius: var(--bx-radius-md);
    margin: var(--bx-spacing-lg) 0;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--bx-spacing-lg);
    padding-left: var(--bx-spacing-xl);
}

.entry-content li {
    margin-bottom: var(--bx-spacing-sm);
}

.entry-content blockquote {
    margin: var(--bx-spacing-xl) 0;
    padding: var(--bx-spacing-lg);
    border-left: 4px solid var(--bx-accent);
    background: var(--bx-bg-light);
    font-style: italic;
}

.entry-content pre {
    background: var(--bx-bg-dark);
    color: var(--bx-text-white);
    padding: var(--bx-spacing-lg);
    border-radius: var(--bx-radius-md);
    overflow-x: auto;
}

/* ============================================
   Page Links (multi-page posts)
   ============================================ */
.page-links {
    margin-top: var(--bx-spacing-xl);
    padding-top: var(--bx-spacing-lg);
    border-top: 1px solid var(--bx-border-light);
    font-weight: 500;
}

.page-links a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bx-bg-light);
    border-radius: var(--bx-radius-sm);
    margin: 0 0.25rem;
}

.page-links a:hover {
    background: var(--bx-primary);
    color: var(--bx-text-white);
}

/* ============================================
   Gallery Styles
   ============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--bx-spacing-lg);
    margin: var(--bx-spacing-xl) 0;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    border-radius: var(--bx-radius-md);
}

.gallery-caption {
    padding: var(--bx-spacing-sm);
    font-size: var(--bx-font-size-sm);
    color: var(--bx-text-gray);
}

/* ============================================
   Table Styles
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--bx-spacing-lg) 0;
}

table th,
table td {
    padding: var(--bx-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--bx-border-light);
}

table th {
    font-weight: 600;
    background: var(--bx-bg-light);
    color: var(--bx-primary);
}

table tr:hover td {
    background: var(--bx-bg-light);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .woocommerce ul.products li.product {
        width: 48% !important;
        float: none !important;
        margin-right: 0 !important;
    }
    
    .bx-blog-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Accessibility
   ============================================ */
a:focus-visible {
    outline: 2px solid var(--bx-accent);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--bx-accent);
    outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .bx-header,
    .bx-footer,
    .bx-whatsapp-float,
    .bx-cta,
    .comments-area,
    .related-posts {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .bx-hero {
        min-height: auto;
        padding: 2rem 0;
        background: none;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}
