/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT DETAIL MODAL v2.0 - Premium TradeFlow Design
   Based on ProductDetailModal JSON Specification
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ GLOBAL THEME TOKENS ═══ */
:root {
    --pdm-primary: #0F172A;
    --pdm-accent: #D97706;
    --pdm-success: #10B981;
    --pdm-text-main: #1E293B;
    --pdm-text-muted: #64748B;
    --pdm-bg-modal: #FFFFFF;
    --pdm-backdrop: rgba(15, 23, 42, 0.6);
    --pdm-border: #E2E8F0;
    --pdm-surface: #F8FAFC;
}

/* ═══ MODAL CONTAINER ═══ */
.pdm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: 99999;
    display: flex;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.pdm-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.pdm-backdrop {
    position: absolute;
    inset: 0;
    background: var(--pdm-backdrop);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pdm-panel {
    width: 1600px;
    max-width: 95vw;
    height: 100%;
    background: var(--pdm-bg-modal);
    border-radius: 20px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: none !important;
    overflow: hidden;
}

.pdm-panel img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.pdm-overlay.show .pdm-panel {
    z-index: 1;
}

/* Custom scrollbar for scroll area */
.pdm-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.pdm-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.pdm-scroll-area::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.pdm-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.pdm-scroll-area {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
    touch-action: pan-y !important;
    -webkit-user-select: none;
    padding-bottom: 20px;
    /* iOS Safari scroll fix - ensure scroll area is properly configured */
    position: relative;
    z-index: 1;
    /* Prevent any transform from blocking scroll */
    transform: none !important;
    will-change: scroll-position;
}

/* iOS Safari: force all children to allow vertical pan-scrolling */
.pdm-scroll-area .pdm-header,
.pdm-scroll-area .pdm-body,
.pdm-scroll-area .pdm-body > *,
.pdm-scroll-area .pdm-body * {
    /* NOTE: touch-action: pan-y set but transform removed - iOS Safari scroll fix */
    touch-action: pan-y !important;
}

/* ═══ HEADER SECTION ═══ */
.pdm-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #F1F5F9;
    background: white;
    z-index: 10;
}

@media (min-width: 768px) {
    .pdm-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        padding: 28px 32px;
    }
}

/* Close Button */
.pdm-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #F1F5F9;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50;
}

.pdm-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
    transform: rotate(90deg);
}

/* Product Identity */
.pdm-product-identity {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pdm-logo-box {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 16px;
    border: 1px solid var(--pdm-border);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdm-logo-box img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.pdm-logo-box i {
    font-size: 1.8rem;
    color: #64748B;
}

.pdm-text-group {
    flex: 1;
    min-width: 0;
}

.pdm-title {
    font-family: 'Inter', 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 4px 0;
    padding-right: 48px;
}

.pdm-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pdm-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pdm-subtitle-separator {
    color: #CBD5E1;
}

/* Badges */
.pdm-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pdm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

.pdm-badge.stock {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.pdm-badge.transit {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.pdm-badge.origin {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
    border-color: rgba(59, 130, 246, 0.2);
}

/* === REMAINING DAYS BADGE === */
.pdm-badge.remaining-days {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
    font-weight: 700;
    transition: all 0.3s ease;
}

.pdm-badge.remaining-days .days-counter {
    font-family: 'JetBrains Mono', 'Inter', monospace;
    font-weight: 800;
    font-size: 0.8rem;
}

.pdm-badge.remaining-days i {
    animation: hourglassSpin 2s ease-in-out infinite;
}

@keyframes hourglassSpin {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}

/* Normal: >7 days - Calm green */
.pdm-badge.remaining-days.normal {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Warning: 4-7 days - Orange with soft pulse */
.pdm-badge.remaining-days.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
    border-color: rgba(245, 158, 11, 0.3);
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }

    50% {
        box-shadow: 0 0 8px 2px rgba(245, 158, 11, 0.3);
    }
}

/* Urgent: ≤3 days - Red with strong pulse */
.pdm-badge.remaining-days.urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
    border-color: rgba(239, 68, 68, 0.4);
    animation: urgentPulse 1s ease-in-out infinite;
}

@keyframes urgentPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.4);
    }
}


/* Seller Card */
.pdm-seller-card {
    margin-top: 16px;
    padding: 16px;
    background: var(--pdm-surface);
    border-radius: 14px;
    border: 1px solid var(--pdm-border);
    min-width: 260px;
    position: relative;
    overflow: visible;
    touch-action: pan-y !important;
}

@media (min-width: 768px) {
    .pdm-seller-card {
        margin-top: 0;
        flex-shrink: 0;
    }
}

.pdm-seller-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94A3B8;
    margin-bottom: 6px;
}

.pdm-seller-name {
    font-weight: 700;
    color: #0F172A;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdm-verified-icon {
    color: #3B82F6;
    font-size: 0.9rem;
}

.pdm-trust-score {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #D97706;
}

/* Blur Overlay for Locked Seller */
.pdm-seller-blur {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    z-index: 5;
}

.pdm-lock-icon {
    font-size: 1.5rem;
    color: #94A3B8;
}

.pdm-lock-message {
    font-size: 0.8rem;
    color: #64748B;
    font-weight: 500;
}

.pdm-lock-cta {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pdm-lock-cta:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* ═══ BODY SECTION ═══ */
.pdm-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .pdm-body {
        grid-template-columns: 5fr 7fr;
        gap: 32px;
        padding: 32px;
        align-items: start;
    }

    /* Desktop Grid Placement Fix */
    .pdm-specs {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .pdm-commercial {
        grid-column: 1;
        grid-row: 1;
    }

    .pdm-logistics-block {
        grid-column: 1;
        grid-row: 2;
    }
}

/* Commercial Terms Column */
.pdm-commercial {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Price Block - Premium Edition */
.pdm-price-block {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(145deg, #FFFDF5 0%, #FFF8E7 30%, #FFEFC2 70%, #FFE4A0 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
    touch-action: pan-y !important;
    box-shadow:
        0 4px 20px rgba(217, 119, 6, 0.15),
        0 8px 40px rgba(217, 119, 6, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Horizontal Layout */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.pdm-price-block::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.pdm-price-block::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-30%) translateY(-30%) rotate(25deg);
    }

    100% {
        transform: translateX(30%) translateY(30%) rotate(25deg);
    }
}

/* Left Side Container */
.pdm-price-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.pdm-price-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #B45309;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdm-price-label::before {
    content: '💰';
    font-size: 0.8rem;
}

/* Price Row - Horizontal alignment */
.pdm-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pdm-price-value {
    font-family: 'Inter', 'Manrope', sans-serif;
    font-size: 2.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, #D97706 0%, #B45309 40%, #92400E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1;
    animation: priceGlow 2s ease-in-out infinite alternate;
}

@keyframes priceGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(217, 119, 6, 0.3));
    }

    100% {
        filter: drop-shadow(0 0 8px rgba(217, 119, 6, 0.5));
    }
}

.pdm-price-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #78350F;
    opacity: 0.85;
}

/* Right Side - Delivery Type */
.pdm-price-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    position: relative;
    z-index: 1;
    text-align: right;
}

.pdm-delivery-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #059669;
}

.pdm-delivery-value {
    font-family: 'Inter', 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #047857;
    letter-spacing: 0.02em;
}

/* Quantity Block */
.pdm-quantity-block {
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--pdm-surface);
    border: 1px solid var(--pdm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdm-qty-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pdm-qty-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94A3B8;
}

.pdm-qty-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0F172A;
}

/* Logistics Block - Now a standalone sibling element */
.pdm-logistics-block {
    padding: 16px;
    padding-left: 20px;
    border-left: 4px solid #3B82F6;
    background: var(--pdm-surface);
    border-radius: 14px;
    border: 1px solid var(--pdm-border);
    border-left: 4px solid #3B82F6;
}

.pdm-logistics-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1E40AF;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdm-logistics-title i {
    font-size: 0.9rem;
}

.pdm-logistics-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #E2E8F0;
}

.pdm-logistics-item:last-child {
    border-bottom: none;
}

.pdm-logistics-key {
    font-size: 0.8rem;
    color: var(--pdm-text-muted);
}

.pdm-logistics-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0F172A;
    text-align: right;
    max-width: 60%;
}

.pdm-logistics-quote {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563EB;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pdm-logistics-quote:hover {
    text-decoration: underline;
    color: #1D4ED8;
}

/* Technical Specs Column */
.pdm-specs {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--pdm-border);
    overflow: visible;
    touch-action: pan-y !important;
}

.pdm-specs-header {
    background: var(--pdm-surface);
    padding: 14px 20px;
    border-bottom: 1px solid var(--pdm-border);
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdm-specs-header i {
    color: var(--pdm-accent);
}

.pdm-specs-table {
    display: flex;
    flex-direction: column;
}

.pdm-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s;
}

.pdm-spec-row:last-child {
    border-bottom: none;
}

.pdm-spec-row:hover {
    background: rgba(248, 250, 252, 0.6);
}

.pdm-spec-key {
    font-size: 0.85rem;
    color: var(--pdm-text-muted);
}

.pdm-spec-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0F172A;
}

/* Image Gallery (for machines) */
.pdm-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
}

.pdm-gallery-main {
    grid-column: span 2;
    aspect-ratio: 16/9;
    border-radius: 12px;
    object-fit: cover;
    background: #F1F5F9;
    cursor: pointer;
    transition: transform 0.2s;
}

.pdm-gallery-main:hover {
    transform: scale(1.02);
}

.pdm-gallery-thumb {
    aspect-ratio: 16/9;
    border-radius: 8px;
    object-fit: cover;
    background: #F1F5F9;
    opacity: 0.85;
    cursor: pointer;
    transition: all 0.2s;
}

.pdm-gallery-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Notes Section */
.pdm-notes {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    border: 1px solid #FDE68A;
    border-radius: 14px;
    padding: 16px 20px;
}

.pdm-notes-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #92400E;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdm-notes-text {
    font-size: 0.9rem;
    color: #78350F;
    line-height: 1.6;
    font-style: italic;
}

.pdm-footer {
    flex: 0 0 auto;
    position: relative;
    background: #fff;
    border-top: 1px solid var(--pdm-border);
    padding: 15px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

@media (min-width: 768px) {
    .pdm-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 32px;
    }
}

/* Document Buttons */
.pdm-docs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    /* Force single row */
    overflow-x: auto;
    /* Fallback scroll */
    scrollbar-width: none;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    align-items: center;
    width: 100%;
    /* Ensure it takes full width */
}

.pdm-docs::-webkit-scrollbar {
    display: none;
}

/* COMPACT MODE: Active when >3 docs */
.pdm-docs.pdm-docs-compact {
    gap: 4px;
}

.pdm-doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #CBD5E1;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;

    /* Flex shrinking logic */
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    /* Sensible max width */
}

.pdm-docs.pdm-docs-compact .pdm-doc-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    gap: 4px;
    border-radius: 8px;
}

.pdm-doc-btn:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A;
}

.pdm-doc-btn i {
    font-size: 0.9rem;
    color: #64748B;
}

.pdm-doc-btn.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.pdm-doc-btn.locked i {
    color: #94A3B8;
}

/* Primary Actions */
.pdm-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

@media (min-width: 768px) {
    .pdm-actions {
        width: auto;
    }
}

.pdm-btn-secondary {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    border: 2px solid var(--pdm-accent);
    background: transparent;
    color: var(--pdm-accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .pdm-btn-secondary {
        flex: none;
        padding: 14px 28px;
    }
}

.pdm-btn-secondary:hover {
    background: rgba(217, 119, 6, 0.08);
}

.pdm-btn-primary {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--pdm-accent) 0%, #B45309 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

@media (min-width: 768px) {
    .pdm-btn-primary {
        flex: none;
        padding: 14px 32px;
    }
}

.pdm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
}

.pdm-btn-primary:active {
    transform: translateY(0);
}

/* ═══ LOGISTICS MODE - Wider Panel ═══ */
.pdm-panel.pdm-logistics-mode {
    max-width: 95vw;
}

/* ═══ LOGISTICS MAPS ROW - Side by side on desktop ═══ */
.pdm-logistics-maps-row {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    /* Logistics mode: Left = Price+Specs, Right = Maps stacked */
    .pdm-logistics-mode .pdm-commercial {
        grid-column: 1;
        grid-row: 1;
    }

    .pdm-logistics-mode .pdm-specs {
        grid-column: 1;
        grid-row: 2;
    }

    .pdm-logistics-mode .pdm-logistics-maps-row {
        grid-column: 2;
        grid-row: 1 / span 2;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .pdm-logistics-maps-row > .pdm-service-location-block,
    .pdm-logistics-maps-row > .pdm-route-visual-block {
        margin-top: 0;
        min-width: 0;
    }

    /* Logistics mode body: use full width proportionally */
    .pdm-logistics-mode .pdm-body {
        grid-template-columns: 5fr 7fr;
        gap: 24px;
    }
}

/* ═══ LISTING DATE ═══ */
.pdm-listing-date {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.75rem;
    color: #CBD5E1;
    padding-top: 12px;
}

/* ═══ RESPONSIVE ADJUSTMENTS ═══ */
@media (max-width: 768px) {
    .pdm-overlay {
        padding: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .pdm-panel {
        border-radius: 16px 16px 0 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .pdm-header {
        padding: 20px;
        overflow-x: hidden;
    }

    .pdm-logo-box {
        width: 56px;
        height: 56px;
        min-width: 56px;
        border-radius: 12px;
    }

    .pdm-title {
        font-size: 1.25rem;
    }

    .pdm-price-value {
        font-size: 1.75rem;
    }

    .pdm-price-block {
        overflow-x: hidden;
    }

    .pdm-body {
        padding: 20px;
        padding-bottom: 20px;
        gap: 20px;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Mobile section ordering - Fiyat > Maplar > Teknik Ozellik > Lojistik */
    .pdm-commercial {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex-shrink: 0;
        overflow-x: hidden;
    }

    .pdm-logistics-maps-row {
        order: 2;
        flex-shrink: 0;
        overflow-x: hidden;
    }

    .pdm-specs {
        order: 3;
        flex-shrink: 0;
        height: auto !important;
        min-height: fit-content;
        overflow: visible;
    }

    .pdm-logistics-block {
        order: 4;
        flex-shrink: 0;
        overflow-x: hidden;
    }

    .pdm-notes {
        order: 5;
        overflow-x: hidden;
        word-break: break-word;
    }

    .pdm-listing-date {
        order: 6;
    }

    .pdm-seller-card {
        overflow-x: hidden;
    }

    .pdm-spec-val,
    .pdm-logistics-val {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .pdm-footer {
        padding: 15px;
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
        border-radius: 0;
        z-index: 100;
    }
}

/* ═══ iOS SAFARI SCROLL FIX ═══ */
@supports (-webkit-touch-callout: none) {
    .pdm-overlay.show {
        touch-action: pan-y;
    }

    .pdm-panel {
        touch-action: pan-y;
        /* NOTE: transform removed - iOS Safari scroll fix */
    }

    .pdm-scroll-area {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto !important;
    }

    .pdm-scroll-area .pdm-body,
    .pdm-scroll-area .pdm-body > *,
    .pdm-scroll-area .pdm-body * {
        touch-action: pan-y !important;
        -webkit-user-drag: none;
    }

    .pdm-price-block::after {
        animation: none;
    }

    .pdm-body,
    .pdm-commercial,
    .pdm-logistics-block,
    .pdm-logistics-maps-row,
    .pdm-notes,
    .pdm-seller-card,
    .pdm-price-block,
    .pdm-quantity-block {
        overflow: visible !important;
    }
}

