/**
 * Single Product Page Styles
 * Matches Figma design: kursai.net node 34:11
 */

/* =============================================
   Page Container
   ============================================= */
.sp-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 150px 88px 80px;
    background: #ffffff;
}

/* =============================================
   Back Button
   ============================================= */
.sp-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #252a36;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-bottom: 0;
}

.sp-back:hover {
    color: var(--color-accent);
}

/* =============================================
   Header Section
   ============================================= */
.sp-header {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-10);
    gap: var(--spacing-8);
}

.sp-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
}

.sp-header__left {
    width: 100%;
}

.sp-header__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
}

.sp-header__title {
    font-family: 'DM Sans', sans-serif;
    font-size: 40px;
    font-weight: var(--font-weight-bold);
    color: #252a36;
    line-height: 1.2;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.sp-header__code {
    color: var(--color-accent);
}

.sp-header__subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: #777e90;
    line-height: 36px;
    margin: var(--spacing-3) 0 0;
    max-width: 589px;
}


/* Rating */
.sp-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    flex-shrink: 0;
}

.sp-rating__label {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #777e90;
}

.sp-rating__stars {
    display: flex;
    gap: 2px;
}

.sp-rating__star {
    background: transparent;
    border: 0;
    padding: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sp-rating__star svg {
    width: 20px;
    height: 20px;
    fill: #e6e8ec;
    transition: fill 0.2s ease;
}

.sp-rating__star.is-active svg,
.sp-rating__star.is-preview svg {
    fill: #ffd700;
}

.sp-rating__value {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #252a36;
}

.sp-rating__status {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #777e90;
    min-width: 130px;
}

.sp-rating.is-loading .sp-rating__star {
    cursor: wait;
    pointer-events: none;
}

/* =============================================
   Content: Two-Column Layout
   ============================================= */
.sp-content {
    display: grid;
    grid-template-columns: 293px 1fr;
    gap: 50px;
    align-items: start;
}

/* =============================================
   LEFT: Product Card Sidebar
   ============================================= */
.sp-card-wrapper {
    position: sticky;
    top: 100px;
    z-index: 1;
}

/* Decorative blur glow behind card */
.sp-card-glow {
    position: absolute;
    top: 0;
    left: -10px;
    width: 258px;
    height: 688px;
    background: rgba(35, 33, 82, 0.1);
    border-radius: var(--border-radius-lg);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

/* The card itself */
.sp-card {
    background: #ffffff;
    backdrop-filter: blur(2px);
    border-radius: var(--border-radius-md);
    padding: 8px;
    width: 293px;
    position: relative;
}

/* Card Image Area - gradient background, no product image */
.sp-card__image {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 15px;
    overflow: hidden;
    margin: 0 0 var(--spacing-5);
    background: url('https://kursai.net/wp-content/uploads/sites/6/Rectangle-12.png') lightgray 50% / cover no-repeat;
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-card__image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e6e8ec;
    border-radius: 15px;
    pointer-events: none;
}

.sp-card__tag {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 5px;
    padding: 6px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
    box-shadow: 0 2px 4px -1px rgba(51, 53, 64, 0.1),
                inset 0 0.5px 1px 0 rgba(52, 54, 64, 0.15);
}

/* Card Body Text */
.sp-card__body {
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #252a36;
    line-height: 30px;
}

.sp-card__body p {
    margin: 0 0 var(--spacing-2) 0;
    font-size: var(--font-size-base);
    line-height: 30px;
}

.sp-card__body p:last-child {
    margin-bottom: 0;
}

/* Card Divider */
.sp-card__divider {
    width: 100%;
    height: 1px;
    background: #e6e8ec;
    margin: var(--spacing-5) 0;
}

/* Card Attributes */
.sp-card__attr {
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #252a36;
    line-height: 30px;
    margin-bottom: var(--spacing-2);
}

/* Card Price */
.sp-card__price {
    padding: 0;
    margin-bottom: var(--spacing-3);
}

.sp-card__price .price {
    font-family: 'DM Sans', sans-serif;
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent);
    display: flex;
    align-items: baseline;
    gap: var(--spacing-2);
    flex-wrap: wrap;
}

/* Regular price (when on sale, shown as strikethrough) */
.sp-card__price del,
.sp-card__price del .woocommerce-Price-amount {
    color: #777e90 !important;
    font-size: 32px;
    font-weight: var(--font-weight-semibold);
    text-decoration: line-through;
}

/* Sale price */
.sp-card__price ins {
    text-decoration: none;
}

.sp-card__price ins .woocommerce-Price-amount,
.sp-card__price > .woocommerce-Price-amount {
    font-size: var(--font-size-2xl);
    color: var(--color-accent);
    font-weight: var(--font-weight-semibold);
}

/* When not on sale, single price is larger */
.sp-card__price .price > .woocommerce-Price-amount {
    font-size: 32px;
}

/* Stock Status */
.sp-card__stock {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: 0;
    margin-bottom: var(--spacing-5);
}

.sp-card__stock span {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #252a36;
}

/* Purchase Section */
.sp-card__purchase {
    padding: 0;
}

.sp-cart-form {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

/* Quantity Input - number left, up/down arrows right */
.sp-quantity {
    display: flex;
    align-items: center;
    width: 63px;
    height: 49px;
    border: 1px solid #e6e8ec;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.sp-quantity__input {
    width: 32px;
    height: 100%;
    border: none;
    background: none;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #a1a2a7;
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none;
    padding: 0;
}

.sp-quantity__input::-webkit-outer-spin-button,
.sp-quantity__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sp-quantity__arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    gap: 4px;
}

.sp-quantity__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a1a2a7;
    padding: 0;
    transition: color 0.2s ease;
}

.sp-quantity__btn:hover {
    color: #252a36;
}

/* Order Button */
.sp-card__order-btn {
    flex: 1;
    height: 49px;
    border-radius: var(--border-radius-md) !important;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    padding: 0 var(--spacing-6);
}

.sp-card__unavailable {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    color: #777e90;
    text-align: center;
    padding: var(--spacing-4) 0;
    margin: 0;
}

/* =============================================
   RIGHT: Product Description Content
   ============================================= */
.sp-description {
    min-width: 0;
}

/* Headings in description */
.sp-description h2,
.sp-description h3,
.sp-description h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    color: #252a36;
    margin: 0 0 var(--spacing-3) 0;
    line-height: 1.4;
}

.sp-description h2:not(:first-child),
.sp-description h3:not(:first-child),
.sp-description h4:not(:first-child) {
    margin-top: var(--spacing-8);
}

/* Paragraphs in description */
.sp-description p {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: #777e90;
    line-height: 31px;
    margin: 0 0 var(--spacing-4) 0;
}

/* Highlighted/accent paragraphs (blue text) */
.sp-description p strong,
.sp-description strong {
    color: #252a36;
}

/* Blue highlighted text - for special callout paragraphs */
.sp-description .has-accent-color,
.sp-description p.has-accent-color {
    color: var(--color-accent);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
}

/* Lists */
.sp-description ul,
.sp-description ol {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    color: #777e90;
    line-height: 31px;
    padding-left: var(--spacing-6);
    margin: 0 0 var(--spacing-4) 0;
}

.sp-description li {
    margin-bottom: var(--spacing-2);
}

/* Tables */
.sp-description table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-size-base);
    margin: var(--spacing-4) 0 var(--spacing-8);
}

.sp-description table thead th,
.sp-description table th {
    font-weight: var(--font-weight-medium);
    color: #252a36;
    text-align: left;
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid #e6e8ec;
    line-height: 30px;
}

.sp-description table tbody td,
.sp-description table td {
    font-weight: var(--font-weight-normal);
    color: #777e90;
    padding: var(--spacing-4);
    line-height: 31px;
    vertical-align: top;
}

.sp-description table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f0;
}

/* WordPress block styling overrides */
.sp-description .wp-block-table {
    margin: var(--spacing-4) 0 var(--spacing-8);
}

.sp-description .wp-block-table table {
    margin: 0;
}

/* Links in description */
.sp-description a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sp-description a:hover {
    color: var(--color-links-hover);
    text-decoration: underline;
}

/* Images in description */
.sp-description img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    margin: var(--spacing-4) 0;
}

/* =============================================
   Hide unwanted parent theme elements
   ============================================= */
.single-product .woocommerce-breadcrumb {
    display: none !important;
}

/* =============================================
   Responsive Design
   ============================================= */

/* Large tablets / small desktops */
@media (max-width: 1200px) {
    .sp-page {
        padding: 40px 44px 60px;
    }

    .sp-header__title {
        font-size: 34px;
    }

    .sp-content {
        gap: 32px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .sp-page {
        padding: 32px 24px 48px;
    }

    .sp-header {
        gap: var(--spacing-4);
    }

    .sp-header__title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-10);
    }

    .sp-card-wrapper {
        position: static;
        display: flex;
        justify-content: center;
    }

    .sp-card-glow {
        display: none;
    }

    .sp-card {
        width: 100%;
        max-width: 400px;
    }

    .sp-card__image {
        width: 100%;
    }

    .sp-card__divider {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sp-page {
        padding: 90px 16px 40px;
    }

    .sp-header__top {
        gap: var(--spacing-3);
    }

    .sp-header__title {
        font-size: 28px;
    }

    .sp-header__subtitle {
        font-size: var(--font-size-base);
        line-height: 28px;
    }

    .sp-rating {
        flex-wrap: wrap;
        gap: var(--spacing-2);
    }

    .sp-card {
        max-width: 100%;
    }

    .sp-cart-form {
        flex-wrap: wrap;
    }

    .sp-card__order-btn {
        min-width: 0;
    }

    /* Description content adjustments */
    .sp-description h2,
    .sp-description h3,
    .sp-description h4 {
        font-size: var(--font-size-lg);
    }

    .sp-description table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .sp-header__title {
        font-size: 24px;
    }

    .sp-card__price del,
    .sp-card__price del .woocommerce-Price-amount {
        font-size: 24px;
    }

    .sp-card__price ins .woocommerce-Price-amount,
    .sp-card__price > .woocommerce-Price-amount,
    .sp-card__price .price > .woocommerce-Price-amount {
        font-size: var(--font-size-xl);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sp-back,
    .sp-quantity__btn {
        transition: none;
    }
}
