.cc-life-dialog:not([open]),
.cc-life-dialog [hidden] {
    display: none !important;
}

.cc-life-launch {
    width: 100%;
    grid-column: 1 / -1;
}

.single-product:has(dialog.cc-life-dialog) .woocommerce-product-gallery .zoomImg {
    display: none !important;
}

.single-product:has(dialog.cc-life-dialog) .woocommerce-product-gallery__image img.wp-post-image {
    position: relative !important;
    z-index: 1;
    opacity: 1 !important;
    visibility: visible !important;
}

.cc-life-form.cc-product-customizer {
    display: flex;
    gap: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.cc-life-preview {
    justify-content: center;
    touch-action: pan-y;
}

.cc-life-preview-tools {
    display: none;
}

.cc-life-stage {
    position: relative;
    display: flex;
    height: min(660px, calc(100% - 38px));
    max-width: 100%;
    aspect-ratio: 2 / 5;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #dce4e0;
    background: #fff;
    box-shadow: 0 4px 22px rgb(30 41 37 / 12%);
    isolation: isolate;
    touch-action: pan-y;
}

.cc-life-stage:has(.cc-life-photo-layer:not([hidden])) {
    touch-action: none;
}

.cc-life-preview-empty {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(190px, calc(100% - 28px));
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #68716e;
    text-align: center;
}

.cc-life-preview-empty .dashicons {
    width: 32px;
    height: 32px;
    color: #2f7d71;
    font-size: 32px;
}

.cc-life-preview-empty strong {
    font-size: 13px;
    font-weight: 550;
}

.cc-life-photo-layer {
    --photo-x: 50%;
    --photo-y: 50%;
    --photo-scale: 1;
    position: absolute;
    z-index: 2;
    left: var(--photo-x);
    top: var(--photo-y);
    width: 70%;
    height: auto;
    transform: translate(-50%, -50%) scale(var(--photo-scale));
    transform-origin: center;
    border: 1px solid #2f7d71;
    cursor: move;
    outline: 0;
    touch-action: none;
    user-select: none;
}

.cc-life-photo-layer:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2f7d71;
}

.cc-life-photo-preview {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

.cc-life-photo-resize {
    position: absolute;
    z-index: 5;
    width: 13px;
    height: 13px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 2px;
    background: #2f7d71;
    box-shadow: 0 1px 3px rgb(30 41 37 / 22%);
    cursor: nwse-resize;
    touch-action: none;
}

.cc-life-photo-resize.is-top-left {
    top: -7px;
    left: -7px;
}

.cc-life-photo-resize.is-top-right {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.cc-life-photo-resize.is-bottom-left {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.cc-life-photo-resize.is-bottom-right {
    right: -7px;
    bottom: -7px;
}

.cc-life-crop-frame {
    position: absolute;
    z-index: 3;
    inset: 4.5% 9%;
    border: 1px dashed #7d8985;
    pointer-events: none;
}

.cc-life-crop-frame > span {
    position: absolute;
    inset: 2px;
    border: 1px solid rgb(255 255 255 / 82%);
}

.cc-life-crop-label {
    position: absolute;
    z-index: 4;
    top: calc(4.5% + 8px);
    left: 50%;
    padding: 3px 7px;
    transform: translateX(-50%);
    border-radius: 3px;
    background: rgb(255 255 255 / 92%);
    color: #59635f;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.cc-life-reset-photo {
    position: absolute;
    z-index: 6;
    right: 9px;
    top: 9px;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #dce4e0;
    border-radius: 4px;
    background: rgb(255 255 255 / 92%);
    color: #303735;
    box-shadow: 0 1px 4px rgb(30 41 37 / 10%);
    cursor: pointer;
}

.cc-life-reset-photo:hover {
    border-color: #2f7d71;
    background: #eff6f3;
    color: #2f7d71;
}

.cc-life-reset-photo .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 16px;
}

.cc-life-preview-file {
    position: fixed !important;
    inset: auto !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

.cc-life-preview-note {
    max-width: 430px;
    line-height: 1.45;
    text-align: center;
}

.cc-life-dialog fieldset > legend small {
    margin-left: 4px;
    color: #68716e;
    font-size: 12px;
    font-weight: 400;
}

.cc-life-controls > fieldset,
.cc-life-controls > section {
    margin: 0 0 18px;
    padding: 0 0 18px;
    border-bottom: 1px solid #dce4e0;
}

.cc-life-controls > :last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.cc-life-height select {
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 38px 0 12px;
    border: 1px solid #dce4e0;
    border-radius: 5px;
    background-color: #fff;
    color: #303735;
    box-shadow: none;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.cc-life-height select:focus,
.cc-life-contact input:focus,
.cc-life-notes textarea:focus {
    border-color: #2f7d71;
    outline: 0;
    box-shadow: 0 0 0 2px rgb(47 125 113 / 12%);
}

.cc-life-height > p,
.cc-life-upload > p {
    margin: 8px 0 0;
    color: #68716e;
    font-size: 11px;
    line-height: 1.45;
}

.cc-life-drop {
    min-height: 132px;
}

.cc-life-photo-name {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 9px;
    padding: 10px 12px;
    border: 1px solid #b9d7cf;
    border-radius: 5px;
    background: #eff6f3;
    color: #303735;
}

.cc-life-photo-name > .dashicons {
    color: #2f7d71;
}

.cc-life-photo-name span:last-child {
    display: grid;
    min-width: 0;
}

.cc-life-photo-name strong,
.cc-life-photo-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-life-photo-name strong {
    font-size: 13px;
    font-weight: 550;
}

.cc-life-photo-name small {
    color: #68716e;
    font-size: 11px;
}

.cc-life-contact h3 {
    margin-bottom: 4px;
}

.cc-life-contact > p {
    margin: 0 0 11px;
    color: #68716e;
    font-size: 11px;
    line-height: 1.45;
}

.cc-life-contact > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cc-life-contact label {
    display: grid;
    gap: 5px;
    color: #303735;
    font-size: 12px;
    font-weight: 500;
}

.cc-life-contact b {
    color: #b44335;
    font-weight: 500;
}

.cc-life-contact input {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #dce4e0;
    border-radius: 5px;
    background: #fff;
    color: #303735;
    box-shadow: none;
}

/* The production global form rule uses multiple :not() selectors and theme
   color variables that this theme does not define. Keep these two required
   controls visible independently of that higher-specificity global rule. */
.cc-life-dialog .cc-life-contact input[type="email"],
.cc-life-dialog .cc-life-contact input[type="tel"] {
    min-height: 44px;
    border: 1px solid #a8b5af !important;
    background-color: #f8faf9 !important;
    color: #303735 !important;
    -webkit-appearance: none;
    appearance: none;
}

.cc-life-dialog .cc-life-contact input:focus {
    border-color: #2f7d71 !important;
    box-shadow: 0 0 0 2px rgb(47 125 113 / 12%);
}

.cc-life-quantity > p,
.cc-life-notes > p {
    margin: 0 !important;
}

.cc-life-quantity legend,
.cc-life-notes legend {
    margin-bottom: 7px;
}

.cc-life-quantity label,
.cc-life-quantity > p > label {
    margin: 0;
}

.cc-life-notes textarea {
    display: block;
    width: 100%;
    min-height: 92px;
    margin: 0;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid #dce4e0;
    border-radius: 5px;
    background: #fff;
    color: #303735;
    box-shadow: none;
    font: inherit;
}

.cc-life-total {
    display: flex;
    align-items: baseline;
}

.single-product:has(.cc-life-dialog) .swp-product-summary form.cart > .quantity,
.single-product:has(.cc-life-dialog) .swp-product-summary form.cart > p:has(.single_add_to_cart_button) {
    display: none !important;
}

@media (max-width: 760px) {
    .cc-life-body {
        display: flex;
        flex-direction: column;
    }

    .cc-life-preview {
        min-height: 60dvh;
        flex: 0 0 60dvh;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid #dce4e0;
    }

    .cc-life-stage {
        height: calc(100% - 30px);
    }

    .cc-life-preview:has(.cc-life-preview-toggle:not([hidden])) .cc-life-stage {
        height: calc(100% - 76px);
    }

    .cc-life-preview-tools {
        display: flex;
        flex: 0 0 auto;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .cc-life-preview-toggle {
        min-height: 44px;
        padding: 8px 10px;
        border: 1px solid #a8b5af;
        border-radius: 5px;
        background: #fff;
        color: #2f7d71;
        font-size: 13px !important;
        font-weight: 550;
        cursor: pointer;
    }

    .cc-life-touch-zoom {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        flex: 0 0 auto;
    }

    .cc-life-touch-zoom button {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #a8b5af;
        border-radius: 5px;
        background: #fff;
        color: #2f7d71;
        font-size: 24px !important;
    }

    .cc-life-touch-zoom button:disabled { opacity: 0.4; }
    .cc-life-touch-zoom output { min-width: 42px; text-align: center; font-size: 12px; }

    .cc-life-crop-label {
        display: none;
    }

    .cc-life-dialog.is-preview-expanded .cc-life-controls,
    .cc-life-dialog.is-preview-expanded .cc-life-form > footer {
        display: none;
    }

    .cc-life-dialog.is-preview-expanded .cc-life-preview {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        border-bottom: 0;
    }

    .cc-life-controls {
        flex: 1;
        padding: 12px 16px;
    }

    .cc-life-dialog .cc-life-upload {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .cc-life-dialog .cc-life-upload > legend {
        margin-bottom: 6px;
        font-size: 15px;
    }

    .cc-life-dialog .cc-life-drop {
        display: flex;
        min-height: 44px;
        height: auto;
        padding: 8px 12px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 8px;
    }

    .cc-life-dialog .cc-life-drop .cc-yard-drop-icon {
        width: 20px;
        height: 20px;
        margin: 0;
        font-size: 20px;
    }

    .cc-life-dialog .cc-life-drop .cc-yard-drop-title { font-size: 14px; }
    .cc-life-dialog .cc-life-drop .cc-yard-drop-hint { font-size: 10px; }
    .cc-life-dialog .cc-life-photo-name { margin-top: 5px; padding: 5px 8px; }
    .cc-life-dialog .cc-life-upload > p { margin-top: 5px; font-size: 10px; }

    @media (max-height: 600px) {
        .cc-life-preview { min-height: 45dvh; flex-basis: 45dvh; }
    }

    .cc-life-preview-note {
        font-size: 10px !important;
    }

    .cc-life-contact > div {
        grid-template-columns: 1fr;
    }

    .cc-life-contact input {
        font-size: 16px;
    }
}
