/* =========================================
   1. SINGLE PRODUCT PRICE & RELATED
   ========================================= */

/* Main Product Price (Large & Clear) */
.cdr-single-price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Inherit styling for sale/regular price inside the main wrapper */
.cdr-single-price del {
    color: #999;
    font-size: 0.7em;
    font-weight: 400;
}

.cdr-single-price ins {
    text-decoration: none;
    color: #c62828; /* Sale Red */
}

/* Related Products Mini-Price Styling */
.cdr-related-products .price del,
.cdr-related-products .price span:nth-of-type(1) {
    font-size: 0.75em;
    color: #999;
    text-decoration: line-through;
}

.cdr-related-products .price ins,
.cdr-related-products .price span:nth-of-type(2) {
    font-size: 0.8em;
    padding: 0 5px;
    text-decoration: none;
    font-weight: 700;
    color: #333;
}

.cdr-related-products .price .cdr-discount-tag,
.cdr-related-products .price span:nth-of-type(3) {
    background: #d9534f;
    color: white;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.6em;
}

/* =========================================
   2. META DATA TABLE & ICONS
   ========================================= */

.cdr-meta-table-container {
    width: 100%;
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.cdr-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.cdr-meta-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.cdr-meta-table tr:last-child {
    border-bottom: none;
}

.cdr-meta-label-cell {
    background: #fafafa;
    width: 35%; /* Fixed width for consistency */
    padding: 12px 15px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdr-meta-value-cell {
    padding: 12px 15px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.cdr-meta-table-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* =========================================
   3. GENERIC UPSELL (THE "LOUD" BOX)
   ========================================= */

.cdr-generic-upsell-container {
    padding: 24px;
    background-color: #2E7A8C; /* Brand Teal */
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    margin: 20px 0;
}

.cdr-upsell-title {
    color: #ffffff !important;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

/* The Anchor Wrapper */
.cdr-inner-product-anchor {
    text-decoration: none !important;
    display: block;
}

.cdr-inner-product-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cdr-upsell-image-wrapper img {
    width: 100px; /* Reduced from 160px for better mobile fit */
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: #fdfdfd;
}

.cdr-product-details-col {
    flex: 1;
}

.cdr-product-title {
    color: #111;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
    margin: 0 0 6px 0;
}

.cdr-brand-label {
    font-size: 13px;
    color: #555;
    margin: 0 0 8px 0;
    display: block;
}

/* Price inside Upsell Box */
.cdr-price-wrapper .price {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 1.2em; /* Ensure readability */
}

.cdr-price-wrapper .amount {
    font-weight: 800;
    color: #c62828;
}

.cdr-price-wrapper del {
    color: #999;
    font-size: 0.8em;
    font-weight: normal;
}

.cdr-upsell-footer-tag {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    margin: 15px 0 0 0;
    letter-spacing: 1px;
}

/* Mobile Fix for Upsell */
@media (max-width: 600px) {
    .cdr-inner-product-card {
        flex-direction: column;
        text-align: center;
    }

    .cdr-upsell-image-wrapper img {
        margin-bottom: 10px;
    }
}

/* Collapse empty shortcodes */
.cdr-shortcode-wrapper:empty {
    display: none !important;
}

/* =========================================
   4. BUTTONS: WHATSAPP & CART
   ========================================= */

/* Force WooCommerce Cart Form to allow side-by-side */
form.cart {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

/* Unified WhatsApp Button */
.cdr-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #fff !important;
    padding: 0 20px;
    height: 45px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: 0.3s;
    min-width: 140px;
    white-space: nowrap;
    border: none;
}

.cdr-wa-btn svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    fill: currentColor;
}

.cdr-wa-btn:hover {
    background: #128C7E;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

/* Mobile Responsiveness for Buttons */
@media (max-width: 768px) {
    form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    .cdr-wa-btn {
        width: 100%;
        flex: none;
        height: 50px; /* Taller touch target */
    }

    /* Force full width for standard Woo elements */
    form.cart .quantity,
    form.cart .single_add_to_cart_button {
        width: 100% !important;
        margin-bottom: 5px;
    }
}

/* =========================================
   5. NOTICES & BADGES (Consolidated)
   ========================================= */

/* Base container */
.cdr-sp-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
    border-left-width: 5px;
}

.cdr-sp-notice span:first-child {
    font-size: 18px;
    flex-shrink: 0;
}

/* Specific Notice Types */
.cdr-rx-required {
    background: #fff6f6;
    border: 1px solid #f5cccc;
    border-radius: 6px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 13px;
    color: #a94442;
    font-weight: 600;
}

.cdr-otc-badge {
    background: #f1f8e9;
    border: 1px solid #c5e1a5;
    border-radius: 6px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 13px;
    color: #33691e;
    font-weight: 600;
}

.cdr-notice-delivery {
    background: #f0f9fb;
    border-color: #d1eef3;
    border-left-color: #2e7a8c;
    color: #1b4d59;
}

.cdr-notice-promo {
    background: #f2faf4;
    border-color: #dcf2e4;
    border-left-color: #25d366;
    color: #1a5e35;
}

.cdr-notice-inj {
    background: #fff5f5;
    border-color: #f5cccc;
    border-left-color: #c9302c;
    color: #a94442;
}

.cdr-notice-discreet {
    background: #f8f9fa;
    border-color: #e9ecef;
    border-left-color: #6c757d;
    color: #495057;
}

.cdr-notice-location {
    background: #f5f8ff;
    border-color: #dbe4ff;
    border-left-color: #4c6ef5;
    color: #2b459a;
}

/* =========================================
   6. SIZE CHARTS & LAYOUTS
   ========================================= */

.cdr-size-chart-container {
    background: #ffffff;
    border: 2px solid #f0f0f0;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
}

.cdr-size-chart-title {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #4c857d;
    display: inline-block;
    margin-bottom: 10px;
}

.cdr-size-table {
    width: 100%;
    border-collapse: collapse;
}

.cdr-size-table th {
    text-align: left;
    padding: 12px;
    background: #f8fbfb;
    color: #4c857d;
    font-size: 13px;
    text-transform: uppercase;
}

.cdr-size-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

/* Two Column Layout (used for placing size charts or notices side-by-side) */
.cdr-two-col-layout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.cdr-col-left, .cdr-col-right {
    flex: 1;
    min-width: 300px;
}

@media (max-width: 768px) {
    .cdr-two-col-layout {
        flex-direction: column;
        gap: 20px;
    }
}