/* Cosmo Pharm V21 focused UX corrections */

/* Product gallery controls: present on desktop, invisible on mobile where swipe is natural. */
body.cp-single-product-v16 .cp-v20-gallery-arrow{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    min-height:40px !important;
    background:rgba(255,255,255,.78) !important;
    border:1px solid rgba(23,61,45,.13) !important;
    box-shadow:0 5px 16px rgba(23,61,45,.06) !important;
    font-size:30px !important;
    opacity:.88 !important;
}
body.cp-single-product-v16 .cp-v20-gallery-prev{left:12px !important;}
body.cp-single-product-v16 .cp-v20-gallery-next{right:12px !important;}
body.cp-single-product-v16 .cp-v20-gallery-arrow:hover,
body.cp-single-product-v16 .cp-v20-gallery-arrow:focus{
    opacity:1 !important;
}

@media(max-width:767px){
    body.cp-single-product-v16 .cp-v20-gallery-arrow{
        display:none !important;
    }
}

/* Homepage banner controls: smaller and calmer, without covering important artwork. */
body.home .cp-banner-arrow{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    background:rgba(255,255,255,.72) !important;
    border-color:rgba(23,61,45,.12) !important;
    box-shadow:none !important;
    opacity:.82 !important;
    backdrop-filter:blur(3px) !important;
    -webkit-backdrop-filter:blur(3px) !important;
}
body.home .cp-banner-arrow::before{
    font-size:31px !important;
    line-height:.76 !important;
}
body.home .cp-banner-prev{left:12px !important;}
body.home .cp-banner-next{right:12px !important;}
body.home .cp-banner-arrow:hover,
body.home .cp-banner-arrow:focus{
    opacity:1 !important;
}
@media(max-width:767px){
    body.home .cp-banner-arrow{
        width:36px !important;
        height:36px !important;
        min-width:36px !important;
        min-height:36px !important;
        opacity:.76 !important;
    }
    body.home .cp-banner-arrow::before{
        font-size:27px !important;
    }
    body.home .cp-banner-prev{left:7px !important;}
    body.home .cp-banner-next{right:7px !important;}
}

/* Product marker row. Only dedicated badge assets are allowed by V21 PHP. */
body.cp-single-product-v16 .cp-v20-product-markers{
    gap:14px 12px !important;
}
body.cp-single-product-v16 .cp-v20-product-marker{
    width:88px !important;
    min-width:88px !important;
}
body.cp-single-product-v16 .cp-v20-product-marker-logo{
    width:72px !important;
    height:72px !important;
}
body.cp-single-product-v16 .cp-v20-product-marker img{
    max-width:72px !important;
    max-height:72px !important;
}
body.cp-single-product-v16 .cp-v20-product-marker figcaption{
    color:#173d2d !important;
    font-size:10px !important;
    font-weight:700 !important;
}

/* Product information intro contains only customer-facing navigation language. */
body.cp-single-product-v16 .cp-v16-info-intro h2{
    max-width:520px !important;
}

/* Standardized long-form product content. */
body.cp-single-product-v16 .cp-v16-product-description{
    color:#3f4743 !important;
    font-size:16px !important;
    line-height:1.72 !important;
}
body.cp-single-product-v16 .cp-v16-product-description h2,
body.cp-single-product-v16 .cp-v16-product-description h3,
body.cp-single-product-v16 .cp-v16-product-description h4{
    margin-top:38px !important;
    margin-bottom:14px !important;
    color:#173d2d !important;
    font-family:Georgia,"Times New Roman",serif !important;
    font-weight:400 !important;
    letter-spacing:-.015em !important;
}
body.cp-single-product-v16 .cp-v16-product-description h2{font-size:34px !important;line-height:1.14 !important;}
body.cp-single-product-v16 .cp-v16-product-description h3{font-size:27px !important;line-height:1.2 !important;}
body.cp-single-product-v16 .cp-v16-product-description h4{font-size:21px !important;line-height:1.25 !important;}
body.cp-single-product-v16 .cp-v16-product-description p{
    margin:0 0 16px !important;
}
body.cp-single-product-v16 .cp-v16-product-description ul,
body.cp-single-product-v16 .cp-v16-product-description ol{
    margin:12px 0 22px 22px !important;
    padding:0 !important;
}
body.cp-single-product-v16 .cp-v16-product-description li{
    margin:0 0 8px !important;
    line-height:1.65 !important;
}

/* Every composition / ingredients table receives the same visual system. */
body.cp-single-product-v16 .cp-v21-table-wrap{
    width:100% !important;
    margin:22px 0 34px !important;
    overflow-x:auto !important;
    border:1px solid #dfe5e1 !important;
    background:#fff !important;
    -webkit-overflow-scrolling:touch;
}
body.cp-single-product-v16 .cp-v21-table-wrap table,
body.cp-single-product-v16 .cp-v16-product-description table.cp-v21-data-table{
    width:100% !important;
    min-width:560px !important;
    margin:0 !important;
    border:0 !important;
    border-collapse:collapse !important;
    border-spacing:0 !important;
    background:#fff !important;
    box-shadow:none !important;
    color:#39413e !important;
    font-family:Arial,sans-serif !important;
    font-size:15px !important;
    line-height:1.48 !important;
}
body.cp-single-product-v16 .cp-v21-table-wrap th,
body.cp-single-product-v16 .cp-v21-table-wrap td{
    padding:15px 18px !important;
    border:0 !important;
    border-right:1px solid #e3e8e5 !important;
    border-bottom:1px solid #e3e8e5 !important;
    background:#fff !important;
    color:#39413e !important;
    text-align:left !important;
    vertical-align:middle !important;
}
body.cp-single-product-v16 .cp-v21-table-wrap tr:last-child > *{
    border-bottom:0 !important;
}
body.cp-single-product-v16 .cp-v21-table-wrap tr > *:last-child{
    border-right:0 !important;
}
body.cp-single-product-v16 .cp-v21-table-wrap table.has-header-row tr:first-child > *,
body.cp-single-product-v16 .cp-v21-table-wrap thead th{
    background:#faf7f0 !important;
    color:#173d2d !important;
    font-weight:700 !important;
}
body.cp-single-product-v16 .cp-v21-table-wrap strong,
body.cp-single-product-v16 .cp-v21-table-wrap b{
    color:#173d2d !important;
}

/* Legacy colored content boxes are normalized, without changing their wording. */
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-legacy-panel{
    margin:24px 0 30px !important;
    padding:22px 24px !important;
    border:0 !important;
    border-left:3px solid #b79a58 !important;
    border-radius:0 !important;
    background:#faf7f0 !important;
    box-shadow:none !important;
    color:#39413e !important;
}
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-legacy-panel > :first-child{margin-top:0 !important;}
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-legacy-panel > :last-child{margin-bottom:0 !important;}

/* Remove leftover colored table/panel styling from old builders. */
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-data-table [style*="background"],
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-data-table [bgcolor]{
    background:#fff !important;
    background-color:#fff !important;
}
body.cp-single-product-v16 .cp-v16-product-description .cp-v21-data-table.has-header-row tr:first-child [style*="background"]{
    background:#faf7f0 !important;
    background-color:#faf7f0 !important;
}

/* Fully custom language control. Native Weglot stays in the DOM for functionality only. */
body.cp-global-shell .cp-footer-language{
    position:relative !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
}
body.cp-global-shell .cp-footer-language > .cp-v21-language-native{
    position:absolute !important;
    left:-99999px !important;
    width:1px !important;
    height:1px !important;
    overflow:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
}
body.cp-global-shell .cp-v21-language-ui{
    position:relative !important;
    z-index:10 !important;
    width:190px !important;
    font-family:Arial,sans-serif !important;
}
body.cp-global-shell .cp-v21-language-button{
    width:190px !important;
    height:46px !important;
    display:grid !important;
    grid-template-columns:36px 1fr 18px !important;
    align-items:center !important;
    gap:8px !important;
    padding:0 14px !important;
    border:1px solid rgba(255,255,255,.32) !important;
    border-radius:0 !important;
    background:rgba(255,255,255,.96) !important;
    color:#173d2d !important;
    box-shadow:none !important;
    cursor:pointer !important;
    text-align:left !important;
}
body.cp-global-shell .cp-v21-language-code{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:34px !important;
    height:24px !important;
    border:1px solid #dfe5e1 !important;
    color:#173d2d !important;
    font-size:11px !important;
    font-weight:800 !important;
    letter-spacing:.08em !important;
}
body.cp-global-shell .cp-v21-language-name{
    color:#173d2d !important;
    font-size:14px !important;
    font-weight:600 !important;
    line-height:1 !important;
    white-space:nowrap !important;
}
body.cp-global-shell .cp-v21-language-chevron{
    color:#173d2d !important;
    font-size:19px !important;
    line-height:1 !important;
    transform:rotate(90deg) !important;
    transition:transform .18s ease !important;
}
body.cp-global-shell .cp-v21-language-ui.is-open .cp-v21-language-chevron{
    transform:rotate(-90deg) !important;
}
body.cp-global-shell .cp-v21-language-menu{
    position:absolute !important;
    right:0 !important;
    bottom:52px !important;
    left:0 !important;
    display:none !important;
    margin:0 !important;
    padding:6px !important;
    border:1px solid #dfe5e1 !important;
    background:#fff !important;
    box-shadow:0 14px 34px rgba(0,0,0,.12) !important;
}
body.cp-global-shell .cp-v21-language-ui.is-open .cp-v21-language-menu{
    display:block !important;
}
body.cp-global-shell .cp-v21-language-option{
    width:100% !important;
    min-height:40px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:12px !important;
    padding:9px 10px !important;
    border:0 !important;
    background:#fff !important;
    color:#173d2d !important;
    font-size:13px !important;
    font-weight:600 !important;
    text-align:left !important;
    cursor:pointer !important;
}
body.cp-global-shell .cp-v21-language-option:hover,
body.cp-global-shell .cp-v21-language-option:focus{
    background:#faf7f0 !important;
}
body.cp-global-shell .cp-v21-language-option.is-current::after{
    content:"✓";
    color:#b79a58;
    font-weight:800;
}

@media(max-width:767px){
    body.cp-single-product-v16 .cp-v16-product-description{
        font-size:15px !important;
        line-height:1.7 !important;
    }
    body.cp-single-product-v16 .cp-v16-product-description h2{font-size:29px !important;}
    body.cp-single-product-v16 .cp-v16-product-description h3{font-size:24px !important;}
    body.cp-single-product-v16 .cp-v16-product-description h4{font-size:20px !important;}
    body.cp-single-product-v16 .cp-v21-table-wrap{
        margin:18px 0 28px !important;
    }
    body.cp-single-product-v16 .cp-v21-table-wrap table,
    body.cp-single-product-v16 .cp-v16-product-description table.cp-v21-data-table{
        min-width:0 !important;
        table-layout:auto !important;
        font-size:13px !important;
    }
    body.cp-single-product-v16 .cp-v21-table-wrap th,
    body.cp-single-product-v16 .cp-v21-table-wrap td{
        padding:11px 10px !important;
        overflow-wrap:anywhere !important;
    }
    body.cp-single-product-v16 .cp-v16-product-description .cp-v21-legacy-panel{
        padding:18px !important;
    }
    body.cp-global-shell .cp-v21-language-ui,
    body.cp-global-shell .cp-v21-language-button{
        width:188px !important;
    }
}

/* =========================================================
   V27 native Weglot restoration and shop landing cleanup
   ========================================================= */

/* Let Weglot own language switching again. The custom overlay is retired. */
body.cp-global-shell .cp-v21-language-ui,
body.cp-global-shell .cp-language-current-label{
    display:none !important;
}

body.cp-global-shell .cp-footer-language > .cp-v21-language-native,
body.cp-global-shell .cp-footer-language .weglot-container,
body.cp-global-shell .cp-footer-language .wg-default,
body.cp-global-shell .cp-footer-language .country-selector,
body.cp-global-shell .cp-footer-language .cp-language-integrated{
    position:relative !important;
    inset:auto !important;
    left:auto !important;
    top:auto !important;
    width:190px !important;
    min-width:190px !important;
    max-width:100% !important;
    height:auto !important;
    overflow:visible !important;
    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;
    transform:none !important;
    margin:0 !important;
    z-index:20 !important;
}

body.cp-global-shell .cp-footer-language .wgcurrent,
body.cp-global-shell .cp-footer-language .weglot_choice,
body.cp-global-shell .cp-footer-language .country-selector > a,
body.cp-global-shell .cp-footer-language .country-selector .wgcurrent > a,
body.cp-global-shell .cp-footer-language .weglot-container .wgcurrent > a{
    min-height:46px !important;
    width:100% !important;
    box-sizing:border-box !important;
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
    padding:0 14px !important;
    background:#fff !important;
    color:#173d2d !important;
    border:1px solid rgba(255,255,255,.34) !important;
    border-radius:0 !important;
    box-shadow:none !important;
    font-family:Arial,sans-serif !important;
    font-size:14px !important;
    font-weight:500 !important;
    line-height:1.2 !important;
    text-decoration:none !important;
}

body.cp-global-shell .cp-footer-language ul,
body.cp-global-shell .cp-footer-language .wg-drop,
body.cp-global-shell .cp-footer-language .weglot_dropmenu{
    z-index:9999 !important;
}

/* The Products landing starts directly with useful navigation. */
body.cp-shop-v14.woocommerce-shop .cp-v15-discovery{
    margin-top:52px !important;
}

@media(max-width:767px){
    body.cp-global-shell .cp-footer-language > .cp-v21-language-native,
    body.cp-global-shell .cp-footer-language .weglot-container,
    body.cp-global-shell .cp-footer-language .wg-default,
    body.cp-global-shell .cp-footer-language .country-selector,
    body.cp-global-shell .cp-footer-language .cp-language-integrated{
        width:min(210px,100%) !important;
        min-width:0 !important;
    }

    body.cp-shop-v14.woocommerce-shop .cp-v15-discovery{
        margin-top:28px !important;
    }
}


/* =========================================================
   V28 visual cleanup: product imagery + text selection
   ========================================================= */

/* Shop/category cards: keep product photography clean, without the pale legacy tile behind it. */
body.cp-shop-v14 .cp-v14-card-media{
    background:transparent !important;
    box-shadow:none !important;
    border:0 !important;
    padding:0 14px !important;
}

body.cp-shop-v14 .cp-v14-card-media img.cp-v14-card-image{
    background:transparent !important;
    box-shadow:none !important;
    border:0 !important;
}

/* Replace the old turquoise browser text-selection colour with the current brand palette. */
::selection{
    background:#d8bd7a;
    color:#173d2d;
}
::-moz-selection{
    background:#d8bd7a;
    color:#173d2d;
}

@media(max-width:767px){
    body.cp-shop-v14 .cp-v14-card-media{
        padding:0 8px !important;
    }
}
