/* ===============================
   PRODUCT DETAILS PAGE Redesign
   Modern Premium UI (Apple-inspired)
================================= */

#itemdetails-page {
    background-color: var(--background);
    min-height: 100vh;
    padding-bottom: 140px;
    /* Space for the fixed bottom nav + button */
    position: relative;
}

/* TOP BAR */
.pd-top-bar {
    position: fixed;
    top: 60px;
    /* Below top nav */
    left: 0;
    width: 100%;
    padding: 15px 20px;
    z-index: 90;
    pointer-events: none;
}

.pd-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transition: all 0.3s ease;
}

.pd-back-btn:hover {
    transform: translateX(-4px);
    background: white;
}

/* HERO SECTION (Image) */
.pd-hero-section {
    width: 100%;
    background-color: white;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pd-image-container {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pd-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#itemdetails-page:hover .pd-image-container img {
    transform: scale(1.05);
}

/* CONTENT WRAPPER */
.pd-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.pd-info-header {
    margin-bottom: 40px;
}

#pd-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 15px 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.pd-badge-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pd-id-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.pd-category-badge {
    background: var(--herobackground);
    color: var(--herotext);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* SECTIONS */
.pd-section {
    margin-bottom: 48px;
}

.pd-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

/* SPECS GRID */
.pd-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.spec-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.spec-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.spec-icon {
    font-size: 24px;
    color: var(--accent);
    background: rgba(166, 105, 48, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-text {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.spec-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* DETAILS LIST */
.pd-details-list {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.detail-item {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--divider);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

/* FIXED BOTTOM BUTTON */
.pd-fixed-bottom {
    position: fixed;
    bottom: 60px;
    /* Locked above the 60px bottom nav */
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 999;
    /* Ensure it stays on top of everything */
    display: flex;
    justify-content: center;
}

.pd-primary-btn {
    width: 100%;
    max-width: 500px;
    height: 60px;
    background-color: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pd-primary-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.pd-primary-btn:active {
    transform: scale(0.98);
}

/* FADE IN ANIMATION */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #pd-name {
        font-size: 2rem;
    }

    .pd-hero-section {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    .pd-specs-grid {
        grid-template-columns: 1fr;
    }

    #pd-name {
        font-size: 1.8rem;
    }

    .pd-content-wrapper {
        padding: 30px 20px;
    }
}