:root {
    --pd-primary: #b77b3b;
    --pd-primary-hover: #a06a2f;
    --pd-text: #111;
    --pd-text-secondary: #555;
    --pd-border: #e5e5e5;
    --pd-bg: #fff;
    --pd-gap: 40px;
}

/* Force full width overriding container */
.main {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Layout */
.pd-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: var(--pd-gap);
    background: var(--pd-bg);
    min-height: calc(100vh - 80px);
}

/* Left Column: Visuals */
.pd-visuals {
    flex: 1 1 50%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Desktop sticky visual */
@media (min-width: 992px) {
    .pd-visuals {
        position: sticky;
        top: 100px;
        align-self: flex-start;
        /* Removed overflow and max-height to prevent internal scrolling */
    }
}

.pd-image-stage {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    /* Optional: subtle border or shadow if desired, but kept clean as requested */
    padding: 10px;
}

.pd-main-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

/* Thumbnails (below image) */
.pd-thumbs-container {
    width: 100%;
}

.pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center; /* Center thumbs */
}

.thumb {
    width: 70px;
    height: 70px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #f9f9f9;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
}

.thumb:hover, .thumb.active {
    border-color: var(--pd-primary);
    transform: translateY(-2px);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    pointer-events: none;
}

/* Right Column: Details */
.pd-details {
    flex: 1 1 40%;
    min-width: 300px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.pd-content-inner {
    max-width: 600px;
}

/* Breadcrumbs */
.pd-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--pd-text-secondary);
    margin-bottom: 20px;
}

.pd-crumb-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.pd-crumb-link:hover {
    color: var(--pd-primary);
}

.pd-crumb-sep {
    color: #ccc;
    font-size: 12px;
}

/* Title & Price */
.pd-title {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--pd-text);
    margin-bottom: 16px;
}

.pd-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pd-border);
}

.pd-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--pd-primary);
}

.pd-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.pd-stock-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.pd-stock-badge.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* Options */
.pd-purchase-options {
    margin-bottom: 24px;
}

.pd-option-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pd-option-card {
    position: relative;
    cursor: pointer;
}

.pd-option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pd-option-content {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
}

.pd-option-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--pd-text);
    margin-bottom: 4px;
}

.pd-option-desc {
    font-size: 13px;
    color: var(--pd-text-secondary);
}

.pd-check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    background: var(--pd-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
}

/* Checked State */
.pd-option-card input:checked + .pd-option-content {
    border-color: var(--pd-primary);
    background: #fffcf8;
    box-shadow: 0 2px 8px rgba(183, 123, 59, 0.1);
}

.pd-option-card input:checked ~ .pd-check-icon {
    opacity: 1;
    transform: scale(1);
}

.pd-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--pd-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Add to Cart Button */
.pd-add-btn {
    width: 100%;
    height: 56px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s, transform 0.1s;
}

.pd-add-btn:hover {
    background: var(--pd-primary);
}

.pd-add-btn:active {
    transform: scale(0.98);
}

.pd-add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Description Section */
.pd-description {
    margin-top: 32px;
}

.pd-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--pd-text);
}

.pd-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

/* Quantity Controls Styling (Generated by JS) */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--pd-border);
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--pd-text);
}

.quantity-btn:hover {
    border-color: var(--pd-primary);
    background-color: var(--pd-primary);
    color: #fff;
}

.quantity-display {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pd-wrapper {
        flex-direction: column;
        gap: 24px;
        padding: 16px;
    }

    .pd-visuals {
        position: static; /* No sticky on mobile */
        max-height: none;
        overflow: visible;
    }

    .pd-main-image {
        max-height: 400px;
    }
    
    .pd-thumbs {
        justify-content: flex-start; /* Left align on mobile for horizontal scroll feel if needed, or keeping center */
        justify-content: center;
    }

    .thumb {
        width: 60px;
        height: 60px;
    }

    .pd-title {
        font-size: 24px;
    }
    
    .pd-price {
        font-size: 24px;
    }
    
    .pd-option-group {
        grid-template-columns: 1fr; /* Stack options on small screens */
    }

    /* Center controls on mobile explicitly */
    .quantity-controls {
        justify-content: center;
        margin-top: 16px;
    }
}
