@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --premium-slate: #0f172a;
    --premium-gray: #64748b;
    --premium-green: var(--ali-red, #166534);
    --premium-accent: var(--ali-red, #016938);
    --semantic-green: #166534;
    --premium-amber: #ffb400;
    --border-light: #e2e8f0;
    --bg-page: #f8fafc;
    --font-outfit: 'Outfit', sans-serif;
}

/* Master Container */
.pdp-master-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: var(--font-outfit);
    background: #fff;
    min-height: 80vh;
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .pdp-master-container {
        padding: 0 16px 100px 16px;
        margin: 0;
        width: 100%;
    }
}

.pdp-master-container * {
    box-sizing: border-box;
}

.pdp-master-container a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* 1. TOP SECTION: Main Grid */
.pdp-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 50% 50% */
    gap: 30px;
    align-items: start;
    margin-bottom: 40px;
}

@media (max-width: 991px) {
    .pdp-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .premium-gallery-box {
        position: relative !important;
        top: 0 !important;
    }
}

/* Gallery Section */
.premium-gallery-box {
    position: sticky;
    top: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    z-index: 10;
}

@media (max-width: 600px) {
    .premium-gallery-box {
        flex-direction: column-reverse;
    }

    .thumb-nav-strip {
        flex-direction: row !important;
        width: 100% !important;
        overflow-x: auto !important;
    }
}

.thumb-nav-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 70px;
    flex-shrink: 0;
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: none;
}

.thumb-nav-strip::-webkit-scrollbar {
    display: none;
}

.side-thumb {
    width: 70px;
    height: 70px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    padding: 3px;
    background: #fff;
}

.side-thumb:hover,
.side-thumb.active {
    border-color: var(--premium-accent);
    transform: scale(0.95);
}

.side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.canvas-box {
    flex: 1;
    aspect-ratio: 1/1;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.canvas-box img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.canvas-box:hover img {
    transform: scale(1.05);
}

/* Badges - Adjusted positioning */
.pdp-badges-group {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
}

.badge-pdp {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.b-flash {
    background: #ef4444;
}

/* Red for Flash */
.b-sale {
    background: #f97316;
}

/* Orange for Sale % */
.b-new {
    background: #3b82f6;
}

/* Blue for New */
.b-choice {
    background: #10b981;
}

/* Green for Choice */

/* Note: Removed .badge-sale-teardrop as we are moving to stacked badges */
.badge-sale-teardrop {
    display: none;
}

/* Main Info Side */
.pdp-content-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pdp-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--premium-slate);
    line-height: 1.3;
    margin: 0;
}

@media (max-width: 768px) {
    .pdp-main-title {
        font-size: 1.1rem;
    }
}

.brand-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--premium-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pdp-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--premium-gray);
}

.status-in {
    color: var(--semantic-green);
    font-weight: 600;
}

.status-out {
    color: #dc2626;
    font-weight: 600;
}

.price-cluster {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-now {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--premium-accent);
}

@media (max-width: 768px) {
    .price-now {
        font-size: 1.4rem;
    }
}

.price-was {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

/* Action Box */
.action-box {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

@media (max-width: 500px) {
    .action-box {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px 12px;
        border: none;
        background: none;
        box-shadow: none;
        width: auto;
        margin: 0 25px 0 0;
        /* Align left (0), keep right spacing (15px) */
    }
}

.qty-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    height: 42px;
}

.qty-wrap button {
    width: 30px;
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--premium-slate);
}

.qty-wrap input {
    width: 100%;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--premium-slate);
    outline: none;
}

.btn-act {
    height: 42px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-cart {
    background: var(--premium-amber);
    color: #000;
}

.btn-cart:hover {
    background: #eab308;
}

.btn-buy {
    background: var(--premium-green);
    color: #fff;
}

.btn-buy:hover {
    background: var(--ali-red-dark);
}

.btn-wa {
    background: var(--ali-red);
    color: #fff;
    grid-column: 1 / -1;
}

.btn-bargain {
    background: #fff;
    border: 1px solid var(--premium-accent);
    color: var(--premium-accent);
    grid-column: 1 / -1;
}

.btn-bargain:hover {
    background: #f0fdf4;
}

/* Trust Badges - Compact */
.trust-row {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.trust-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    background: #fff;
}

.trust-item i {
    color: var(--premium-accent);
    font-size: 1.2rem;
}

.trust-item div {
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--premium-slate);
    font-weight: 600;
}

/* 2. MIDDLE SECTION: Tabs (Description & Details) - Compact */
.pdp-tabs-section {
    margin-bottom: 40px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.pdp-tab-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
}

.pdp-tab-btn {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 700;
    color: var(--premium-gray);
    transition: 0.2s;
    font-size: 0.95rem;
    border-right: 1px solid var(--border-light);
    background: none;
    border-top: none;
    border-left: none;
    border-bottom: none;
}

.pdp-tab-btn:last-child {
    border-right: none;
}

.pdp-tab-btn:hover {
    background: #f1f5f9;
    color: var(--premium-slate);
}

.pdp-tab-btn.active {
    background: #fff;
    color: var(--premium-accent);
    border-bottom: 2px solid var(--premium-accent);
}

@media (max-width: 768px) {
    .pdp-tab-btn {
        padding: 10px 5px;
        font-size: 0.75rem;
        /* Smaller font for mobile */
    }
}

.pdp-tab-content {
    display: none;
    padding: 25px;
    line-height: 1.6;
    color: var(--premium-slate);
    font-size: 0.95rem;
}

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

/* 3. BOTTOM SECTION: Related Products - Compact */
.related-section {
    margin-bottom: 40px;
}

.sec-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--premium-slate);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

@media (max-width: 480px) {
    .compact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        /* Tighter grid */
    }
}

/* ... existing styles ... */

@media (max-width: 768px) {
    .pdp-master-container {
        box-sizing: border-box;
    }

    .bundle-card,
    .pdp-tabs-section,
    .related-section {
        padding-right: 5px;
        margin-top: 15px;
        margin-right: 25px;
        /* Match Magic Bundle gap for alignment */
        width: auto;
    }

    .bundle-card {
        padding: 5px;
    }
}

.prod-card-compact {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.2s;
    position: relative;
}

.prod-card-compact:hover {
    border-color: var(--premium-accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.pc-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    padding: 10px;
    background: #fff;
}

.pc-info {
    padding: 10px;
}

.pc-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--premium-slate);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.pc-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--premium-slate);
}

.pc-old {
    font-size: 0.75rem;
    color: var(--premium-gray);
    text-decoration: line-through;
    margin-left: 5px;
}

.pc-btn {
    width: 100%;
    border: none;
    background: #f1f5f9;
    color: var(--premium-slate);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.prod-card-compact:hover .pc-btn {
    background: var(--premium-accent);
    color: #fff;
}

/* Utils */
.d-none {
    display: none !important;
}

/* Interactive Bundle Styles */
.bundle-card {
    margin-top: 20px;
    padding: 15px;
    background: #f0fdf4;
    border: 1px dashed var(--premium-green);
    border-radius: 10px;
}

.bundle-head {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--premium-green);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.bundle-ui {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.b-static-prod {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.b-static-prod img {
    width: 60px;
    height: 60px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.b-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--premium-slate);
    margin-top: 4px;
}

.b-plus {
    color: #94a3b8;
    font-size: 1.2rem;
}

.b-partners-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px;
}

.b-partner-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
    background: #fff;
    flex-shrink: 0;
}

.b-partner-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.b-partner-item:hover {
    opacity: 0.8;
}

.b-partner-item.active {
    border-color: var(--premium-green);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.b-check {
    position: absolute;
    top: -6px;
    right: -6px;
    color: var(--premium-green);
    background: #fff;
    border-radius: 50%;
    font-size: 1rem;
    display: none;
    line-height: 1;
}

.b-partner-item.active .b-check {
    display: block;
}

.bundle-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #cbd5e1;
    padding-top: 12px;
}

.b-price-info {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--premium-slate);
}

.b-save-tag {
    background: #22c55e;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 6px;
}

.btn-sm-bundle {
    padding: 8px 16px;
    background: var(--premium-green);
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-sm-bundle:hover {
    background: #15803d;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .bundle-card {
        padding: 10px;
        margin-top: 15px;
        margin-right: 25px;
        /* Increased right gap */
        /* Prevent touching edge */
        width: auto;
    }

    .bundle-head {
        font-size: 0.75rem;
        /* Smaller text */
        margin-bottom: 8px;
    }

    .bundle-ui {
        gap: 6px;
        margin-bottom: 8px;
    }

    .b-static-prod {
        width: 45px;
    }

    .b-static-prod img {
        width: 40px;
        height: 40px;
    }

    .b-partner-item {
        width: 40px;
        /* Smaller items */
        height: 40px;
    }

    .b-label {
        font-size: 0.6rem;
    }

    .bundle-action-row {
        padding-top: 10px;
    }

    .b-price-info {
        font-size: 0.85rem;
    }

    .btn-sm-bundle {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Bargain Modal - Original Nexora Design */
.bargain-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.bargain-box {
    background: #fff;
    width: 90%;
    max-width: 380px;
    /* Smaller width */
    padding: 20px;
    /* Reduced padding */
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: pdpPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pdpPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lang-switch-box {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 50px;
    margin-bottom: 12px;
    /* Reduced margin */
}

.lang-pill {
    padding: 4px 15px;
    /* Smaller pills */
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    color: #475569;
}

.lang-pill.active {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bargain-box-header h2 {
    font-size: 1.2rem;
    /* Reduced font size */
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.bargain-box-header p {
    font-size: 0.8rem;
    /* Smaller text */
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 15px;
}

.current-price-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #f0fdf4;
    color: #166534;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 15px;
    /* Reduced margin */
}

.bargain-input-wrap {
    margin-bottom: 15px;
    /* Reduced margin */
}

.bargain-input-main {
    width: 100%;
    height: 55px;
    /* Reduced height */
    text-align: center;
    font-size: 1.5rem;
    /* Smaller font */
    font-weight: 800;
    border: 2px solid #fbbf24;
    border-radius: 15px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: 0.2s;
}

.bargain-input-main:focus {
    background: #fff;
    box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.2);
}

.bargain-actions-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 15px;
}

.btn-bargain-back {
    height: 40px;
    /* Even shorter */
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-bargain-send {
    height: 40px;
    /* Even shorter */
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.2);
    transition: 0.2s;
}

.btn-bargain-send:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-bargain-back:hover {
    background: #e2e8f0;
}

/* Sticky Bottom Bar for Mobile PDP - Floating Premium Version */
.mobile-pdp-sticky-bar {
    display: none;
    position: fixed;
    bottom: 15px;
    /* Floats slightly from bottom */
    left: 15px;
    right: 15px;
    width: auto;
    /* Allow it to be centered with margins */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    padding: 10px;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .mobile-pdp-sticky-bar {
        display: flex;
    }

    .pdp-master-container {
        padding-bottom: 100px;
    }
}

.sticky-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    cursor: pointer;
}

.sticky-cart {
    background: white;
    color: var(--premium-accent);
    border: 1.5px solid var(--premium-accent);
}

.sticky-buy {
    background: var(--premium-accent);
    color: #fff;
    flex: 1.2;
}