/*
 * Shop styles: customer authentication, address forms and the Carrier cart.
 * All selectors are prefixed with "shop-" so they never collide with the
 * legacy bundle.css rules.
 */

.shop-bar {
    background: #002d4c;
    color: #fff;
    font-size: 14px;
}

.shop-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-bar a,
.shop-bar .shop-link {
    color: #fff;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.shop-bar a:hover,
.shop-bar .shop-link:hover {
    text-decoration: underline;
}

.shop-user {
    opacity: 0.85;
}

.shop-inline-form {
    display: inline;
    margin: 0;
}

.shop-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.shop-cart-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #c8102e;
    color: #fff;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
}

.shop-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 0 30px;
}

.shop-page h2 {
    color: #859ab4;
    font-size: 22px;
}

.shop-form,
.shop-page form {
    margin: 0;
}

.shop-fieldset {
    border: 1px solid #d7dde5;
    border-radius: 6px;
    padding: 12px 16px 16px;
    margin: 0 0 18px;
}

.shop-fieldset legend {
    font-weight: bold;
    color: #002d4c;
    padding: 0 6px;
}

.shop-field {
    margin: 0 0 12px;
}

.shop-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.shop-field input[type="text"],
.shop-field input[type="email"],
.shop-field input[type="password"],
.shop-field input[type="tel"],
.shop-field input[type="number"],
.shop-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #b9c3cf;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.shop-checkbox {
    margin: 0 0 12px;
}

.shop-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    color: #333;
}

.shop-hint {
    display: block;
    color: #6b7785;
    font-size: 12px;
    margin-top: 4px;
}

.shop-submit {
    display: inline-block;
    background: #002d4c;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 10px 22px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

.shop-submit:hover {
    background: #01406b;
}

.shop-submit[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-secondary {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #002d4c;
    border-radius: 4px;
    color: #002d4c;
    text-decoration: none;
}

.shop-errors {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #842029;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 0 0 16px;
}

.shop-errors ul {
    margin: 0;
    padding-left: 18px;
}

.shop-status {
    background: #e7f4ea;
    border: 1px solid #b7dfc0;
    color: #1e5b2c;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 0 0 16px;
}

.shop-social {
    margin: 0 0 18px;
}

.shop-social-btn {
    display: inline-block;
    margin: 0 8px 8px 0;
    padding: 8px 16px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.shop-social-google { background: #db4437; }
.shop-social-microsoft { background: #0078d4; }
.shop-social-facebook { background: #1877f2; }

.shop-alt {
    margin: 0 0 18px;
}

.shop-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 18px;
}

.shop-cart-table th,
.shop-cart-table td {
    border-bottom: 1px solid #e2e7ee;
    padding: 10px 8px;
    text-align: left;
    vertical-align: middle;
}

.shop-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-cart-item img {
    border-radius: 4px;
    object-fit: cover;
}

.shop-qty-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-qty-form input[type="number"] {
    width: 64px;
    padding: 4px 6px;
}

.shop-remove {
    background: none;
    border: 0;
    color: #c8102e;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.shop-cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.shop-checkout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.shop-summary {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.shop-summary li {
    padding: 6px 0;
    border-bottom: 1px solid #e2e7ee;
}

.shop-total {
    font-size: 18px;
    font-weight: bold;
    color: #002d4c;
}

.add-to-carrier-form {
    margin: 0 0 8px;
}

.add-to-carrier {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #002d4c;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

.add-to-carrier:hover {
    background: #01406b;
}

.add-to-carrier img {
    display: block;
}

/* Cat status colours: AVAILABLE green, hold yellow, RESERVED red. */
.status-available { color: #1a7f37; font-size: 24px; font-weight: bold; }
.status-hold { color: #d4a017; font-size: 20px; font-weight: bold; }
.status-reserved { color: #c8102e; font-size: 20px; font-weight: bold; }
.cat-status { font-size: 18px; }

/* Required-field marker. */
.req { color: #c8102e; font-weight: bold; }

/* Password field with the show/hide eye and the live rules. */
.shop-password-wrap { position: relative; }
.shop-password-wrap input { padding-right: 44px; }
.shop-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: #eef2f7;
    border: 1px solid #b9c3cf;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    color: #002d4c;
    z-index: 2;
}
.shop-eye svg { display: block; }
.shop-eye.is-visible { color: #1a7f37; }
@media (prefers-color-scheme: dark) {
    .shop-eye { color: #e8eef5; background: #1b2430; border-color: #3a4757; }
}

/* PlaceKit: hide the clear button and the "powered by" attribution. */
.pka-clear,
.pka-attribution,
.pka-footer,
[class*="powered"] {
    display: none !important;
}

/* PlaceKit search field with the GPS crosshair. */
.shop-placekit-wrap { position: relative; margin: 0 0 12px; }
.shop-placekit-wrap .pka-input {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px 8px 40px !important;
    border: 1px solid #b9c3cf;
    border-radius: 4px;
    font-size: 15px;
}
.shop-gps {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: #666;
}
.shop-gps svg { display: block; }
.shop-pw-rules { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.shop-pw-rules li { color: #6b7785; }
.shop-pw-rules li.ok { color: #1a7f37; }
.shop-pw-rules li.bad { color: #c8102e; }

/* Phone field with the country prefix. */
.shop-phone-wrap { display: flex; align-items: stretch; }
.shop-phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: #eef2f7;
    border: 1px solid #b9c3cf;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    font-weight: bold;
    cursor: default;
    user-select: none;
}
.shop-phone-prefix.editing { background: #fff; outline: 2px solid #002d4c; }
.shop-phone-wrap input { border-radius: 0 4px 4px 0; }
.shop-phone-warning { color: #c8102e; }

/* PlaceKit dropdown must sit above the form headings. */
[class*="placekit"],
[class*="pka-"] {
    z-index: 10000 !important;
}

/* Invert the logo on dark themes so it stays visible. */
@media (prefers-color-scheme: dark) {
    #logo a,
    .site-logo {
        filter: invert(1) brightness(2);
    }
}
html.dark #logo a,
html.dark .site-logo,
[data-theme="dark"] #logo a,
[data-theme="dark"] .site-logo {
    filter: invert(1) brightness(2);
}

/* Dark-theme readability for the shop forms. */
@media (prefers-color-scheme: dark) {
    .shop-page h2,
    .shop-page h3,
    .shop-fieldset legend,
    .shop-field label,
    .shop-checkbox label,
    .shop-alt,
    .shop-social p,
    .shop-hint {
        color: #e8eef5 !important;
    }
    .shop-field input[type="text"],
    .shop-field input[type="email"],
    .shop-field input[type="password"],
    .shop-field input[type="tel"],
    .shop-field input[type="number"],
    .shop-field select {
        background: #1b2430;
        color: #e8eef5;
        border-color: #3a4757;
    }
    .shop-fieldset { border-color: #3a4757; }
    .shop-phone-prefix { background: #1b2430; color: #e8eef5; border-color: #3a4757; }
}

/* Email verification banner. */
.shop-verify { color: #ffd166; font-size: 13px; }

/* Add-to-Carrier AJAX states. */
.add-to-carrier.is-loading { opacity: 0.7; }
.add-to-carrier.is-added { background: #8a97a6; cursor: default; }
.proceed-to-carrier {
    display: inline-block;
    margin: 0 0 8px 8px;
    padding: 6px 12px;
    background: #1a7f37;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

/* Account tabs. */
.shop-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.shop-tab {
    padding: 8px 16px;
    border: 1px solid #002d4c;
    border-radius: 4px;
    color: #002d4c;
    text-decoration: none;
}
.shop-tab.active { background: #002d4c; color: #fff; }

/* Shipping options. */
.shop-shipping { margin: 12px 0; }
.shop-shipping label { display: block; margin: 6px 0; }
.shop-shipping .shop-shipping-price { font-weight: bold; }

/* Big Add to Carrier button on the cat detail page. */
.add-to-carrier-big-form { margin: 10px 0 16px; }
.add-to-carrier-big {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #002d4c;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}
.add-to-carrier-big:hover { background: #01406b; }
.add-to-carrier-big img { display: block; width: 120px; height: 100px; object-fit: contain; }

@media (max-width: 640px) {
    .shop-grid,
    .shop-checkout-grid {
        grid-template-columns: 1fr;
    }
}
