/* ─────────────────────────────────────────────────────────
   TTO Licensing — Frontend CSS
   ───────────────────────────────────────────────────────── */

/* ── License button on photos ───────────────────────────── */
.tto-photo-wrap { position: relative; }

.tto-license-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(6,6,6,.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s, background .2s;
    z-index: 10;
    padding: 0;
    gap: 0;
}
.tto-license-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.tto-license-btn .tto-license-price {
    display: none;
}
.tto-photo-wrap:hover .tto-license-btn,
.tto-gal-item:hover .tto-license-btn {
    opacity: 1;
    transform: translateY(0);
}
.tto-license-btn:hover {
    background: var(--red, #E8152A);
    border-color: var(--red, #E8152A);
    border-radius: 18px;
    width: auto;
    padding: 0 10px 0 8px;
    gap: 5px;
}
.tto-license-btn:hover .tto-license-price {
    display: block;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.tto-license-btn.in-basket {
    opacity: 1;
    background: var(--red, #E8152A);
    border-color: var(--red, #E8152A);
    transform: translateY(0);
}

/* ── Floating basket ────────────────────────────────────── */
.tto-basket {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.tto-basket-trigger {
    width: 52px;
    height: 52px;
    background: var(--red, #E8152A);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(232,21,42,.4);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    flex-shrink: 0;
}
.tto-basket-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(232,21,42,.5);
}
.tto-basket-trigger svg { width: 22px; height: 22px; }
.tto-basket-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #fff;
    color: var(--red, #E8152A);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    display: none;
}
.tto-basket-trigger.has-items .tto-basket-count { display: flex; }

/* ── Basket panel ───────────────────────────────────────── */
.tto-basket-panel {
    width: 340px;
    background: #111;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    display: none;
    flex-direction: column;
}
.tto-basket-panel.open { display: flex; }

.tto-basket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.tto-basket-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
}
.tto-basket-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color .15s;
}
.tto-basket-close:hover { color: #fff; }

.tto-basket-items {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}
.tto-basket-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,.3);
}

.tto-basket-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    transition: background .15s;
}
.tto-basket-item:hover { background: rgba(255,255,255,.04); }
.tto-basket-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.tto-basket-item-info {
    flex: 1;
    min-width: 0;
}
.tto-basket-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tto-basket-item-price {
    font-size: 11px;
    color: var(--red, #E8152A);
    margin-top: 2px;
}
.tto-basket-item-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,.3);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color .15s;
    flex-shrink: 0;
}
.tto-basket-item-remove:hover { color: #fff; }

.tto-basket-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tto-basket-total {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,.5);
}
.tto-basket-total strong { color: #fff; }
.tto-basket-checkout-btn {
    width: 100%;
    padding: 12px;
    background: var(--red, #E8152A);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .2s;
}
.tto-basket-checkout-btn:hover { opacity: .88; }

/* ── Checkout modal ─────────────────────────────────────── */
.tto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.tto-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.tto-modal {
    background: #111;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    transform: translateY(12px);
    transition: transform .25s;
}
.tto-modal-overlay.open .tto-modal { transform: translateY(0); }

.tto-modal-head {
    padding: 24px 28px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.tto-modal-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.01em;
}
.tto-modal-head p {
    margin: 6px 0 0;
    font-size: 13px;
    color: rgba(255,255,255,.5);
}
.tto-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.tto-modal-close:hover { color: #fff; }

.tto-modal-body { padding: 24px 28px 28px; }

.tto-modal-photo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(255,255,255,.04);
    border-radius: 6px;
}
.tto-modal-photo-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
}

.tto-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.tto-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.tto-form-field label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
}
.tto-form-field label span { color: var(--red,#E8152A); }
.tto-form-field input,
.tto-form-field select,
.tto-form-field textarea {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    padding: 10px 14px;
    width: 100%;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}
.tto-form-field input::placeholder,
.tto-form-field textarea::placeholder { color: rgba(255,255,255,.25); }
.tto-form-field input:focus,
.tto-form-field select,
.tto-form-field textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,.3);
    background: rgba(255,255,255,.1);
}
.tto-form-field select option { background: #222; color: #fff; }
.tto-form-field textarea { resize: vertical; min-height: 90px; }

.tto-form-submit {
    width: 100%;
    padding: 14px;
    background: var(--red, #E8152A);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tto-form-submit:hover { opacity: .88; }
.tto-form-submit:disabled { opacity: .5; cursor: not-allowed; }

.tto-form-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}
.tto-form-success {
    text-align: center;
    padding: 32px 0;
}
.tto-form-success .tto-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.tto-form-success h4 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 8px;
}
.tto-form-success p {
    color: rgba(255,255,255,.5);
    font-size: 14px;
    margin: 0;
}

/* ── Right-click / drag protection ─────────────────────── */
.tto-protected {
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}
.tto-photo-wrap img,
.tto-gal-item img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

@media (max-width: 480px) {
    .tto-basket-panel { width: calc(100vw - 56px); }
    .tto-form-row { grid-template-columns: 1fr; }
}

/* ── Clear basket button ────────────────────────────────── */
.tto-basket-clear-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.3);
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 4px 0 0;
    transition: color .15s;
}
.tto-basket-clear-btn:hover { color: rgba(255,255,255,.6); }

/* ── Basket item project link ───────────────────────────── */
.tto-basket-item-project {
    font-size: 10px;
    color: rgba(255,255,255,.35);
    margin-top: 1px;
}
.tto-basket-item-project a {
    color: rgba(255,255,255,.4);
    text-decoration: none;
    transition: color .15s;
}
.tto-basket-item-project a:hover { color: #fff; }

/* ── Basket trigger bounce ──────────────────────────────── */
@keyframes tto-bounce {
    0%,100% { transform: scale(1); }
    40%      { transform: scale(1.18); }
    70%      { transform: scale(0.94); }
}
.tto-basket-trigger.tto-bounce { animation: tto-bounce .4s ease; }

/* ── Right-click toast ──────────────────────────────────── */
#tto-rcm {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(6,6,6,.92);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    border: 1px solid rgba(255,255,255,.12);
    white-space: nowrap;
}
#tto-rcm.visible { opacity: 1; }
#tto-rcm a { color: #E8152A; text-decoration: none; }

/* ── Order lookup page ──────────────────────────────────── */
.tto-lookup-wrap {
    max-width: 580px;
    margin: 0 auto;
    padding: 40px 0;
}
.tto-lookup-form h3 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
}
.tto-lookup-form p {
    color: #666;
    font-size: 14px;
    margin: 0 0 24px;
}
.tto-lf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.tto-lf-field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #888;
}
.tto-lf-field input {
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 15px;
    width: 100%;
}
.tto-lf-field input:focus { outline: none; border-color: #E8152A; box-shadow: 0 0 0 2px rgba(232,21,42,.12); }
.tto-l-btn {
    width: 100%;
    padding: 14px;
    background: #E8152A;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .2s;
}
.tto-l-btn:hover { opacity: .88; }
.tto-l-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Lookup result ──────────────────────────────────────── */
.tto-lr-header {
    margin-bottom: 28px;
}
.tto-lr-order {
    font-size: 28px;
    font-weight: 800;
    color: #E8152A;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.tto-lr-status {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.tto-lr-date { font-size: 13px; color: #999; }

.tto-lr-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 12px;
}
.tto-lr-photos { margin-bottom: 28px; }
.tto-lr-photo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tto-lr-photo img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.tto-lr-photo-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.tto-lr-photo-project { font-size: 11px; color: #888; margin-top: 2px; }
.tto-lr-photo-project a { color: #0073aa; text-decoration: none; }
.tto-lr-photo-price { font-size: 12px; font-weight: 700; color: #E8152A; margin-top: 3px; }

.tto-lr-history { margin-bottom: 24px; }
.tto-lr-hist-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    color: #555;
}
.tto-lr-hist-item span { color: #bbb; font-size: 12px; }

.tto-lr-back {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: border-color .15s;
}
.tto-lr-back:hover { border-color: #999; color: #1a1a1a; }
