/*
Theme Name: New Edition UK
Template: Divi
Version: 1.2.0
Description: Secure architecture for custom overrides.
*/

/* ==========================================================================
   WOOCOMMERCE STORE NOTICE MASTER OVERRIDE
   Compact bar; Dismiss works (WooCommerce hides it with an inline
   display:none, so flex only applies while the notice is shown).
   ========================================================================== */

p.woocommerce-store-notice {
    background-color: #000000 !important; /* Pitch black for maximum contrast */
    color: #ffffff !important; /* Crisp white typography */
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    padding: 8px 16px !important;
    text-align: center !important;
    border-bottom: 2px solid #22c55e !important; /* Anchors the banner with your conversion green */
    z-index: 999999 !important; /* Forces the banner to sit above any Divi sticky headers */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
}

p.woocommerce-store-notice:not([style*="none"]) {
    display: flex !important;
}

/* The Dismiss button */
p.woocommerce-store-notice a.woocommerce-store-notice__dismiss-link {
    background-color: #15803d !important; /* Darker green: 5:1 contrast with white */
    color: #ffffff !important;
    padding: 3px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
    position: relative !important;
    right: auto !important;
    top: auto !important;
    flex-shrink: 0 !important;
}

p.woocommerce-store-notice a.woocommerce-store-notice__dismiss-link:hover {
    background-color: #166534 !important; /* Deeper green on hover */
}

/* Phones: one line, text truncates, Dismiss stays visible */
@media (max-width: 767px) {
    p.woocommerce-store-notice {
        font-size: 12px !important;
        padding: 6px 10px !important;
        gap: 10px !important;
    }

    p.woocommerce-store-notice .newedition-notice-text {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: left;
    }
}

/* ==========================================================================
   HEADER (Theme Builder)
   ========================================================================== */

/* The header section is set to 102% wide, which caused sideways scrolling */
.et-db #et-boc .et-l .et_pb_section_0_tb_header {
    width: 100% !important;
}

/* Phones and tablets: the logo box (10% wide) collapsed to 0 px */
@media (max-width: 980px) {
    .et-db #et-boc .et-l .et_pb_menu_0_tb_header .et_pb_menu_inner_container > .et_pb_menu__logo-wrap {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .et-db #et-boc .et-l .et_pb_menu_0_tb_header .et_pb_menu__logo img {
        width: 52px !important;
        height: auto !important;
    }
}

/* Gold text fails contrast on white (2.2:1); darker gold for text only */
.et-db #et-boc .et-l .et_pb_menu_0_tb_header li.current-menu-item > a,
.et-db #et-boc .et-l .et_pb_menu_0_tb_header .et_pb_menu__cart-count,
.et-db #et-boc .et-l--footer .et_pb_menu li.current-menu-item > a {
    color: #857328 !important;
}

/* Desktop: "My account" becomes a person icon beside the cart and search
   icons; the link text stays for screen readers, and the phone menu keeps
   the words. All three icons share the darker gold (3:1 minimum for icons). */
@media (min-width: 981px) {
    .et-l--header .et_pb_menu .et-menu-nav > ul > li > a[href*="/my-account"] {
        font-size: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .et-l--header .et_pb_menu .et-menu-nav > ul > li > a[href*="/my-account"]::before {
        content: "\e08a";
        content: "\e08a" / ""; /* screen readers skip the glyph */
        font-family: ETmodules;
        font-size: 20px;
        line-height: 1;
        color: #857328;
    }

    .et-l--header .et_pb_menu .et_pb_menu__cart-button::after,
    .et-l--header .et_pb_menu .et_pb_menu__search-button::after {
        color: #857328 !important;
    }
}

/* Divi's dropdown arrow glyph was read out as part of the link ("Our Shop 3") */
.et-l--header .et-menu .menu-item-has-children > a:first-child::after {
    content: "3" / "";
}

/* ==========================================================================
   PRODUCT BUY BOX AND CHECKOUT BUTTONS
   ========================================================================== */

.single-product form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}

.single-product form.cart .quantity,
.single-product form.cart .single_add_to_cart_button {
    float: none !important;
    margin: 0 !important;
}

/* Add to cart is the primary action: solid brand navy */
.single-product form.cart .single_add_to_cart_button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout #place_order {
    background-color: #294266 !important;
    border-color: #294266 !important;
    color: #ffffff !important;
}

.single-product form.cart .single_add_to_cart_button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-checkout #place_order:hover {
    background-color: #1c2f4a !important;
    border-color: #1c2f4a !important;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Divi removes focus outlines; keyboard users need to see where they are */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #294266 !important;
    outline-offset: 2px !important;
}

/* Home: the gold "New Edition for Publishing" heading, darker for contrast */
body.home .et_pb_blurb h4.et_pb_module_header {
    color: #857328 !important;
}

/* ==========================================================================
   ARABIC TEXT
   Passages marked lang="ar" read right-to-left in an Arabic typeface.
   ========================================================================== */

/* Specific enough to beat Divi's per-module font rules */
:lang(ar),
body.et-db #et-boc .et-l .et_pb_module [lang="ar"] {
    font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, serif !important;
}

[dir="rtl"][lang="ar"] {
    text-align: right;
}

/* Footer credit link: brand navy with an underline on hover */
.et-l--footer a[href="https://jservo.com"]:hover,
.et-l--footer a[href="https://jservo.com"]:focus-visible {
    color: #294266 !important;
    text-decoration: underline;
}

/* ==========================================================================
   FOOTER MENU
   ========================================================================== */

/* The menu opens upwards, so Divi pinned the dropdown arrow to the bottom of
   "Our Shop", under the text. Put it beside the text, pointing up. */
.et-l--footer .et_pb_menu .et-menu-nav > ul.upwards > li.menu-item-has-children > a::after {
    content: "2";
    content: "2" / ""; /* screen readers skip the glyph */
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

/* One even bar: no gap under the items, text centred in the bar */
.et-l--footer .et_pb_menu .et-menu-nav > ul.et-menu > li {
    margin-bottom: 0;
}

.et-l--footer .et_pb_menu .et-menu-nav > ul.et-menu > li > a {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

.et-l--footer .et_pb_menu {
    margin-bottom: 16px !important;
}

/* Hover was a bright blue; use the gold of the current item */
.et-l--footer .et_pb_menu .et-menu-nav li a:hover {
    color: #857328 !important;
}

/* ==========================================================================
   HOME: CATEGORY TILES ("Curated Collections")
   Five tiles in one row on desktop, styled like the cream cards above them.
   ========================================================================== */

/* Frame: black like the rest of the frame below it (was #333) */
body.home .et_pb_text:has(li.product-category) {
    padding-top: 48px !important;
    padding-bottom: 20px !important;
    border-color: #000 !important;
}

body.home .et_pb_text:has(li.product-category) .et_pb_text_inner > p:empty {
    display: none;
}

body.home .woocommerce ul.products:has(> li.product-category) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0 0 8px !important;
}

/* WooCommerce's clearfix pseudo-elements would become empty flex items */
body.home .woocommerce ul.products:has(> li.product-category)::before,
body.home .woocommerce ul.products:has(> li.product-category)::after {
    display: none;
}

body.home .woocommerce ul.products li.product-category {
    display: flex;
    float: none !important;
    width: calc((100% - 80px) / 5) !important;
    margin: 0 !important;
}

body.home .woocommerce ul.products li.product-category > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 12px 12px 16px;
    background-color: rgba(226, 193, 132, 0.68); /* the cream of the cards above */
    border: 3px solid #000;
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Lifts with the same hard shadow as the gold buttons */
body.home .woocommerce ul.products li.product-category > a:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 #222;
}

body.home .woocommerce ul.products li.product-category > a img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 0 12px !important;
}

body.home .woocommerce ul.products li.product-category h2.woocommerce-loop-category__title {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 !important;
    font-family: Poppins, Helvetica, Arial, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

/* The product count: a small pill at the foot of the tile, no yellow */
body.home .woocommerce ul.products li.product-category mark.count {
    margin-top: auto;
    padding: 1px 12px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 999px;
    font-family: "Afacad Flux", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: #333;
}

@media (max-width: 980px) {
    body.home .woocommerce ul.products li.product-category {
        width: calc((100% - 40px) / 3) !important;
    }
}

@media (max-width: 767px) {
    body.home .et_pb_text:has(li.product-category) {
        padding-top: 28px !important;
    }

    body.home .woocommerce ul.products:has(> li.product-category) {
        gap: 14px;
    }

    body.home .woocommerce ul.products li.product-category {
        width: calc((100% - 14px) / 2) !important;
    }

    body.home .woocommerce ul.products li.product-category > a {
        padding: 10px 10px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.home .woocommerce ul.products li.product-category > a {
        transition: none;
    }

    body.home .woocommerce ul.products li.product-category > a:hover {
        transform: none;
    }
}

/* ==========================================================================
   MY ACCOUNT: SIGN-IN AND PASSWORD RESET (logged out)
   ========================================================================== */

/* The panel's "outset" border drew two tones of navy; one solid line */
body.woocommerce-account .et-l--post .et_pb_row:has(.woocommerce) {
    border-style: solid !important;
}

/* A centred column instead of a form 1,000 px wide */
body.woocommerce-account:not(.logged-in) .et-l--post .woocommerce {
    max-width: 460px;
    margin: 0 auto;
    padding: 24px 0 16px;
}

body.woocommerce-account:not(.logged-in) .woocommerce > h2 {
    font-family: "Afacad Flux", Helvetica, Arial, sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #294266;
    text-align: center;
}

body.woocommerce-account:not(.logged-in) .woocommerce form.login,
body.woocommerce-account:not(.logged-in) .woocommerce form.lost_reset_password {
    margin: 16px 0 0;
    padding: 28px;
    background: #fff;
    border: 1px solid #e2d8bb;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(26, 33, 48, 0.08);
}

body.woocommerce-account:not(.logged-in) .woocommerce form .form-row {
    float: none;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
}

body.woocommerce-account:not(.logged-in) .woocommerce form .form-row label {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

body.woocommerce-account:not(.logged-in) .woocommerce form .form-row input.input-text {
    padding: 12px 14px !important;
    background: #fff !important;
    border: 1.5px solid #8c8466 !important;
    border-radius: 10px !important;
    font-size: 16px !important; /* 16 px stops phones zooming into the field */
    color: #333 !important;
}

body.woocommerce-account:not(.logged-in) .woocommerce form .form-row input.input-text:focus {
    border-color: #294266 !important;
    box-shadow: 0 0 0 3px rgba(41, 66, 102, 0.18);
    outline: none;
}

/* Google button centred, with an "or" divider under it */
body.woocommerce-account:not(.logged-in) .woocommerce form.login .googlesitekit-sign-in-with-google__frontend-output-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100% !important;
    max-width: none; /* Site Kit caps the row at 320 px, which pushed the button off centre */
}

body.woocommerce-account:not(.logged-in) .woocommerce form.login .googlesitekit-sign-in-with-google__frontend-output-button::after {
    content: "or";
    width: 100%;
    font-size: 14px;
    line-height: 1;
    text-align: center;
    color: #666;
    background:
        linear-gradient(#e2d8bb, #e2d8bb) left center / calc(50% - 24px) 1px no-repeat,
        linear-gradient(#e2d8bb, #e2d8bb) right center / calc(50% - 24px) 1px no-repeat;
}

/* "Remember me" above a full-width Log in button */
body.woocommerce-account:not(.logged-in) .woocommerce form.login p.form-row:not(.form-row-wide) {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.woocommerce-account:not(.logged-in) .woocommerce form .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 400;
}

body.woocommerce-account:not(.logged-in) .woocommerce form .woocommerce-form-login__rememberme input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #294266;
}

body.woocommerce-account:not(.logged-in) .woocommerce form button.button,
body.woocommerce-account:not(.logged-in) .woocommerce form button.button:hover {
    width: 100%;
    margin: 0 !important;
    padding: 12px 20px !important;
    background-color: #294266 !important;
    border: 2px solid #294266 !important;
    border-radius: 10px;
    font-size: 17px;
    color: #fff !important;
}

body.woocommerce-account:not(.logged-in) .woocommerce form button.button:hover {
    background-color: #1c2f4a !important;
    border-color: #1c2f4a !important;
}

/* Divi's sliding arrow on buttons */
body.woocommerce-account:not(.logged-in) .woocommerce form button.button::after {
    display: none;
}

body.woocommerce-account:not(.logged-in) .woocommerce .lost_password {
    margin: 4px 0 0;
    text-align: center;
}

body.woocommerce-account:not(.logged-in) .woocommerce .lost_password a {
    font-size: 15px;
    color: #294266;
}

body.woocommerce-account:not(.logged-in) .woocommerce .lost_password a:hover {
    text-decoration: underline;
}
