/* Autuskey WooCommerce Jewelry Manager - Frontend Styles */

/* Main jewelry details section */
.jewelry-details-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.jewelry-details-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Jewelry details grid */
.jewelry-details-grid {
    margin-bottom: 15px;
}

.jewelry-detail-item {
    margin-bottom: 0px;
    font-size: small;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.jewelry-detail-item:last-child {
    border-bottom: none;
}

.jewelry-label {
    font-weight: 600;
    color: #555;
    margin-right: 15px;
    flex-shrink: 0;
    display: inline-block;
    min-width: 30%;
}

.jewelry-value {
    color: #333;
    text-align: right;
    font-weight: 500;
}

/* Making charges section */
.jewelry-making-charges {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.jewelry-making-charges h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Price breakdown */
.price-breakdown {
    background: #fff;
    font-size: small;
}

.price-item {
    /* margin-bottom: 10px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.price-item.total-price {
    border-top: 2px solid #0073aa;
    /* margin-top: 5px; */
    padding-top: 8px;
    font-weight: 700;
    font-size: 16px;
}

.price-label {
    font-weight: 600;
    color: #555;
}

.price-value {
    color: #333;
    font-weight: 600;
}

.price-item.total-price .price-value {
    color: #0073aa;
    font-size: 18px;
}

/* Certification section */
.jewelry-certification {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 4px;
}

.certification-badge {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.certified-icon {
    font-size: 20px;
    margin-right: 8px;
}

.certified-text {
    font-weight: 600;
    color: #2e7d32;
    font-size: 16px;
}

.certificate-download {
    margin-top: 12px;
}

.certificate-link {
    display: inline-block;
    padding: 10px 16px;
    background: #4caf50;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.certificate-link:hover {
    background: #45a049;
    text-decoration: none;
}

/* Cart and Checkout Integration */
.jewelry-cart-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.jewelry-cart-info small {
    display: block;
    color: #888;
    font-style: italic;
}

/* Cart table specific styles */
.woocommerce-cart-form .jewelry-cart-info,
.woocommerce-checkout .jewelry-cart-info {
    margin-top: 5px;
    font-size: 11px;
    background: rgba(0, 115, 170, 0.05);
    border: 1px solid rgba(0, 115, 170, 0.1);
}

/* Order details table */
.woocommerce-order-details .jewelry-cart-info {
    margin-top: 5px;
    background: #f8f8f8;
    border: 1px solid #ddd;
}

/* Additional cart and checkout styles for better theme compatibility */
.jewelry-order-info {
    margin-top: 10px;
    padding: 10px 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Ensure jewelry info is visible in different cart table layouts */
.woocommerce-cart .cart_item .jewelry-cart-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.woocommerce-checkout .shop_table .jewelry-cart-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force visibility for common theme conflicts */
.product-name .jewelry-cart-info {
    display: block !important;
    margin-top: 5px !important;
}

/* Cart item specific overrides */
.cart-item .jewelry-cart-info,
.cart_item .jewelry-cart-info {
    background: rgba(0, 115, 170, 0.05) !important;
    border: 1px solid rgba(0, 115, 170, 0.15) !important;
    padding: 8px 12px !important;
    margin-top: 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #666 !important;
}

/* Order display styles for jewelry info */
.jewelry-info-order {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.jewelry-meta-display {
    margin: 4px 0;
}

.jewelry-meta-display .wc-item-meta {
    margin: 0;
}

.jewelry-meta-display .wc-item-meta p {
    margin: 2px 0;
    font-size: 13px;
}

/* Order received page and email styles */
.woocommerce-order-details .jewelry-info-order {
    background: #f9f9f9;
    border-color: #ddd;
}

/* Email template compatibility */
.wc-item-meta .jewelry-info-order {
    margin: 5px 0;
    padding: 5px 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .jewelry-details-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .jewelry-details-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .jewelry-detail-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .jewelry-value {
        text-align: left;
        margin-top: 5px;
        font-size: 14px;
    }
    
    .price-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
    }
    
    .price-value {
        margin-top: 5px;
    }
    
    .certification-badge {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .certified-text {
        margin-top: 5px;
    }
    
    .jewelry-cart-info {
        font-size: 11px;
        padding: 6px 8px;
        margin-top: 5px;
    }
}

/* Additional styling for better integration with WooCommerce themes */
.woocommerce div.product .jewelry-details-section {
    clear: both;
}

/* Theme compatibility */
.woocommerce-product-details__short-description + .jewelry-details-section,
.woocommerce-tabs + .jewelry-details-section {
    margin-top: 25px;
}

/* Ensure proper spacing with WooCommerce elements */
.jewelry-details-section + .woocommerce-tabs,
.jewelry-details-section + .single_variation_wrap,
.jewelry-details-section + .woocommerce-product-gallery {
    margin-top: 25px;
}

/* Style improvements for better visual hierarchy */
.jewelry-details-section .jewelry-label::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

/* Hover effects for better interactivity */
.jewelry-detail-item:hover {
    background-color: rgba(0, 115, 170, 0.05);
    border-radius: 4px;
    margin: 0 -8px;
    padding: 8px;
    transition: all 0.3s ease;
}

.price-item:hover {
    background-color: rgba(0, 115, 170, 0.05);
    border-radius: 4px;
    margin: 0 -8px;
    padding: 8px;
    transition: all 0.2s ease;
}

/* High specificity rules to ensure styling works across themes */
.woocommerce div.product .jewelry-details-section,
.woocommerce-page div.product .jewelry-details-section,
body.single-product .jewelry-details-section {
    margin: 20px 0 !important;
    padding: 20px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    background: #f9f9f9 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    clear: both !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure visibility */
.jewelry-details-section,
.jewelry-details-grid,
.jewelry-detail-item,
.jewelry-making-charges,
.jewelry-certification {
    display: block !important;
    visibility: visible !important;
}

/* Force font inheritance from theme */
.jewelry-details-section * {
    font-family: inherit;
    line-height: inherit;
}

/* Ensure proper color contrast */
.jewelry-details-section {
    color: #333 !important;
}

.jewelry-details-section h3,
.jewelry-making-charges h4 {
    color: #333 !important;
}

/* Fix any potential z-index issues */
.jewelry-details-section {
    position: relative;
    z-index: 1;
}

/* Print styles */
@media print {
    .jewelry-details-section {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .certificate-link {
        background: white !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .jewelry-certification {
        background: white !important;
        border: 1px solid #000 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .jewelry-details-section {
        background: #2a2a2a;
        border-color: #555;
        color: #fff;
    }
    
    .jewelry-details-section h3 {
        color: #fff;
        border-bottom-color: #0073aa;
    }
    
    .jewelry-label,
    .price-label {
        color: #ccc;
    }
    
    .jewelry-value,
    .price-value {
        color: #fff;
    }
    
    .jewelry-detail-item {
        border-bottom-color: #444;
    }
    
    .jewelry-making-charges,
    .price-breakdown {
        background: #333;
        border-color: #555;
    }
    
    .jewelry-info-order {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .woocommerce-order-details .jewelry-info-order {
        background: #2a2a2a;
        border-color: #444;
    }
}
