/* =========================================
   Shipping Results Shortcode
   ========================================= */

.ysr-wrap {
    --ysr-green: #20A748;
    --ysr-green-dark: #178a3a;
    --ysr-yellow: #FBE418;
    --ysr-yellow-hover: #E5CD16;
    --ysr-text: #1F2937;
    --ysr-muted: #9CA3AF;
    --ysr-line: #E5E7EB;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
}

.ysr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.ysr-filter {
    position: relative;
}

.ysr-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px 8px 18px;
    border: 0;
    border-radius: 9999px;
    background: var(--ysr-yellow);
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(251, 228, 24, 0.35);
}

.ysr-filter-btn:hover,
.ysr-filter.is-open .ysr-filter-btn {
    background: var(--ysr-yellow-hover);
}

.ysr-filter-label {
    white-space: nowrap;
}

.ysr-filter-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.08);
    color: #111827;
}

.ysr-filter-chevron svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.ysr-filter.is-open .ysr-filter-chevron svg {
    transform: rotate(180deg);
}

.ysr-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    min-width: 100%;
    padding: 6px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: none;
}

.ysr-filter.is-open .ysr-filter-menu {
    display: block;
}

.ysr-filter-option {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #374151;
    text-align: left;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ysr-filter-option:hover,
.ysr-filter-option.is-selected {
    background: #F3F4F6;
    color: #111827;
}

.ysr-summary {
    display: none;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(32, 167, 72, 0.08);
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
}

.ysr-summary.is-visible {
    display: block;
}

.ysr-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ysr-card {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-right: 6px solid var(--ysr-green);
    position: relative;
}

.ysr-card.is-hidden {
    display: none;
}

.ysr-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 8px 12px;
}

.ysr-logo img {
    max-width: 120px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ysr-logo-fallback {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ysr-green);
    font-weight: 800;
    font-size: 18px;
}

.ysr-logo-fallback svg {
    width: 28px;
    height: 28px;
}

.ysr-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.ysr-meta-item {
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid var(--ysr-line);
}

.ysr-meta-item:last-child {
    border-right: 0;
    padding-right: 0;
}

.ysr-meta-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 6px;
    color: var(--ysr-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.ysr-meta-label svg {
    width: 14px;
    height: 14px;
    color: #D1D5DB;
}

.ysr-meta-value {
    margin: 0;
    color: var(--ysr-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.ysr-aside {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ysr-price {
    margin: 0;
    color: var(--ysr-green);
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.ysr-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 128px;
}

.ysr-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9999px;
    background: var(--ysr-green);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ysr-send-btn:hover {
    background: var(--ysr-green-dark);
    color: #ffffff;
    transform: translateY(-1px);
}

.ysr-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 12px;
    border: 0;
    border-radius: 9999px;
    background: #E5E7EB;
    color: #6B7280;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ysr-info-toggle:hover,
.ysr-card.is-info-open .ysr-info-toggle {
    background: #D1D5DB;
    color: #374151;
}

.ysr-info-panel {
    display: none;
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--ysr-line);
    color: #4B5563;
    font-size: 14px;
    line-height: 1.6;
}

.ysr-card.is-info-open .ysr-info-panel {
    display: block;
}

.ysr-empty {
    display: none;
    padding: 28px 20px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    color: #6B7280;
    text-align: center;
    font-size: 15px;
}

.ysr-empty.is-visible {
    display: block;
}

.ysr-waiting {
    display: none;
    padding: 28px 20px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    color: #6B7280;
    text-align: center;
    font-size: 15px;
}

.ysr-wrap.is-waiting .ysr-waiting {
    display: block;
}

.ysr-wrap.is-waiting .ysr-list,
.ysr-wrap.is-waiting .ysr-empty {
    display: none !important;
}

.ysr-status {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(32, 167, 72, 0.08);
    color: #178a3a;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.ysr-wrap.is-loading .ysr-list {
    opacity: 0.5;
    pointer-events: none;
}

.ysr-card.is-disabled {
    opacity: 0.72;
}

.ysr-card.is-disabled .ysr-send-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.ysr-info-panel ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.ysr-info-panel a {
    color: #178a3a;
}

/* App download modal */
.ysr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ysr-modal[hidden] {
    display: none !important;
}

.ysr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.ysr-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 40px 36px 36px;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    text-align: center;
    outline: none;
}

.ysr-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9999px;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ysr-modal-close:hover {
    background: #E5E7EB;
    color: #111827;
}

.ysr-modal-close svg {
    width: 18px;
    height: 18px;
}

.ysr-modal-title {
    margin: 0 0 12px;
    color: #111827;
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.45;
}

.ysr-modal-title span {
    color: #20A748;
}

.ysr-modal-desc {
    margin: 0 auto 24px;
    max-width: 360px;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.ysr-modal-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    width: 220px;
    height: 220px;
    padding: 12px;
    border-radius: 16px;
    background: #ffffff;
}

.ysr-modal-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ysr-modal-cta {
    margin: 0;
    color: #20A748;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

body.ysr-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .ysr-modal-dialog {
        padding: 32px 20px 28px;
        border-radius: 22px;
    }

    .ysr-modal-qr {
        width: 180px;
        height: 180px;
    }

    .ysr-modal-desc,
    .ysr-modal-cta {
        font-size: 14px;
    }
}

@media (max-width: 900px) {
    .ysr-card {
        grid-template-columns: 1fr;
        border-right: 0;
        border-bottom: 6px solid var(--ysr-green);
        gap: 14px;
    }

    .ysr-logo {
        justify-content: flex-start;
        min-height: auto;
        padding: 0;
    }

    .ysr-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ysr-meta-item {
        border-right: 0;
        padding-right: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--ysr-line);
    }

    .ysr-meta-item:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .ysr-aside {
        justify-content: space-between;
        width: 100%;
    }

    .ysr-actions {
        min-width: 120px;
    }
}

@media (max-width: 640px) {
    .ysr-filters {
        gap: 8px;
    }

    .ysr-filter-btn {
        font-size: 13px;
        min-height: 40px;
        padding: 8px 8px 8px 14px;
    }

    .ysr-aside {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .ysr-price {
        text-align: left;
    }

    .ysr-actions {
        width: 100%;
    }
}
