/* ====================================================
   PRODUCT DETAIL PAGE — MODERN DESIGN
   ==================================================== */

.pd-page {
    background: #f8fafc;
    min-height: 100vh;
}

/* ---- Breadcrumb ---- */
.prd-breadcrumb {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 0;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.breadcrumb a:hover { color: #13618C; }
.breadcrumb-sep { flex-shrink: 0; }
.breadcrumb .current { color: #334155; font-weight: 600; }

/* ---- Container ---- */
.pd-container {
    padding: 28px 0 64px;
}

/* ---- Layout ---- */
.pd-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 40px;
}

/* ---- Card base ---- */
.pd-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ====================================================
   LEFT COLUMN
   ==================================================== */

.pd-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- Gallery ---- */
.pd-gallery-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    align-items: flex-start;
}

/* Meta panel beside image */
.pd-gallery-meta {
    flex-shrink: 0;
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid #f1f5f9;
    padding-left: 16px;
}

.pd-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* JS replaces pd-thumbs with .thumbnail elements — style both */
.pd-thumbs .thumbnail,
.gallery-thumbnails .thumbnail {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border: 1.5px solid #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    padding: 6px;
    background: #f8fafc;
    transition: border-color 0.15s, background 0.15s;
    display: block;
}
.pd-thumbs .thumbnail.active,
.gallery-thumbnails .thumbnail.active,
.pd-thumbs .thumbnail:hover,
.gallery-thumbnails .thumbnail:hover {
    border-color: #13618C;
    background: #fff;
}

.pd-main-img-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 300px;
    overflow: hidden;
}

.pd-main-img {
    max-width: 80%;
    max-height: 280px;
    object-fit: contain;
}

/* ---- Discount badge — corner tag ---- */
.discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to right, #288CCB, #49A644);
    color: #fff;
    padding: 5px 12px;
    border-radius: 10px 0 10px 0;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 0.2px;
}

/* ---- Tabs ---- */
.pd-tabs-card { overflow: visible; }

.pd-tabs-header {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    padding: 0 20px;
}

.tab-btn {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.tab-btn.active { color: #13618C; border-bottom-color: #13618C; }
.tab-btn:hover:not(.active) { color: #334155; }

.pd-tab-body { padding: 24px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.pd-spec-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pd-spec-list li {
    font-size: 13px;
    color: #475569;
    line-height: 1.65;
}

/* ====================================================
   RIGHT COLUMN
   ==================================================== */

.pd-right {
    position: sticky;
    top: 24px;
}

.pd-buy-card {
    display: flex;
    flex-direction: column;
    padding: 22px 20px 18px;
}

/* Title */
.pd-buy-card h1 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.55;
    margin: 0 0 16px;
}

/* Pricing */
.pd-pricing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.pd-prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.current-price {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}
.original-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.pd-price-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to right, #288CCB, #49A644);
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

/* Divider */
.pd-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 14px 0;
}

/* ── Variant / Size Options ── */
.pd-variants-section {
    margin: 12px 0 4px;
}
.pd-variant-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pd-variant-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pd-variant-unit-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 46px;
    flex-shrink: 0;
}
.pd-variant-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.pd-variant-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}
.pd-variant-pill:hover {
    border-color: #288CCB;
    color: #288CCB;
    background: #f0f9ff;
}
.pd-variant-pill.active {
    border-color: #288CCB;
    background: linear-gradient(135deg, #13618C 0%, #297B35 100%);
    color: #fff;
}
[data-theme="dark"] .pd-variant-pill {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: #94a3b8;
}
[data-theme="dark"] .pd-variant-pill:hover {
    border-color: #4BA8D4;
    color: #4BA8D4;
    background: rgba(75,168,212,0.08);
}
[data-theme="dark"] .pd-variant-pill.active {
    border-color: transparent;
    background: linear-gradient(135deg, #4BA8D4 0%, #4ade80 100%);
    color: #fff;
}

/* Color swatches */
.pd-color-pills { gap: 7px; }
.pd-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 6px;
}
.pd-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Meta sections */
.pd-meta-section { margin-bottom: 4px; }
.pd-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}
.pd-seller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pd-seller-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pd-shop-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-shop-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}
.pd-shop-logo-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #13618C, #297B35);
    letter-spacing: 0.5px;
}
.pd-seller-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.pd-view-store {
    font-size: 12px;
    font-weight: 600;
    color: #13618C;
    text-decoration: none;
    transition: color 0.15s;
}
.pd-view-store:hover { color: #297B35; }

/* ---- Premium Info Sections ---- */

/* Car Brand Badge */
.pd-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: default;
    position: relative;
}
.pd-brand-badge:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}
.pd-brand-badge::after {
    content: attr(data-brand);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 10;
}
.pd-brand-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.pd-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    flex-shrink: 0;
}

/* Country Made */
.pd-country-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.2s ease;
}
.pd-country-value:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}
.pd-country-flag {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Condition Badge */
.pd-condition-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
}
.pd-condition-badge svg { flex-shrink: 0; }
.pd-condition-new {
    background: linear-gradient(135deg, rgba(19, 97, 140, 0.1), rgba(41, 123, 53, 0.08));
    border: 1.5px solid rgba(19, 97, 140, 0.25);
    color: #13618C;
}
.pd-condition-new:hover {
    box-shadow: 0 2px 8px rgba(19, 97, 140, 0.15);
    border-color: rgba(19, 97, 140, 0.4);
}
.pd-condition-reconditioned {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(234, 179, 8, 0.06));
    border: 1.5px solid rgba(234, 179, 8, 0.3);
    color: #a16207;
}
.pd-condition-reconditioned:hover {
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.45);
}

/* Genuine Badge */
.pd-genuine-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 1.5px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #15803d;
    transition: all 0.2s ease;
}
.pd-genuine-badge:hover {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.35);
}
.pd-genuine-badge svg {
    fill: currentColor;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Tags Container */
.pd-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Individual Tag */
.pd-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 600;
    color: #13618C;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.pd-tag:hover {
    background: #fff;
    border-color: #13618C;
    box-shadow: 0 2px 6px rgba(19, 97, 140, 0.1);
}

/* Delivery */
.pd-delivery-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.pd-delivery-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pd-delivery-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}
.pd-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    flex-shrink: 0;
}
.pd-change {
    font-size: 12px;
    font-weight: 600;
    color: #13618C;
    text-decoration: none;
    flex-shrink: 0;
}
.pd-delivery-cost {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    flex-shrink: 0;
}

/* Expandables */
.pd-expandable {
    cursor: pointer;
    padding: 2px 0;
}
.pd-expand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
}
.pd-expand-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}
.pd-expand-chev {
    flex-shrink: 0;
    transition: transform 0.2s;
}
.pd-expandable.expanded .pd-expand-chev { transform: rotate(90deg); }

/* Quantity */
.pd-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.pd-qty-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.pd-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}
.pd-qty-ctrl button {
    width: 36px;
    height: 36px;
    font-size: 18px;
    font-weight: 400;
    color: #334155;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pd-qty-ctrl button:hover { background: #f1f5f9; }
.pd-qty-ctrl input {
    width: 44px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
}
.pd-qty-ctrl input::-webkit-outer-spin-button,
.pd-qty-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Action buttons */
.pd-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.btn-add-to-cart {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #13618C;
    background: rgba(19,97,140,0.08);
    border: 1.5px solid #13618C;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-add-to-cart:hover { background: rgba(19,97,140,0.14); }
.btn-add-to-cart:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-buy-now {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #13618C, #297B35);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-buy-now:hover { opacity: 0.9; }

/* Share */
.pd-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s;
}
.pd-share:hover { color: #64748b; }

/* ====================================================
   RELATED PRODUCTS
   ==================================================== */

.pd-related-section { margin-top: 8px; }

.pd-related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.pd-related-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.pd-view-all {
    font-size: 13px;
    font-weight: 600;
    color: #13618C;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.pd-view-all:hover { color: #297B35; }
.pd-view-all .arrow-right { height: 10px; }

.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}
.pd-rel-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.pd-rel-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.pd-rel-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pd-rel-img-wrap img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}
.pd-rel-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to right, #288CCB, #49A644);
    color: #fff;
    padding: 4px 9px;
    border-radius: 10px 0 10px 0;
    font-size: 10px;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 0.2px;
}
.pd-rel-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    border-top: 1px solid #f8fafc;
}
.pd-rel-info h3 {
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 28px;
}
.pd-rel-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
}
.pd-rel-original {
    font-size: 10px;
    color: #94a3b8;
    text-decoration: line-through;
}
.pd-rel-current {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}
.pd-rel-cart {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.pd-rel-cart img { width: 12px; height: 12px; object-fit: contain; }
.pd-rel-cart:hover {
    background: linear-gradient(135deg, #13618C, #297B35);
    border-color: transparent;
}
.pd-rel-cart:hover img { filter: brightness(0) invert(1); }

/* ====================================================
   RESPONSIVE
   ==================================================== */

@media (max-width: 1100px) {
    .pd-related-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 960px) {
    .pd-layout { grid-template-columns: 1fr 300px; }
}
@media (max-width: 768px) {
    .pd-container { padding: 16px 0 48px; }
    .pd-layout { grid-template-columns: 1fr; gap: 16px; }
    .pd-right { position: static; }
    .pd-gallery-card { flex-direction: column; }
    .pd-thumbs { flex-direction: row; flex-wrap: wrap; }
    .pd-main-img-wrap { min-height: 260px; width: 100%; }
    .pd-gallery-meta { width: 100%; border-left: none; border-top: 1px solid #f1f5f9; padding-left: 0; padding-top: 16px; flex-direction: row; flex-wrap: wrap; gap: 0; }
    .pd-gallery-meta .pd-meta-section { width: 50%; }
    .pd-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .pd-buy-card h1 { font-size: 14px; }
    .current-price { font-size: 18px; }
    .pd-gallery-meta .pd-meta-section { width: 100%; }
}
