/* =========================================================
   Share Cart – UI Styles
   ========================================================= */

/* ----- Design tokens ----- */
.share-cart-popup,
.share-cart-form {
    --sc-primary:        #75b51c;
    --sc-primary-dark:   #5a9012;
    --sc-border:         #d1d5db;
    --sc-bg:             #ffffff;
    --sc-bg-subtle:      #f9fafb;
    --sc-text:           #374151;
    --sc-text-muted:     #6b7280;
    --sc-error-color:    #dc2626;
    --sc-error-bg:       #fef2f2;
    --sc-error-border:   #fecaca;
    --sc-success-color:  #16a34a;
    --sc-success-bg:     #f0fdf4;
    --sc-success-border: #bbf7d0;
    --sc-radius:         8px;
    --sc-transition:     0.15s ease;
}

/* =========================================================
   Form container
   ========================================================= */
.share-cart-form {
    background: var(--sc-bg-subtle);
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.share-cart-form small {
    display: block;
    font-size: 11px;
    color: var(--sc-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.share-cart-form .field {
    margin-bottom: 14px;
}

/* ----- Inputs & textareas ----- */
.share-cart-form .input-text {
    background: var(--sc-bg);
    background-clip: padding-box;
    border: 1.5px solid var(--sc-border);
    border-radius: var(--sc-radius);
    font-family: inherit;
    font-size: 14px;
    height: 40px;
    line-height: 1.5;
    text-align: left;
    padding: 0 12px;
    vertical-align: baseline;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--sc-transition), box-shadow var(--sc-transition);
}

.share-cart-form .input-text:focus {
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3px rgba(117, 181, 28, 0.18);
    outline: none;
}

.share-cart-form textarea.input-text {
    height: 100px !important;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.5;
}

/* ----- Actions toolbar ----- */
.share-cart-form .actions-toolbar {
    text-align: center;
    margin-top: 16px;
}

.share-cart-form .actions-toolbar button {
    margin: 0 auto;
    min-width: 140px;
    transition: background-color var(--sc-transition), transform 0.1s ease;
}

/* =========================================================
   Modal / popup
   ========================================================= */
.share-cart-popup .content {
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
    padding: 0;
}

.share-cart-popup .top-actions {
    padding: 0;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
    list-style: none;
}

/* ----- Tab items ----- */
.share-cart-popup ul.top-actions li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 12px 16px;
    cursor: pointer;
    margin-right: 0;
    border-bottom: 2px solid transparent;
    color: var(--sc-text-muted);
    font-size: 14px;
    transition: color var(--sc-transition), border-color var(--sc-transition), background-color var(--sc-transition);
    user-select: none;
}

.share-cart-popup ul.top-actions li:hover {
    background-color: var(--sc-bg-subtle);
    color: var(--sc-primary);
    border-bottom-color: rgba(117, 181, 28, 0.4);
}

.share-cart-popup ul.top-actions li:last-child {
    margin-right: 0;
}

.share-cart-popup .top-actions .active {
    border-bottom: 2px solid var(--sc-primary);
    font-weight: 600;
    color: var(--sc-primary);
}

.share-cart-popup .top-actions .active span {
    background: transparent;
}

.share-cart-popup .top-actions li {
    position: relative;
}

.share-cart-popup .top-actions .icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Remove dead .seperator rules – element does not exist in HTML */

/* ----- Title ----- */
.share-cart-popup .title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    color: #111827;
}

/* ----- Fieldset ----- */
.share-cart-popup .fieldset {
    margin: 0 0 16px;
    border: none;
    padding: 0;
}

/* ----- Buttons set ----- */
.share-cart-popup .buttons-set {
    text-align: center;
}

.share-cart-popup .buttons-set button.button {
    float: inherit;
    margin-left: 0;
    min-width: 140px;
}

/* =========================================================
   Link-sharing UI
   ========================================================= */
input#link-to-share {
    background: var(--sc-bg-subtle);
    outline: none;
    border: 1.5px solid var(--sc-primary);
    border-radius: var(--sc-radius) var(--sc-radius) 0 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    transition: border-color var(--sc-transition);
}

input#link-to-share:focus,
input#link-to-share:hover {
    border-color: #3d99cc;
    background: var(--sc-bg);
    color: #1d4ed8;
}

button#copy-link-to-share {
    padding: 10px 15px;
    border-radius: 0 0 var(--sc-radius) var(--sc-radius);
    box-shadow: none;
    width: 100%;
    display: inline-block;
    transition: background-color var(--sc-transition);
}

/* =========================================================
   Result messages
   ========================================================= */
#share-cart-link-form .result {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    display: block;
    width: 100%;
    margin: 0 0 16px 0;
    text-align: center;
}

.share-cart-popup .result {
    margin: 0 0 16px 0;
    text-align: center;
}

.share-cart-popup .result .error {
    display: inline-block;
    color: var(--sc-error-color);
    font-weight: 600;
    background: var(--sc-error-bg);
    border: 1px solid var(--sc-error-border);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

.share-cart-popup .result .success {
    display: inline-block;
    color: var(--sc-success-color);
    font-weight: 600;
    background: var(--sc-success-bg);
    border: 1px solid var(--sc-success-border);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media screen and (max-width: 1024px) {
    .share-cart-popup {
        width: 70% !important;
    }
}

@media screen and (max-width: 600px) {
    .share-cart-popup ul.top-actions li {
        padding: 10px 8px;
        font-size: 13px;
        gap: 4px;
    }

    .share-cart-form {
        padding: 16px;
    }

    input#link-to-share {
        width: 100%;
        border-radius: var(--sc-radius);
        border: 1.5px solid var(--sc-primary) !important;
    }

    button#copy-link-to-share {
        margin-top: 8px;
        border-radius: var(--sc-radius) !important;
    }
}

@media screen and (max-width: 433px) {
    .share-cart-form .input-text {
        width: 100%;
    }

    .share-cart-popup {
        width: 90% !important;
    }
}

/* =========================================================
   Shared carts table (customer account)
   ========================================================= */
.shared-carts-table th {
    padding-left: 0;
    text-align: left !important;
}

.shared-carts-table td {
    text-align: left;
    padding: 12px 15px 12px 0 !important;
    font-family: inherit;
}

.shared-carts-table.clean-table {
    font-size: 13px;
    text-transform: uppercase;
    width: 100%;
}

.shared-carts-table.clean-table th {
    border-bottom: 2px solid #e5e7eb;
    color: var(--sc-text);
    letter-spacing: 0.5px;
}

.shared-carts-table.clean-table td {
    padding: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.shared-carts-table.clean-table thead th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

@media only screen and (max-width: 1199px) {
    .shared-carts-table.clean-table td {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media only screen and (max-width: 979px) {
    .shared-carts-table.clean-table td {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media only screen and (max-width: 767px) {
    .shared-carts-table thead {
        display: none;
    }

    .shared-carts-table,
    .shared-carts-table tbody,
    .shared-carts-table tr,
    .shared-carts-table td {
        display: block;
        width: 100%;
    }

    .shared-carts-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 8px 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

    .shared-carts-table td {
        display: flex;
        align-items: flex-start;
        padding: 8px 14px !important;
        border-bottom: 1px solid #f3f4f6;
        font-size: 13px;
        text-transform: none;
    }

    .shared-carts-table tr td:last-child {
        border-bottom: none;
    }

    .shared-carts-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #6b7280;
        min-width: 100px;
        flex-shrink: 0;
        padding-right: 8px;
    }
}

/* =========================================================
   Shared cart view modal (#openShareCartView)
   ========================================================= */
#openShareCartView a,
#openShareCartView button,
#openShareCartView .page-title,
#openShareCartView .cart-footer-actions {
    visibility: hidden;
}

#openShareCartView #block-shipping,
#openShareCartView .checkout.methods,
#openShareCartView .cart-discount,
#openShareCartView .cart-container table caption,
#openShareCartView .cart-container > .w-full,
#openShareCartView h2 {
    display: none;
}

#openShareCartView .product-item-photo,
#openShareCartView .product-item-name a {
    visibility: visible;
}

#openShareCartView .cart-totals-wrapper,
#openShareCartView .cart-table,
#openShareCartView .cart-container table,
#openShareCartView .cart-container form {
    width: 100% !important;
}

#openShareCartView .redchamps-popup {
    width: 60%;
}

.restore-shared-cart {
    padding: 14px 17px !important;
    width: 100%;
    visibility: visible !important;
}

.restore-shared-cart-notice {
    color: #dc2626;
    font-size: 13px;
    font-style: italic;
}
