/*
 Theme Name:   Shoptimizer Child
 Theme URI:    https://developer.wordpress.org/themes/advanced-topics/child-themes/
 Description:  Shoptimizer Child Theme
 Author:       QuickFlip
 Template:     shoptimizer
 Version:      1.0.0
 Text Domain:  shoptimizer-child
*/

/* Import Righteous (headings) and Nunito (body text) from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,700;0,800;1,400&family=Righteous&display=swap');

/* ==========================================================================
   Body text font
   The theme's Poppins/Lato font files don't load (Kirki writes server file
   paths into its @font-face rules), so set body text to Nunito from Google.
   ========================================================================== */

:root body,
body button,
body input,
body select,
body option,
body textarea,
body .entry-content {
    font-family: 'Nunito', sans-serif;
}

/* ==========================================================================
   Retro Gaming Styled Sorting/Filter Bar
   ========================================================================== */

.shoptimizer-sorting {
    background: linear-gradient(135deg, #253044 0%, #1a2233 100%);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow:
        0 4px 0 #1a2233,
        0 6px 20px rgba(37, 48, 68, 0.3);
    border: 3px solid #55bbb2;
    position: relative;
}

/* Pixel-art style corner accents */
.shoptimizer-sorting::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 14px;
    background: linear-gradient(90deg, #eea83b, #55bbb2, #eea83b);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shoptimizer-sorting:hover::before {
    opacity: 1;
}

/* Result count styling - pushed to far right */
.shoptimizer-sorting .woocommerce-result-count,
.woocommerce-result-count {
    background: #55bbb2;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Righteous', cursive !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        0 3px 0 #3d9a8a,
        inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    margin-left: auto;
}

/* Dropdown select styling */
.shoptimizer-sorting select.orderby,
select.orderby {
    background: #eea83b;
    color: #253044;
    padding: 10px 35px 10px 16px;
    border-radius: 20px;
    font-family: 'Righteous', cursive !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    box-shadow:
        0 3px 0 #c78a2a,
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23253044' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.shoptimizer-sorting select.orderby:hover,
select.orderby:hover {
    background-color: #f5b84d;
    transform: translateY(-2px);
    box-shadow:
        0 5px 0 #c78a2a,
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.shoptimizer-sorting select.orderby:active,
select.orderby:active {
    transform: translateY(2px);
    box-shadow:
        0 1px 0 #c78a2a,
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Focus state for accessibility */
.shoptimizer-sorting select.orderby:focus,
select.orderby:focus {
    outline: 3px solid #55bbb2;
    outline-offset: 2px;
}

/* Hide bottom sorting bar (after products) */
.shoptimizer-sorting.sorting-end {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 992px) {
    .shoptimizer-sorting {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
    }

    .shoptimizer-sorting .woocommerce-result-count {
        margin-left: 0;
        order: 2;
    }

    .shoptimizer-sorting select.orderby,
    select.orderby {
        width: auto;
        flex: 1;
        min-width: 150px;
    }
}

/* ==========================================================================
   Product page "Imperfections" thumbnail row
   ========================================================================== */

.product .quickflip-imperfections {
    margin-top: 1.25rem;
    text-align: center;
}

.product .quickflip-imperfections__heading {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.product .quickflip-imperfections__thumbs {
    margin: 0;
    list-style: none;
}

.product .quickflip-imperfections__thumbs li {
    display: inline-block;
    margin: 0 0.25rem;
}

.product .quickflip-imperfections__thumbs button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.product .quickflip-imperfections__thumbs img {
    display: block;
    width: 40px;
    opacity: 0.5;
    transition: all 0.2s;
}

.product .quickflip-imperfections__thumbs button.is-active img,
.product .quickflip-imperfections__thumbs button:hover img,
.product .quickflip-imperfections__thumbs button:focus-visible img {
    opacity: 1;
}

@media (min-width: 993px) {
    .product .quickflip-imperfections__thumbs img {
        width: 60px;
    }
}

/* ==========================================================================
   Scratched disc repair page (body.quickflip-repair-page) and booking form
   ========================================================================== */

.quickflip-repair-page .entry-header,
.quickflip-repair-page .woocommerce-breadcrumb {
    max-width: 900px;
    margin-inline: auto;
}

.quickflip-repair-page .entry-content {
    max-width: 900px;
    margin-inline: auto;
    color: #2d384e;
    font-size: 17px;
    line-height: 1.65;
}

.quickflip-repair-page .entry-content p {
    margin: 0 0 16px;
    font-size: inherit;
    line-height: inherit;
}

.quickflip-repair-page .entry-content strong {
    font-weight: 800;
    color: #253044;
}

.quickflip-repair-page .entry-content .qdr-intro {
    font-size: 22px;
    line-height: 1.5;
}

.quickflip-repair-page .entry-content h2 {
    margin: 56px 0 16px;
    font-size: 32px;
    color: #253044;
}

.quickflip-repair-page .entry-content h3 {
    margin: 0 0 8px;
    font-size: 21px;
    color: #253044;
}

.quickflip-repair-page .entry-content a:not(.wp-block-button__link) {
    color: #253044;
    font-weight: 800;
    text-decoration: underline 2px #55bbb2;
    text-underline-offset: 3px;
}

/* Call to action buttons */
.quickflip-repair-page .qdr-cta {
    margin: 24px 0 8px;
}

.quickflip-repair-page .qdr-cta .wp-block-button__link {
    padding: 14px 30px;
    border-radius: 999px;
    background: #EEA83B;
    color: #253044;
    font: 800 17px 'Nunito', sans-serif;
    transition: background 0.2s, color 0.2s;
}

.quickflip-repair-page .qdr-cta .wp-block-button__link:hover,
.quickflip-repair-page .qdr-cta .wp-block-button__link:focus-visible {
    background: #3bb54a;
    color: #fff;
}

/* Before / after images */
.quickflip-repair-page .qdr-before-after {
    gap: 16px;
    margin: 32px 0;
}

.quickflip-repair-page .qdr-before-after figure {
    position: relative;
    margin: 0;
}

.quickflip-repair-page .qdr-before-after img {
    display: block;
    border: 1px solid #e1e6ef;
    border-radius: 16px;
}

.quickflip-repair-page .qdr-before-after figcaption {
    position: absolute;
    top: 12px;
    left: 12px;
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: #253044;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* How it works steps */
.quickflip-repair-page .qdr-steps {
    gap: 16px;
}

.quickflip-repair-page .qdr-steps > .wp-block-column {
    padding: 20px;
    border-radius: 12px;
    background: #e1e6ef;
}

.quickflip-repair-page .entry-content .qdr-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 0 12px;
    border-radius: 50%;
    background: #55bbb2;
    color: #fff;
    font: 16px/1 'Righteous', sans-serif;
}

.quickflip-repair-page .qdr-steps h3 {
    font-size: 18px;
}

.quickflip-repair-page .entry-content .qdr-steps p:last-child {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}

/* Cards: machines and can/can't fix */
.quickflip-repair-page .qdr-cards {
    gap: 16px;
}

.quickflip-repair-page .qdr-cards > .wp-block-column {
    padding: 24px;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
}

.quickflip-repair-page .qdr-cards ul {
    margin: 0 0 16px 1.2em;
}

.quickflip-repair-page .entry-content .qdr-cards p:last-child,
.quickflip-repair-page .qdr-cards ul:last-child {
    margin-bottom: 0;
}

.quickflip-repair-page .qdr-fix .qdr-fix-yes {
    border-color: #55bbb2;
    background: #eef8f7;
}

.quickflip-repair-page .qdr-fix .qdr-fix-no {
    border-color: #fadec6;
    background: #fdf1e7;
}

.quickflip-repair-page .qdr-mark {
    font-weight: 800;
}

.quickflip-repair-page .qdr-fix-yes .qdr-mark {
    color: #3bb54a;
}

/* FAQ */
.quickflip-repair-page .entry-content .qdr-faq h3 {
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid #e1e6ef;
    font-size: 18px;
}

.quickflip-repair-page .entry-content .qdr-faq p {
    padding-bottom: 2px;
}

/* Booking form */
.quickflip-disc-repair {
    margin: 0;
}

.quickflip-disc-repair__step {
    margin: 0 0 20px;
    padding: 24px 28px;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(37, 48, 68, 0.06);
}

.quickflip-disc-repair__step legend {
    padding: 0 10px;
    font-family: 'Righteous', sans-serif;
    font-size: 1.15rem;
    color: #253044;
}

.quickflip-disc-repair__hint {
    margin: 0.5rem 0;
    font-size: 14px;
    color: #5c6a82;
}

.quickflip-disc-repair__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid #e1e6ef;
}

.quickflip-disc-repair__row:last-of-type {
    border-bottom: 0;
}

.quickflip-disc-repair__row label {
    flex: 1;
    margin: 0;
}

.quickflip-disc-repair__row small,
.quickflip-disc-repair__option small {
    display: block;
    font-size: 14px;
    color: #5c6a82;
}

.quickflip-disc-repair__price {
    margin-left: 0.5rem;
    color: #3bb54a;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.quickflip-disc-repair__row input[type="number"] {
    width: 5.5rem;
    height: 48px;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.quickflip-disc-repair__option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 0 0 6px;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
}

.quickflip-disc-repair__option:has(input:checked) {
    background: #eef8f7;
    outline: 2px solid #55bbb2;
}

.quickflip-disc-repair__option input {
    margin-top: 0.35rem;
}

.quickflip-disc-repair__step textarea {
    width: 100%;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    font-size: 16px;
}

.quickflip-disc-repair__summary {
    padding: 24px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #253044 0%, #1a2233 100%);
    color: #fff;
}

.quickflip-disc-repair__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: 'Righteous', sans-serif;
    font-size: 1.25rem;
}

.quickflip-disc-repair__total strong,
.quickflip-repair-page .entry-content .quickflip-disc-repair__total strong {
    font-size: 36px;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.quickflip-disc-repair .quickflip-disc-repair__breakdown {
    min-height: 1.5em;
    margin: 4px 0;
    font-size: 14px;
    color: #e1e6ef;
}

.quickflip-disc-repair .quickflip-disc-repair__included {
    margin: 0 0 16px;
    color: #55bbb2;
    font-weight: 800;
}

.quickflip-disc-repair__summary .button {
    width: 100%;
    height: 54px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
}

.quickflip-disc-repair__summary .button:hover {
    background: #3bb54a;
}

.quickflip-disc-repair__summary .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 781px) {
    .quickflip-repair-page .qdr-before-after {
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .quickflip-repair-page .entry-content {
        font-size: 16px;
        line-height: 1.6;
    }

    .quickflip-repair-page .entry-content .qdr-intro {
        font-size: 20px;
        line-height: 1.55;
    }

    .quickflip-repair-page .entry-content h2 {
        margin-top: 44px;
        font-size: 27px;
    }

    .quickflip-disc-repair__step,
    .quickflip-disc-repair__summary {
        padding: 18px 16px;
    }
}

@media (max-width: 480px) {
    .quickflip-disc-repair__row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .quickflip-disc-repair__row label {
        flex-basis: 100%;
    }

    .quickflip-disc-repair__row input[type="number"] {
        width: 100%;
    }

    .quickflip-disc-repair__price {
        display: block;
        margin-left: 0;
    }
}
