/*
 * DODOSCAR SRL — Single Product Page Styles
 * Template: single-product.php
 * Prefix: dds- (classes) / --dds- (CSS variables)
 * ALL colors from global-styles.css :root — NO hardcoded hex
 * ==========================================================================
 */

/* ==========================================================================
   1. PAGE WRAPPER & BACKGROUND DECORATIONS
   ========================================================================== */
#dds-product-wrapper {
    position: relative;
    min-height: 100vh;
    background: var(--dds-bg-primary);
    overflow: hidden;
    padding-bottom: var(--dds-section-pad-y);
}

/* Grid background */
.dds-product-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--dds-border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--dds-border-subtle) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* Decorative orb */
.dds-product-bg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(100px);
}

.dds-orb-1 {
    width: 500px;
    height: 500px;
    top: -80px;
    right: -120px;
    background: var(--dds-glow-orange);
    opacity: 0.35;
}

/* ==========================================================================
   2. BREADCRUMB
   ========================================================================== */
.dds-breadcrumb {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: var(--dds-container-max);
    margin: 0 auto;
    padding: 140px var(--dds-section-pad-x) 20px;
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

.dds-breadcrumb__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--dds-text-dim);
    text-decoration: none;
    transition: color var(--dds-timing-fast) ease;
}

.dds-breadcrumb__link:hover {
    color: var(--dds-orange-300);
}

.dds-breadcrumb__link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.dds-breadcrumb__sep {
    color: var(--dds-text-dim);
    font-size: 0.625rem;
}

.dds-breadcrumb__current {
    color: var(--dds-text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   3. PRODUCT LAYOUT — 2-Column Container
   ========================================================================== */
.dds-product-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
    max-width: var(--dds-container-max);
    margin: 0 auto;
    padding: 20px var(--dds-section-pad-x) 0;
}

/* ==========================================================================
   4. GALLERY — Sticky Left Column
   ========================================================================== */
.dds-product-visual {
    position: sticky;
    top: 160px;
}

.dds-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dds-gallery__main {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--dds-card-radius);
    overflow: hidden;
    background: var(--dds-bg-tertiary);
    border: 1px solid var(--dds-border-subtle);
}

.dds-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform var(--dds-timing-base) var(--dds-ease-fluid);
}

.dds-gallery__main:hover .dds-gallery__main-img {
    transform: scale(1.05);
}

/* Fallback when no image */
.dds-gallery__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dds-text-dim);
    aspect-ratio: 1;
}

/* Thumbnail strip */
.dds-gallery__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.dds-gallery__thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--dds-timing-fast) ease;
    background: var(--dds-bg-tertiary);
    padding: 0;
}

.dds-gallery__thumb:hover {
    border-color: var(--dds-border-active);
}

.dds-gallery__thumb.active {
    border-color: var(--dds-orange-500);
}

.dds-gallery__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   5. PRODUCT DETAILS — Right Column
   ========================================================================== */
.dds-product-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Category tag */
.dds-product-cat {
    display: inline-flex;
    padding: 5px 16px;
    background: var(--dds-gradient-subtle);
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-btn-radius);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--dds-gold-300);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    width: fit-content;
}

/* Product title */
.dds-product-title {
    font-family: var(--dds-font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--dds-text-primary);
    margin: 0;
    line-height: 1.25;
}

/* Short description */
.dds-product-short-desc {
    font-size: 1rem;
    color: var(--dds-text-secondary);
    line-height: 1.7;
}

.dds-product-short-desc p {
    margin: 0 0 8px;
}

.dds-product-short-desc p:last-child {
    margin-bottom: 0;
}

/* SKU */
.dds-product-sku {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
}

.dds-product-sku__label {
    color: var(--dds-text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dds-product-sku__value {
    color: var(--dds-text-secondary);
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* ==========================================================================
   6. PRICE DISPLAY
   ========================================================================== */
.dds-product-price-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dds-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dds-product-price {
    font-family: var(--dds-font-display);
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--dds-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

/* WooCommerce price styling within product price */
.dds-product-price .woocommerce-Price-amount {
    font-family: var(--dds-font-display);
    font-weight: 800;
}

/* ==========================================================================
   7. CONFIGURATOR ZONE
   ========================================================================== */
.dds-configurator {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.dds-logic-box {
    padding: 28px;
    background: var(--dds-bg-tertiary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-card-radius);
}

.dds-logic-box--simple {
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 12px;
}

.dds-logic-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--dds-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dds-text-primary);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--dds-border-subtle);
}

.dds-logic-title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--dds-gold-300);
}

.dds-logic-desc {
    font-size: 0.9375rem;
    color: var(--dds-text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Form groups inside configurator */
.dds-form-group {
    margin-bottom: 16px;
}

.dds-form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dds-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Select input */
.dds-select {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background-color: var(--dds-bg-secondary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: 12px;
    color: var(--dds-text-primary);
    font-size: 0.9375rem;
    font-family: var(--dds-font-body);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23666666'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    outline: none;
    transition: border-color var(--dds-timing-fast) ease;
}

.dds-select:focus {
    border-color: var(--dds-orange-500);
}

/* Text / number input */
.dds-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--dds-bg-secondary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: 12px;
    color: var(--dds-text-primary);
    font-size: 0.9375rem;
    font-family: var(--dds-font-body);
    outline: none;
    transition: border-color var(--dds-timing-fast) ease;
}

.dds-input:focus {
    border-color: var(--dds-orange-500);
}

.dds-input::placeholder {
    color: var(--dds-text-dim);
}

/* Textarea */
.dds-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--dds-bg-secondary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: 12px;
    color: var(--dds-text-primary);
    font-size: 0.9375rem;
    font-family: var(--dds-font-body);
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--dds-timing-fast) ease;
}

.dds-textarea:focus {
    border-color: var(--dds-orange-500);
}

.dds-textarea::placeholder {
    color: var(--dds-text-dim);
}

/* ==========================================================================
   8. LIVE PRICE DISPLAY
   ========================================================================== */
.dds-live-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--dds-bg-secondary);
    border: 1px solid var(--dds-border-active);
    border-radius: 12px;
    margin: 20px 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dds-text-secondary);
}

.dds-live-price span {
    font-family: var(--dds-font-display);
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--dds-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   9. SUBMIT BUTTON
   ========================================================================== */
.dds-btn-submit {
    width: 100%;
    padding: 14px 28px;
    background: var(--dds-gradient-brand);
    border: none;
    border-radius: var(--dds-btn-radius);
    color: var(--dds-text-primary);
    font-family: var(--dds-font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform var(--dds-timing-fast) var(--dds-ease-spring),
                box-shadow var(--dds-timing-fast) ease;
    box-shadow: 0 4px 20px var(--dds-glow-orange);
    position: relative;
    overflow: hidden;
}

.dds-btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--dds-gradient-brand-hover);
    opacity: 0;
    transition: opacity var(--dds-timing-fast) ease;
    border-radius: inherit;
}

.dds-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--dds-glow-gold);
}

.dds-btn-submit:hover::before {
    opacity: 1;
}

.dds-btn-submit svg,
.dds-btn-submit span {
    position: relative;
    z-index: 1;
}

.dds-btn-submit svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dds-btn-submit--small {
    padding: 10px 20px;
    font-size: 0.875rem;
    width: auto;
}

/* ==========================================================================
   10. PRODUCT DESCRIPTION (Below configurator)
   ========================================================================== */
.dds-product-description {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--dds-border-subtle);
}

.dds-product-description__title {
    font-family: var(--dds-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dds-text-primary);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--dds-border-subtle);
}

.dds-product-description__content {
    max-width: 100%;
}

.dds-product-description__content h2 {
    font-family: var(--dds-font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dds-text-primary);
    margin: 28px 0 12px;
}

.dds-product-description__content h3 {
    font-family: var(--dds-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dds-text-primary);
    margin: 20px 0 10px;
}

.dds-product-description__content p {
    font-size: 0.9375rem;
    color: var(--dds-text-secondary);
    line-height: 1.8;
    margin: 0 0 16px;
}

.dds-product-description__content ul,
.dds-product-description__content ol {
    padding-left: 20px;
    margin: 0 0 16px;
}

.dds-product-description__content li {
    font-size: 0.9375rem;
    color: var(--dds-text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.dds-product-description__content ul li::marker {
    color: var(--dds-orange-500);
}

.dds-product-description__content ol li::marker {
    color: var(--dds-orange-500);
    font-weight: 700;
}

/* ==========================================================================
   11. RELATED PRODUCTS SECTION
   ========================================================================== */
.dds-related-section {
    position: relative;
    z-index: 1;
    padding: var(--dds-section-pad-y) 0;
    max-width: var(--dds-container-max);
    margin: 48px auto 0;
    border-top: 1px solid var(--dds-border-subtle);
}

.dds-related-header {
    padding: 0 var(--dds-section-pad-x);
    margin-bottom: 32px;
}

.dds-related-title {
    font-family: var(--dds-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dds-text-primary);
    margin: 0 0 8px;
}

.dds-related-subtitle {
    font-size: 1rem;
    color: var(--dds-text-secondary);
    margin: 0;
    line-height: 1.6;
}

.dds-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0 var(--dds-section-pad-x);
}

/* ==========================================================================
   12. RELATED PRODUCT CARDS
   ========================================================================== */
.dds-related-card {
    display: flex;
    flex-direction: column;
    background: var(--dds-bg-tertiary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-card-radius);
    overflow: hidden;
    text-decoration: none;
    transition: border-color var(--dds-timing-fast) ease,
                transform var(--dds-timing-fast) var(--dds-ease-spring),
                box-shadow var(--dds-timing-fast) ease;
}

.dds-related-card:hover {
    border-color: var(--dds-border-active);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--dds-glow-orange);
}

/* Thumbnail */
.dds-related-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--dds-bg-secondary);
}

.dds-related-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dds-timing-base) var(--dds-ease-fluid);
}

.dds-related-card:hover .dds-related-card__img {
    transform: scale(1.05);
}

.dds-related-card__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dds-text-dim);
}

/* Category badge */
.dds-related-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: var(--dds-bg-primary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-btn-radius);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--dds-gold-300);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}

/* Card body */
.dds-related-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dds-related-card__title {
    font-family: var(--dds-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dds-text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dds-related-card__price {
    font-family: var(--dds-font-display);
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--dds-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* WC price inside related card */
.dds-related-card__price .woocommerce-Price-amount {
    font-family: var(--dds-font-display);
    font-weight: 700;
}

/* Configurable / request labels */
.dds-price-configurable {
    color: var(--dds-gold-300);
    font-size: 0.875rem;
    font-weight: 600;
    -webkit-text-fill-color: var(--dds-gold-300);
}

.dds-price-request {
    color: var(--dds-text-dim);
    font-size: 0.875rem;
    font-weight: 500;
    -webkit-text-fill-color: var(--dds-text-dim);
}

/* ==========================================================================
   13. SUCCESS MODAL
   ========================================================================== */
.dds-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dds-timing-fast) var(--dds-ease-fluid),
                visibility var(--dds-timing-fast);
}

.dds-modal.active {
    opacity: 1;
    visibility: visible;
}

.dds-modal__content {
    background: var(--dds-bg-tertiary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-card-radius);
    padding: 48px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--dds-timing-fast) var(--dds-ease-spring);
}

.dds-modal.active .dds-modal__content {
    transform: scale(1);
}

.dds-modal__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 50%;
    margin: 0 auto 20px;
    color: var(--dds-success);
}

.dds-modal__icon svg {
    width: 48px;
    height: 48px;
}

.dds-modal__title {
    font-family: var(--dds-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dds-text-primary);
    margin: 0 0 10px;
}

.dds-modal__desc {
    font-size: 0.9375rem;
    color: var(--dds-text-secondary);
    margin: 0 0 28px;
    line-height: 1.6;
}

.dds-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Outline button (secondary action) */
.dds-btn-outline {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--dds-border-subtle);
    border-radius: var(--dds-btn-radius);
    color: var(--dds-text-primary);
    font-family: var(--dds-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--dds-timing-fast) ease,
                background var(--dds-timing-fast) ease,
                transform var(--dds-timing-fast) var(--dds-ease-spring);
}

.dds-btn-outline:hover {
    border-color: var(--dds-border-active);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

/* ==========================================================================
   14. RESPONSIVE — TABLET (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .dds-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dds-product-container {
        gap: 40px;
    }
}

/* ==========================================================================
   15. RESPONSIVE — MOBILE (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .dds-breadcrumb {
        padding-top: 120px;
    }

    .dds-product-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .dds-product-visual {
        position: static;
    }

    .dds-gallery__main {
        aspect-ratio: 4 / 3;
    }

    .dds-gallery__thumb {
        width: 56px;
        height: 56px;
    }

    .dds-logic-box {
        padding: 20px;
    }

    .dds-related-grid {
        grid-template-columns: 1fr;
    }

    .dds-related-section {
        padding: 48px 0 64px;
    }

    .dds-modal__content {
        padding: 32px 24px;
    }

    .dds-modal__actions {
        flex-direction: column;
    }

    .dds-modal__actions .dds-btn-submit--small {
        width: 100%;
    }

    .dds-modal__actions .dds-btn-outline {
        width: 100%;
    }

    .dds-product-price {
        font-size: 1.5rem;
    }

    .dds-related-card__body {
        padding: 16px;
    }
}

/* ==========================================================================
   16. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .dds-related-card,
    .dds-related-card__img,
    .dds-gallery__main-img,
    .dds-btn-submit,
    .dds-btn-outline,
    .dds-modal,
    .dds-modal__content {
        transition: none;
    }

    .dds-related-card:hover {
        transform: none;
    }

    .dds-related-card:hover .dds-related-card__img {
        transform: none;
    }

    .dds-gallery__main:hover .dds-gallery__main-img {
        transform: none;
    }
}


/* ═══════════════════════════════════════════
   EXCHANGE CONFIGURATOR — Detalii calcul
   ═══════════════════════════════════════════ */

.dds-exchange-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    background: var(--dds-bg-secondary);
    border: 1px solid var(--dds-border-subtle);
    border-radius: 14px;
    margin-bottom: 16px;
}

.dds-exchange-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dds-exchange-detail__label {
    font-size: 0.8rem;
    color: var(--dds-text-dim);
    font-weight: 500;
}

.dds-exchange-detail__value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dds-text-primary);
    font-family: var(--dds-font-display);
}

.dds-exchange-detail__value--commission {
    color: var(--dds-gold-300);
    background: var(--dds-orange-bg-08);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
}

.dds-exchange-detail__value--rate {
    color: var(--dds-orange-300);
}

.dds-exchange-commission-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: var(--dds-orange-bg-04);
    border: 1px solid var(--dds-orange-border-12);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--dds-text-dim);
    line-height: 1.5;
    margin-bottom: 16px;
}

.dds-exchange-commission-info svg {
    flex-shrink: 0;
    color: var(--dds-orange-500);
    margin-top: 1px;
}

.dds-exchange-note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--dds-text-dim);
    line-height: 1.5;
    text-align: center;
    font-style: italic;
}
