/* ================================================================
   Becca Design – enskild WooCommerce-produkt
   För GeneratePress + GP Premium + WooCommerce (klassisk layout).
   Filen laddas enbart när is_product() är true.
   Inga ändringar görs i WooCommerce JS, gallerimallar eller formulär.
   ================================================================ */

/* Grundmått och färger. */
body.single-product.woocommerce {
    --bd-sp-bg: var(--bd-surface);
    --bd-sp-bg-muted: #fff3f5;
    --bd-sp-ink: var(--bd-ink);
    --bd-sp-muted: #776c72;
    --bd-sp-accent: var(--bd-coral);
    --bd-sp-accent-hover: #d9482c;
    --bd-sp-line: rgba(103, 53, 60, .11);
    --bd-sp-radius: 19px;
}

/* Håll de stora produktbilderna borta från skärmkanterna.
   GeneratePress har annars max-width 2000px på sitens container. */
body.single-product.woocommerce #primary .inside-article {
    box-sizing: border-box;
    max-width: 1390px;
    margin-left: auto;
    margin-right: auto;
}

/* Diskret brödsmulor ovanför tvåkolumnslayouten. */
body.single-product.woocommerce .entry-content > .woocommerce-breadcrumb {
    margin: 0 0 23px;
    padding: 0;
    color: var(--bd-sp-muted);
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}
body.single-product.woocommerce .entry-content > .woocommerce-breadcrumb a {
    color: var(--bd-sp-accent);
    text-decoration: none;
}
body.single-product.woocommerce .entry-content > .woocommerce-breadcrumb a:hover {
    text-decoration: underline;
}

/* Grundlayout – de fyra direkta barnen finns redan i WooCommerce HTML. */
body.single-product.woocommerce .entry-content > div.product {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    column-gap: clamp(24px, 3.5vw, 50px);
    row-gap: 35px;
    align-items: start;
    min-width: 0;
}

body.single-product.woocommerce .entry-content > div.product > .images,
body.single-product.woocommerce .entry-content > div.product > .summary {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
}
body.single-product.woocommerce .entry-content > div.product > .images {
    grid-column: 1;
    grid-row: 1;
}
body.single-product.woocommerce .entry-content > div.product > .summary {
    grid-column: 2;
    grid-row: 1;
}
body.single-product.woocommerce .entry-content > div.product > .woocommerce-tabs,
body.single-product.woocommerce .entry-content > div.product > .related,
body.single-product.woocommerce .entry-content > div.product > .up-sells {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    float: none;
    clear: none;
    margin: 0;
}

/* Bildgalleri. FlexSlider styr storlek/höjd på .flex-viewport;
   vi ändrar inte bildposition, transform eller dess JavaScript. */
body.single-product.woocommerce .entry-content > div.product > .images {
    background: var(--bd-sp-bg);
    padding: 12px;
    border-radius: 23px;
    box-shadow: 0 10px 28px rgba(90, 47, 59, .06);
}
body.single-product.woocommerce div.product .woocommerce-product-gallery__wrapper,
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-viewport {
    overflow: hidden;
    border-radius: 15px;
}
body.single-product.woocommerce div.product .woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 15px;
}
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 9px;
    overflow-x: auto;
    padding: 12px 0 2px;
    margin: 0;
    scrollbar-width: thin;
}
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs li {
    box-sizing: border-box;
    flex: 0 0 74px;
    width: 74px !important;
    margin: 0 !important;
    padding: 0;
    float: none;
}
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs li img {
    display: block;
    width: 100%;
    border-radius: 9px;
    border: 2px solid transparent;
    opacity: .73;
    transition: opacity .15s, border-color .15s;
}
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active,
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: #ba5575;
}

/* Samlad och tydlig köpkolumn. */
body.single-product.woocommerce div.product > .summary {
    box-sizing: border-box;
    background: var(--bd-sp-bg);
    border: 1px solid rgba(103, 53, 60, .05);
    border-radius: 23px;
    padding: clamp(23px, 2.8vw, 38px);
    box-shadow: 0 10px 28px rgba(90, 47, 59, .05);
    text-align: left;
}
body.single-product.woocommerce div.product .summary h1.product_title {
    margin: 0 0 16px;
    padding: 0;
    color: var(--bd-sp-ink);
    font-size: clamp(28px, 2.8vw, 40px);
    line-height: 1.16;
    letter-spacing: -.035em;
    font-weight: 700;
}
body.single-product.woocommerce div.product .woocommerce-product-rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 21px;
}
body.single-product.woocommerce div.product .woocommerce-product-rating .star-rating {
    float: none;
    margin: 0;
    flex: 0 0 auto;
}
body.single-product.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link {
    color: var(--bd-sp-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.single-product.woocommerce div.product .summary p.price {
    margin: 0 0 13px;
    color: var(--bd-sp-ink);
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: 700;
    line-height: 1.28;
}
body.single-product.woocommerce div.product .summary p.price del {
    font-size: .65em;
    color: var(--bd-sp-muted);
    opacity: .65;
    font-weight: 500;
}
body.single-product.woocommerce div.product .summary p.price ins {
    color: var(--bd-sp-accent);
    text-decoration: none;
}
body.single-product.woocommerce div.product .summary .woocommerce-product-details__short-description,
body.single-product.woocommerce div.product .summary .bd-product-intro {
    margin: 13px 0 19px;
    color: #62535c;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.75;
}
body.single-product.woocommerce div.product .summary p.stock {
    font-size: 13px;
    font-weight: 600;
    margin: 13px 0 13px;
    line-height: 1.4;
}
body.single-product.woocommerce div.product .summary p.stock.in-stock,
body.single-product.woocommerce div.product .summary p.stock.available-on-backorder {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 30px;
    background: #e7f3eb;
    color: #2d6944;
}
body.single-product.woocommerce div.product .summary p.stock.in-stock::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: none;
    background: #44885c;
    border-radius: 50%;
}
body.single-product.woocommerce div.product .summary p.stock.out-of-stock {
    display: inline-block;
    padding: 7px 12px;
    color: #7e304a;
    background: #f7dce5;
    border-radius: 20px;
}


/* ================================================================
   SLUTSÅLD / BEVAKNING – Back In Stock Notifier for WooCommerce
   Styla befintligt formulär utan att ändra pluginets HTML/JS.
   Avgränsat till WooCommerce-produktsidans köpkolumn.
   ================================================================ */
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form {
    width: 100%;
    max-width: 100%;
    margin: 20px 0 22px;
    color: var(--bd-sp-ink);
    text-align: left;
    font-size: 14px;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-primary {
    overflow: hidden;
    margin: 0;
    padding: 18px 20px 19px;
    background: #fff3f6;
    border: 1px solid #ebcbd7;
    border-radius: 15px;
    box-shadow: none;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-heading {
    display: block;
    padding: 0 0 13px;
    margin: 0;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    color: var(--bd-sp-ink) !important;
    text-align: left;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-heading h4 {
    margin: 0;
    padding: 0;
    color: var(--bd-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left !important; /* Pluginet skriver text-align:center inline. */
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-body {
    padding: 0;
    background: transparent;
}
/* Återställ pluginets Bootstrap-12-kolumner; gammal CSS satte 90 % bredd. */
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-body .row {
    margin: 0;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-body .col-md-12 {
    float: none;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    padding: 0 !important;
    margin: 0;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .form-group {
    width: 100%;
    max-width: 100%;
    margin: 0 0 11px;
    text-align: left !important;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_email {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    height: 47px;
    padding: 11px 14px;
    border: 1px solid #dfcad3;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    color: #352c35;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left !important;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_email:focus {
    outline: 2px solid rgba(134, 50, 81, .20);
    outline-offset: 1px;
    border-color: var(--bd-rose);
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 47px;
    padding: 11px 16px;
    background: var(--bd-coral) !important;
    border: 0 !important;
    border-radius: 10px;
    color: #fff !important;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    transition: background-color .2s ease;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_button:hover,
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_button:focus-visible {
    background: #d9482c !important;
    color: #fff !important;
}
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_button:focus-visible {
    outline: 2px solid #752945;
    outline-offset: 2px;
}
/* Behåll synliga framgångs- och felmeddelanden från pluginet. */
body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwgstock_output {
    margin-top: 8px;
    color: #55404b;
    font-size: 13px;
    line-height: 1.5;
}
@media (max-width: 480px) {
    body.single-product.woocommerce div.product .summary .cwginstock-subscribe-form .cwginstock-panel-primary {
        padding: 16px;
    }
}

/* Formulären för enkla och variabla produkter förblir oförändrade.
   Detta begränsar sig till färg, mellanrum och kontroller. */
body.single-product.woocommerce div.product .summary form.cart {
    margin: 23px 0 17px;
    padding: 0;
}
body.single-product.woocommerce div.product .summary form.cart .quantity {
    display: inline-flex;
    align-items: center;
    float: none;
    margin: 0 10px 0 0;
    vertical-align: middle;
    background: #fff;
    border: 1px solid #e7d1d9;
    border-radius: 11px;
    overflow: hidden;
}
body.single-product.woocommerce div.product .summary form.cart .quantity input.qty {
    box-sizing: border-box;
    width: 55px;
    height: 51px;
    min-height: 51px;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--bd-sp-ink);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
body.single-product.woocommerce div.product .summary form.cart .quantity .plus,
body.single-product.woocommerce div.product .summary form.cart .quantity .minus {
    min-width: 31px;
    min-height: 51px;
    border: 0;
    background: transparent;
    color: var(--bd-sp-ink);
}
body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    float: none;
    box-sizing: border-box;
    min-height: 53px;
    max-width: 100%;
    padding: 12px 25px;
    border: 0;
    border-radius: 11px;
    background: var(--bd-sp-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    transition: background .2s ease;
}
body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button:hover,
body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button:focus-visible {
    background: var(--bd-sp-accent-hover);
    color: #fff;
}
body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button:focus-visible {
    outline: 2px solid #af472f;
    outline-offset: 3px;
}

/* Variable produkter och tillägg från Woo Custom Product Addons Pro. */
body.single-product.woocommerce div.product .summary form.cart table.variations,
body.single-product.woocommerce div.product .summary form.cart table.variations tbody {
    width: 100%;
}
body.single-product.woocommerce div.product .summary form.cart table.variations tr,
body.single-product.woocommerce div.product .summary form.cart table.variations td,
body.single-product.woocommerce div.product .summary form.cart table.variations th {
    background: transparent;
    border: 0;
    padding: 0 0 9px;
}
body.single-product.woocommerce div.product .summary form.cart table.variations label,
body.single-product.woocommerce div.product .summary form.cart fieldset.wcpa_field_wrap legend {
    color: var(--bd-sp-ink);
    font-size: 14px;
    font-weight: 600;
}
body.single-product.woocommerce div.product .summary form.cart table.variations select {
    width: 100%;
    min-height: 45px;
    padding: 9px 12px;
    border: 1px solid #e7d1d9;
    border-radius: 10px;
    background: #fff;
    color: var(--bd-sp-ink);
}
body.single-product.woocommerce div.product .summary form.cart .woocommerce-variation-price {
    color: var(--bd-sp-ink);
    font-size: 19px;
    font-weight: 700;
    margin: 9px 0;
}

/* Liten trygghetsrad, matad av inc/single-product.php. */
body.single-product.woocommerce div.product .summary .bd-product-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 19px 0 18px;
    padding: 16px 0;
    border-top: 1px solid var(--bd-sp-line);
    border-bottom: 1px solid var(--bd-sp-line);
}
body.single-product.woocommerce div.product .summary .bd-product-benefit {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: #5b5055;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
}
body.single-product.woocommerce div.product .summary .bd-product-benefit__icon {
    color: var(--bd-sp-accent);
    font-weight: 800;
    font-size: 14px;
}
body.single-product.woocommerce div.product .summary a.bd-product-benefit--link:hover {
    color: var(--bd-sp-accent);
    text-decoration: underline;
}

/* Ändra gamla orange/rosa etikettknappar till diskreta ämneslänkar. */
body.single-product.woocommerce div.product .summary .product_meta {
    display: block;
    margin: 13px 0 0;
    padding: 0;
    border: 0;
    color: var(--bd-sp-muted);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 2.0;
}
body.single-product.woocommerce div.product .summary .product_meta > span {
    display: block;
    margin: 6px 0 0;
}
body.single-product.woocommerce div.product .summary .product_meta .sku_wrapper {display:none}
body.single-product.woocommerce div.product .summary .product_meta a,
body.single-product.woocommerce div.product .summary .product_meta .posted_in a,
body.single-product.woocommerce div.product .summary .product_meta .tagged_as a {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #853a58;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: normal;
}
body.single-product.woocommerce div.product .summary .product_meta a:hover { color: var(--bd-sp-accent); }

/* Flikar och innehåll under huvudprodukten. */
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    border: 0;
    white-space: nowrap;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs::before,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs::after,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.description_tab,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.reviews_tab,
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.additional_information_tab {
    position: static;
    display: block;
    float: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 13px 13px 0 0;
    background: #f1dce4;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: var(--bd-sp-bg) !important;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 12px 20px;
    color: #5f4655;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
}
body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--bd-sp-accent);
}
body.single-product.woocommerce div.product .woocommerce-tabs .panel {
    box-sizing: border-box;
    margin: 0;
    padding: clamp(22px, 3vw, 36px);
    border-radius: 0 19px 19px 19px;
    background: var(--bd-sp-bg);
    color: #554a51;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    box-shadow: 0 7px 22px rgba(90, 47, 59, .035);
}
body.single-product.woocommerce div.product .woocommerce-tabs .panel h2 {
    color: var(--bd-sp-ink);
    font-size: clamp(20px, 2vw, 25px);
    line-height: 1.3;
    margin: 0 0 16px;
}
body.single-product.woocommerce div.product .woocommerce-tabs .panel h1.entry-title { display: none; }
body.single-product.woocommerce div.product .woocommerce-tabs .panel ul { padding-left: 20px; margin: 12px 0; }
body.single-product.woocommerce div.product .woocommerce-tabs .panel li { margin-bottom: 3px; }

/* Läsbara produktrecensioner, utan att ändra recensionsformulärets logik. */
body.single-product.woocommerce div.product #reviews .commentlist {
    padding: 0;
    margin: 0 0 24px;
}
body.single-product.woocommerce div.product #reviews .commentlist li {
    padding: 0;
    margin: 0 0 12px;
}
body.single-product.woocommerce div.product #reviews .commentlist li .comment-text {
    border: 1px solid #ecd5dd;
    background: #fff;
    border-radius: 13px;
    padding: 17px 20px;
}
body.single-product.woocommerce div.product #review_form_wrapper {
    max-width: 710px;
    margin-top: 22px;
}
body.single-product.woocommerce div.product #review_form_wrapper textarea,
body.single-product.woocommerce div.product #review_form_wrapper input[type=text],
body.single-product.woocommerce div.product #review_form_wrapper input[type=email] {
    border: 1px solid #e7d1d9;
    background: #fff;
    border-radius: 9px;
    max-width: 100%;
}
body.single-product.woocommerce div.product #review_form_wrapper input[type=submit] {
    color: #fff;
    background: var(--bd-sp-accent);
    border-radius: 9px;
}

/* Relaterade produkter använder redan de befintliga nya produktkorten. */
body.single-product.woocommerce div.product section.related.products > h2,
body.single-product.woocommerce div.product section.up-sells.products > h2 {
    color: var(--bd-sp-ink);
    font-size: clamp(23px, 2.4vw, 29px);
    line-height: 1.3;
    margin: 6px 0 23px;
}
body.single-product.woocommerce div.product section.related.products ul.products,
body.single-product.woocommerce div.product section.up-sells.products ul.products {
    margin: 0;
}

@media (max-width: 980px) {
    body.single-product.woocommerce .entry-content > div.product {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 25px;
    }
    body.single-product.woocommerce div.product > .summary { padding: 25px; }
}
@media (max-width: 800px) {
    body.single-product.woocommerce #primary .inside-article { max-width: 690px; }
    body.single-product.woocommerce .entry-content > div.product {
        display: block;
    }
    body.single-product.woocommerce .entry-content > div.product > .images {
        margin: 0 0 20px !important;
    }
    body.single-product.woocommerce .entry-content > div.product > .summary {
        margin: 0 0 25px !important;
    }
    body.single-product.woocommerce .entry-content > div.product > .woocommerce-tabs {margin: 0 0 28px;}
    body.single-product.woocommerce div.product > .summary { padding: 26px 22px; }
    body.single-product.woocommerce div.product .summary h1.product_title { font-size: 31px; }
}
@media (max-width: 480px) {
    body.single-product.woocommerce #primary .inside-article { padding: 16px !important; }
    body.single-product.woocommerce .entry-content > div.product > .images {padding:8px; border-radius:15px;}
    body.single-product.woocommerce div.product .woocommerce-product-gallery__wrapper,
    body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-viewport,
    body.single-product.woocommerce div.product .woocommerce-product-gallery__image img {border-radius:10px;}
    body.single-product.woocommerce div.product > .summary { padding:22px 18px; border-radius:15px; }
    body.single-product.woocommerce div.product .summary h1.product_title { font-size:28px; }
    body.single-product.woocommerce div.product .summary form.cart .quantity {margin:0 7px 0 0;}
    body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button {padding:12px 13px; font-size:13px;}
    body.single-product.woocommerce div.product .woocommerce-tabs ul.tabs li a {padding:11px 13px; font-size:12.5px;}
    body.single-product.woocommerce div.product .woocommerce-tabs .panel {padding:20px 17px; border-radius:0 13px 13px 13px;}
    body.single-product.woocommerce div.product .summary .bd-product-benefits {gap:9px 13px;}
}
