/* ==========================================
   DATTS PRODUCT VARIANT MODAL
   ========================================== */

.datts-product-modal,
.datts-product-modal * {
    box-sizing: border-box;
}

.datts-product-modal {
    --datts-modal-bg: #171717;
    --datts-modal-bg-2: #111;
    --datts-border: rgba(255, 255, 255, 0.22);
    --datts-border-soft: rgba(255, 255, 255, 0.11);
    --datts-text: #f5f5f5;
    --datts-text-secondary: #a9a9a9;
    --datts-gold: #bc9453;
    --datts-gold-light: #f2ca88;
    --datts-gold-dark: #a3783e;

    position: fixed;
    inset: 0;
    z-index: 100000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    visibility: hidden;
    opacity: 0;

    transition:
        opacity .22s ease,
        visibility .22s ease;
}

.datts-product-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.datts-product-modal__overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Окно */

.datts-product-modal__dialog {
    position: relative;
    z-index: 1;

    width: min(780px, 100%);
    padding: 52px 76px 62px;

    overflow: hidden;

    color: var(--datts-text);

    background:
        radial-gradient(
            circle at 45% 0%,
            rgba(255, 255, 255, 0.045),
            transparent 42%
        ),
        linear-gradient(
            145deg,
            #1a1a1a 0%,
            #141414 52%,
            #101010 100%
        );

    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 24px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, .55),
        inset 0 1px 0 rgba(255, 255, 255, .035);

    transform: translateY(12px) scale(.985);

    transition: transform .22s ease;
}

.datts-product-modal.is-open .datts-product-modal__dialog {
    transform: translateY(0) scale(1);
}


/* Close */

.datts-product-modal__close {
    position: absolute;
    top: 27px;
    right: 28px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: #bdbdbd;
    background: transparent;
    border: 0;
    border-radius: 50%;

    cursor: pointer;

    transition:
        color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.datts-product-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    transform: rotate(90deg);
}

.datts-product-modal__close svg {
    width: 30px;
    height: 30px;
}

.datts-product-modal__close path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}


/* Product */

.datts-product-modal__product {
    display: flex;
    align-items: center;

    gap: 48px;

    margin-bottom: 40px;
}

.datts-product-modal__image {
    width: 130px;
    height: 130px;

    flex: 0 0 130px;

    overflow: hidden;

    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
}

.datts-product-modal__image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.datts-product-modal__product-info {
    min-width: 0;
}

.datts-product-modal__series {
    margin-bottom: 14px;

    color: var(--datts-gold);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.datts-product-modal__name {
    color: #f1f1f1;

    font-size: 29px;
    font-weight: 600;
    line-height: 1.2;
}


/* Body */

.datts-product-modal__body {
    padding-top: 36px;

    border-top: 1px solid var(--datts-border-soft);
}

.datts-product-modal__title {
    margin: 0 0 36px;

    color: #fafafa;

    font-size: 36px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.025em;
}


/* Controls */

.datts-product-modal__controls {
    display: grid;

    grid-template-columns:
        minmax(0, .95fr)
        1px
        minmax(0, 1.1fr);

    column-gap: 42px;

    align-items: end;

    margin-bottom: 44px;
}

.datts-product-modal__separator {
    width: 1px;
    height: 100px;

    align-self: end;

    background: rgba(255, 255, 255, .13);
}

.datts-product-modal__field {
    min-width: 0;
}

.datts-product-modal__label {
    display: block;

    margin-bottom: 14px;

    color: var(--datts-text-secondary);

    font-size: 21px;
    font-weight: 400;
    line-height: 1.25;
}


/* Quantity */

.datts-quantity {
    width: 248px;
    height: 68px;

    display: grid;
    grid-template-columns: 68px 1fr 68px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .055),
            rgba(255, 255, 255, .015)
        );
}

.datts-quantity__button {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: #fff;

    background: rgba(255, 255, 255, .055);
    border: 0;

    font: inherit;
    font-size: 31px;
    font-weight: 300;

    cursor: pointer;

    transition: background .15s ease;
}

.datts-quantity__button:first-child {
    border-right: 1px solid rgba(255, 255, 255, .12);
}

.datts-quantity__button:last-child {
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.datts-quantity__button:hover {
    background: rgba(255, 255, 255, .11);
}

.datts-quantity__input {
    width: 100%;
    min-width: 0;

    padding: 0;

    color: #fff;
    text-align: center;

    background: rgba(0, 0, 0, .15);
    border: 0;
    outline: 0;

    font: inherit;
    font-size: 27px;
    font-weight: 400;

    appearance: textfield;
    -moz-appearance: textfield;
}

.datts-quantity__input::-webkit-inner-spin-button,
.datts-quantity__input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}


/* Select */

.datts-select {
    position: relative;
}

.datts-product-modal #offer.datts-select__control {
    width: 100%;
    height: 68px;

    padding:
        0
        56px
        0
        24px;

    color: #eee;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .035),
            rgba(255, 255, 255, .012)
        ),
        #151515;

    border: 1px solid rgba(255, 255, 255, .23);
    border-radius: 14px;

    outline: none;

    font: inherit;
    font-size: 25px;
    font-weight: 400;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.datts-select__control:hover {
    border-color: rgba(255, 255, 255, .38);
}

.datts-select__control:focus {
    border-color: rgba(201, 157, 88, .8);

    box-shadow:
        0 0 0 3px rgba(201, 157, 88, .10);
}

.datts-select__arrow {
    position: absolute;

    top: 50%;
    right: 20px;

    width: 22px;
    height: 22px;

    pointer-events: none;

    transform: translateY(-50%);
}

.datts-select__arrow path {
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Add to cart */

.datts-product-modal__submit {
    position: relative;

    width: 100%;
    min-height: 84px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 26px;

    padding: 16px 30px;

    overflow: hidden;

    color: #0b0b0b;

    background:
        linear-gradient(
            100deg,
            #efc37f 0%,
            #ffd99a 43%,
            #cda25e 100%
        );

    border: 1px solid rgba(255, 218, 160, .75);
    border-radius: 15px;

    box-shadow:
        0 9px 25px rgba(190, 139, 70, .20),
        inset 0 1px 0 rgba(255, 255, 255, .45);

    font: inherit;
    font-size: 26px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform .18s ease,
        filter .18s ease,
        box-shadow .18s ease;
}

.datts-product-modal__submit::before {
    content: "";

    position: absolute;

    top: 0;
    left: -60%;

    width: 45%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, .24),
            transparent
        );

    transform: skewX(-18deg);

    transition: left .45s ease;
}

.datts-product-modal__submit:hover {
    filter: brightness(1.04);

    transform: translateY(-1px);

    box-shadow:
        0 12px 30px rgba(190, 139, 70, .27),
        inset 0 1px 0 rgba(255, 255, 255, .48);
}

.datts-product-modal__submit:hover::before {
    left: 120%;
}

.datts-product-modal__submit:active {
    transform: translateY(0);
}

.datts-product-modal__submit span,
.datts-product-modal__cart {
    position: relative;
    z-index: 1;
}

.datts-product-modal__cart {
    width: 35px;
    height: 35px;

    flex: 0 0 auto;
}

.datts-product-modal__cart path,
.datts-product-modal__cart circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 767px) {

    .datts-product-modal {
        padding: 16px;
    }

    .datts-product-modal__dialog {
        width: min(600px, 100%);

        padding: 42px 32px 36px;

        border-radius: 20px;
    }

    .datts-product-modal__close {
        top: 18px;
        right: 18px;
    }

    .datts-product-modal__product {
        gap: 24px;

        margin-bottom: 28px;

        padding-right: 35px;
    }

    .datts-product-modal__image {
        width: 94px;
        height: 94px;

        flex-basis: 94px;
    }

    .datts-product-modal__series {
        margin-bottom: 9px;

        font-size: 13px;
    }

    .datts-product-modal__name {
        font-size: 23px;
    }

    .datts-product-modal__body {
        padding-top: 27px;
    }

    .datts-product-modal__title {
        margin-bottom: 28px;

        font-size: 30px;
    }

    .datts-product-modal__controls {
        grid-template-columns: 1fr;

        gap: 26px;

        margin-bottom: 32px;
    }

    .datts-product-modal__separator {
        display: none;
    }

    .datts-quantity {
        width: 100%;
    }

    .datts-product-modal__submit {
        min-height: 72px;

        font-size: 22px;
    }
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 480px) {

    .datts-product-modal {
        align-items: flex-end;

        padding: 0;
    }

    .datts-product-modal__dialog {
        width: 100%;
        max-height: calc(100dvh - 24px);

        padding:
            28px
            20px
            calc(22px + env(safe-area-inset-bottom));

        overflow-y: auto;

        border-right: 0;
        border-bottom: 0;
        border-left: 0;

        border-radius: 22px 22px 0 0;
    }

    .datts-product-modal__close {
        top: 15px;
        right: 14px;

        width: 40px;
        height: 40px;
    }

    .datts-product-modal__product {
        gap: 17px;

        margin-bottom: 22px;
    }

    .datts-product-modal__image {
        width: 74px;
        height: 74px;

        flex-basis: 74px;

        border-radius: 10px;
    }

    .datts-product-modal__series {
        margin-bottom: 6px;

        font-size: 11px;
    }

    .datts-product-modal__name {
        font-size: 19px;
    }

    .datts-product-modal__body {
        padding-top: 22px;
    }

    .datts-product-modal__title {
        margin-bottom: 24px;

        font-size: 27px;
    }

    .datts-product-modal__controls {
        gap: 22px;

        margin-bottom: 27px;
    }

    .datts-product-modal__label {
        margin-bottom: 10px;

        font-size: 17px;
    }

    .datts-quantity,
    .datts-product-modal #offer.datts-select__control {
        height: 58px;
    }

    .datts-quantity {
        grid-template-columns: 58px 1fr 58px;
    }

    .datts-quantity__button {
        font-size: 25px;
    }

    .datts-quantity__input {
        font-size: 22px;
    }

    .datts-product-modal #offer.datts-select__control {
        padding-left: 18px;

        font-size: 20px;

        border-radius: 11px;
    }

    .datts-product-modal__submit {
        min-height: 62px;

        gap: 14px;

        border-radius: 12px;

        font-size: 19px;
    }

    .datts-product-modal__cart {
        width: 27px;
        height: 27px;
    }
}
/* Integration with the shared cart and short viewports. */
.datts-product-modal [hidden] { display: none !important; }
.datts-product-modal__dialog { max-height: calc(100dvh - 48px); overflow-y: auto; text-align: left; }
.datts-product-modal__name { overflow-wrap: anywhere; }
.datts-product-modal__controls--quantity-only { grid-template-columns: 1fr; }
.datts-product-modal .datts-quantity { max-width: 100%; }
.datts-product-modal__note { color: var(--datts-text-secondary); margin: -20px 0 24px; font-size: 14px; }
.datts-product-modal__note:empty { display: none; }
.datts-product-modal__error { color: #ffb4ab; margin-bottom: 20px; }
.datts-product-modal__submit:disabled { opacity: .65; cursor: wait; }
.datts-product-modal button:focus-visible, .datts-quantity:focus-within { outline: 2px solid var(--datts-gold-light); outline-offset: 3px; }
.datts-select__control option { background: #151515; color: #eee; }
@media (max-width: 480px) { .datts-product-modal__dialog { max-height: calc(100dvh - 24px); } }
@media (prefers-reduced-motion: reduce) { .datts-product-modal, .datts-product-modal * { transition: none !important; } }

.datts-product-modal__name, .datts-product-modal__title, .datts-product-modal__submit { font-family: montserrat-semibold, sans-serif; font-weight: 600; }
.datts-product-modal__image { position: relative; }
.datts-product-modal__image::before { content: 'DATTS'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--datts-gold); font-size: 12px; letter-spacing: .08em; }
.datts-product-modal__image img { position: relative; background: #0b0b0b; }
