/*
Theme Name: PC Recycle Original Design
Theme URI: https://pcrecycle.com
Author: PC Recycle
Description: Preserves the original GitHub HTML/CSS/JS design, with WordPress pages and WooCommerce compatibility.
Version: 1.0.4
Requires PHP: 7.4
Text Domain: pcrecycle
*/

/* =========================================
   PC RECYCLE - WOOCOMMERCE STYLES
   ========================================= */

body.woocommerce-cart,
body.woocommerce-checkout {
    background: #f2f2f2;
    color: #1b2023;
    font-family: Arial, Helvetica, sans-serif;
}

/* CART PAGE LAYOUT */

body.woocommerce-cart main.pcr-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 24px 70px;
    box-sizing: border-box;
}

body.woocommerce-cart main.pcr-content > h1 {
    display: block;
    width: 100%;
    margin: 15px auto 35px;
    padding: 0;
    text-align: center;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    color: #1b2023;
}

/* EMPTY CART */

body.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 25px 0 60px;
    text-align: center;
}

body.woocommerce-cart .wp-block-woocommerce-empty-cart-block h2,
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-heading {
    text-align: center;
    color: #1b2023;
}

body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px auto;
}

body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link {
    display: inline-block;
    background: #3aaa5c;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link:hover {
    background: #2a7a40;
    color: #ffffff;
}

/* FILLED CART */

body.woocommerce-cart .wp-block-woocommerce-filled-cart-block,
body.woocommerce-cart .wc-block-cart {
    width: 100%;
    margin: 0 auto 50px;
}

body.woocommerce-cart .wc-block-cart-items {
    width: 100%;
}

body.woocommerce-cart .wc-block-cart-item__image img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
}

body.woocommerce-cart .wc-block-cart__sidebar {
    box-sizing: border-box;
}

body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button:not(.is-link) {
    background: #3aaa5c;
    color: #ffffff;
    border-radius: 8px;
    font-weight: 700;
}

body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-cart .wc-block-components-button:not(.is-link):hover {
    background: #2a7a40;
    color: #ffffff;
}

/* CART MOBILE */

@media (max-width: 700px) {
    body.woocommerce-cart main.pcr-content {
        padding: 24px 16px 50px;
    }

    body.woocommerce-cart main.pcr-content > h1 {
        font-size: 30px;
        margin: 10px auto 25px;
    }

    body.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
        padding: 20px 0 45px;
    }

    body.woocommerce-cart .wc-block-cart-item__image img {
        max-width: 85px;
    }
}

/* =========================================
   PC RECYCLE - ORDER CONFIRMATION RECEIPT
   ========================================= */

body.woocommerce-order-received {
    background: #f5f7f6;
}

.woocommerce-order-received .woocommerce-order {
    max-width: 850px;
    margin: 30px auto 60px;
    padding: 35px;
    background: #ffffff;
    border: 1px solid #e2e8e4;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    font-family: Arial, sans-serif;
    color: #252525;
}

.woocommerce-order-received
.woocommerce-thankyou-order-received {
    background: #eaf7ee;
    color: #20763b;
    border: 1px solid #bce5c7;
    border-radius: 9px;
    padding: 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
}

.woocommerce-order-received
.woocommerce-order-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}

.woocommerce-order-received
.woocommerce-order-overview li {
    background: #f6f8f7;
    border: 1px solid #e6ebe7;
    border-radius: 8px;
    padding: 15px;
    margin: 0;
    float: none;
    width: auto;
    text-transform: none;
    font-size: 13px;
    line-height: 1.6;
}

.woocommerce-order-received
.woocommerce-order-overview li strong {
    display: block;
    margin-top: 5px;
    font-size: 16px;
    color: #222;
}

.woocommerce-order-received
.woocommerce-order-details__title,
.woocommerce-order-received
.woocommerce-column__title {
    font-size: 21px;
    color: #202820;
    margin: 25px 0 15px;
}

.woocommerce-order-received
.woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e4e9e5;
    border-radius: 8px;
    overflow: hidden;
}

.woocommerce-order-received
.woocommerce-table--order-details th,
.woocommerce-order-received
.woocommerce-table--order-details td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9eeea;
    text-align: left;
}

.woocommerce-order-received
.woocommerce-table--order-details thead {
    background: #f4f7f5;
}

.woocommerce-order-received
.woocommerce-table--order-details tfoot tr:last-child {
    background: #eaf7ee;
    color: #176b34;
    font-size: 18px;
    font-weight: 700;
}

.woocommerce-order-received
.woocommerce-customer-details {
    margin-top: 30px;
}

.woocommerce-order-received
.woocommerce-columns--addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.woocommerce-order-received
.woocommerce-columns--addresses .woocommerce-column {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    background: #fafbfa;
    border: 1px solid #e4e9e5;
    border-radius: 9px;
    padding: 18px;
}

.woocommerce-order-received
.woocommerce-customer-details address {
    font-style: normal;
    line-height: 1.8;
    border: none;
    padding: 0;
}

@media (max-width: 650px) {
    .woocommerce-order-received .woocommerce-order {
        padding: 18px;
        margin: 15px auto 35px;
    }

    .woocommerce-order-received
    .woocommerce-order-overview,
    .woocommerce-order-received
    .woocommerce-columns--addresses {
        grid-template-columns: 1fr;
    }

    .woocommerce-order-received
    .woocommerce-table--order-details th,
    .woocommerce-order-received
    .woocommerce-table--order-details td {
        padding: 10px;
        font-size: 13px;
    }
}

/* ==========================================
   PC RECYCLE - RESIDENTIAL PICKUP PAGE
   ========================================== */

body.page .entry-content:has(.wpcf7) {
    max-width: 950px;
    margin: 35px auto 70px;
    padding: 35px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #253029;
}

body.page:has(.wpcf7) h1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 36px;
    line-height: 1.2;
    color: #202820;
    margin: 25px 0;
}

body.page:has(.wpcf7) h2,
body.page:has(.wpcf7) h3 {
    font-family: Arial, Helvetica, sans-serif;
    color: #198754;
    margin: 28px 0 14px;
}

body.page .wpcf7 {
    max-width: 850px;
    margin: 35px auto;
    padding: 35px;
    background: #f7faf8;
    border: 1px solid #dce8df;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.05);
    font-family: Arial, Helvetica, sans-serif;
}

body.page .wpcf7 label {
    display: block;
    margin: 16px 0 7px;
    font-size: 15px;
    font-weight: 600;
    color: #26332a;
}

body.page .wpcf7 input[type="text"],
body.page .wpcf7 input[type="email"],
body.page .wpcf7 input[type="tel"],
body.page .wpcf7 select,
body.page .wpcf7 textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-top: 6px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    color: #222;
    background: #fff;
    border: 1px solid #cbd8ce;
    border-radius: 7px;
}

body.page .wpcf7 input:focus,
body.page .wpcf7 select:focus,
body.page .wpcf7 textarea:focus {
    outline: 2px solid #198754;
    outline-offset: 1px;
}

body.page .wpcf7 textarea {
    min-height: 110px;
    resize: vertical;
}

body.page .wpcf7 h3 {
    font-size: 25px;
    color: #202820;
    margin-bottom: 10px;
}

body.page .wpcf7 h4 {
    font-size: 19px;
    color: #198754;
    border-bottom: 1px solid #dce8df;
    padding-bottom: 8px;
    margin: 30px 0 15px;
}

body.page .wpcf7 .wpcf7-acceptance {
    display: block;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

body.page .wpcf7 .wpcf7-acceptance label {
    display: inline;
    font-weight: 400;
}

body.page .wpcf7 input[type="submit"] {
    display: inline-block;
    background: #198754;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 15px 28px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

body.page .wpcf7 input[type="submit"]:hover {
    background: #146c43;
}

body.page .wpcf7 .wpcf7-response-output {
    padding: 15px;
    border-radius: 7px;
    font-size: 15px;
}

@media (max-width: 650px) {
    body.page .entry-content:has(.wpcf7) {
        padding: 20px;
        margin: 15px auto 40px;
    }

    body.page:has(.wpcf7) h1 {
        font-size: 28px;
    }

    body.page .wpcf7 {
        padding: 20px;
        margin: 20px auto;
    }

    body.page .wpcf7 input[type="submit"] {
        width: 100%;
    }
}

/* ==========================================
   PC RECYCLE WOOCOMMERCE PRODUCT CARDS
   Uniform styling for Shop and Categories
   ========================================== */

/* Product grid */
main ul.products,
body.tax-product_cat ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
    margin: 0 0 35px !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Individual product cards */
main ul.products li.product,
body.tax-product_cat ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 15px !important;
    background: #ffffff !important;
    border: 1px solid #dce2e8 !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Product image */
main ul.products li.product a img,
body.tax-product_cat ul.products li.product a img {
    width: 100% !important;
    height: 245px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 0 15px !important;
    background: #ffffff !important;
}

/* Product title */
main ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    color: #17212b !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    min-height: 60px !important;
}

/* Remove purple link styling */
main ul.products li.product a,
body.tax-product_cat ul.products li.product a {
    text-decoration: none !important;
}

main ul.products li.product a:hover .woocommerce-loop-product__title {
    color: #198754 !important;
}

/* Price */
main ul.products li.product .price,
body.tax-product_cat ul.products li.product .price {
    color: #00894a !important;
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 18px !important;
}

/* Add to Cart buttons */
main ul.products li.product .button,
body.tax-product_cat ul.products li.product .button {
    background: #198754 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 11px 17px !important;
    font-family: Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin-top: auto !important;
    align-self: flex-start !important;
    display: inline-block !important;
}

main ul.products li.product .button:hover,
body.tax-product_cat ul.products li.product .button:hover {
    background: #146c43 !important;
    color: #ffffff !important;
}

/* Product card hover */
main ul.products li.product:hover,
body.tax-product_cat ul.products li.product:hover {
    box-shadow: 0 5px 16px rgba(0,0,0,0.09) !important;
}

/* Tablet */
@media (max-width: 900px) {
    main ul.products,
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile */
@media (max-width: 600px) {
    main ul.products,
    body.tax-product_cat ul.products {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    main ul.products li.product a img,
    body.tax-product_cat ul.products li.product a img {
        height: 220px !important;
    }

    main ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
        min-height: 0 !important;
    }
}

/* ==========================================
   PC RECYCLE - FIX CATEGORY GRID ALIGNMENT
   ========================================== */

/* Clear WooCommerce's original float layout */
body.tax-product_cat main ul.products::before,
body.tax-product_cat main ul.products::after,
body.post-type-archive-product main ul.products::before,
body.post-type-archive-product main ul.products::after {
    display: none !important;
    content: none !important;
}

/* Force a clean three-column grid */
body.tax-product_cat main ul.products,
body.post-type-archive-product main ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
    width: 100% !important;
    clear: both !important;
    align-items: stretch !important;
}

/* Reset WooCommerce column positioning */
body.tax-product_cat main ul.products li.product,
body.post-type-archive-product main ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    position: static !important;
    grid-column: auto !important;
}

/* Tablet */
@media (max-width: 900px) {
    body.tax-product_cat main ul.products,
    body.post-type-archive-product main ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile */
@media (max-width: 600px) {
    body.tax-product_cat main ul.products,
    body.post-type-archive-product main ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile-only navigation; desktop headers remain untouched. */
.pcr-mobile-toggle, .pcr-mobile-menu { display: none !important; }
@media (max-width: 900px) {
    .pcr-mobile-ready.pcr-navbar, nav.nav.pcr-mobile-ready {
        position: sticky !important; top: 0 !important; z-index: 1000 !important;
        height: auto !important; min-height: 60px !important; overflow: visible !important;
    }
    body.admin-bar .pcr-mobile-ready { top: 46px !important; }
    .pcr-mobile-ready > .pcr-header-wrap, .pcr-mobile-ready > .wrap {
        width: calc(100% - 24px) !important; min-height: 60px !important;
        height: auto !important; display: flex !important; flex-wrap: nowrap !important;
        align-items: center !important; justify-content: space-between !important;
        gap: 8px !important; padding: 5px 0 !important;
    }
    .pcr-mobile-ready .pcr-brand, .pcr-mobile-ready .brand {
        width: min(210px, 62vw) !important; min-width: 0 !important; height: auto !important;
        background: transparent !important;
    }
    .pcr-mobile-ready .pcr-brand img, .pcr-mobile-ready .brand img {
        width: 100% !important; height: auto !important; max-height: 54px !important; object-fit: contain !important;
    }
    .pcr-mobile-ready .pcr-navlinks, .pcr-mobile-ready .navlinks { display: none !important; }
    .pcr-mobile-ready .pcr-mobile-toggle {
        display: inline-flex !important; align-items: center; justify-content: center;
        min-height: 44px; flex: 0 0 auto; padding: 8px 12px; border: 1px solid #777;
        border-radius: 6px; background: #171b1e; color: white; font: 600 14px Arial,sans-serif; cursor: pointer;
    }
    .pcr-mobile-ready.pcr-mobile-open .pcr-mobile-menu {
        display: flex !important; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
        background: #111; padding: 8px 16px 16px; max-height: 65vh; overflow-y: auto;
        box-shadow: 0 8px 20px #0004;
    }
    .pcr-mobile-menu a { display: flex !important; align-items: center; min-height: 44px; padding: 10px 8px; color: #fff !important; text-decoration: none; font: 600 15px Arial,sans-serif; border-bottom: 1px solid #333; }
    .pcr-mobile-menu a.pcr-mobile-contact { color: #54d97d !important; }
    .pcr-mobile-menu a.pcr-mobile-shop { background: #198754; border-radius: 6px; justify-content: center; margin-top: 8px; }
    .pcr-mobile-menu a:focus-visible, .pcr-mobile-toggle:focus-visible { outline: 2px solid #54d97d; outline-offset: 2px; }
}
@media (max-width: 600px) {
    body.admin-bar .pcr-mobile-ready { top: 0 !important; }
    body.post-type-archive-product main, body.tax-product_cat main { padding: 12px !important; margin: 12px auto !important; }
    body.post-type-archive-product main ul.products, body.tax-product_cat main ul.products {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 10px !important;
    }
    body.post-type-archive-product main ul.products li.product, body.tax-product_cat main ul.products li.product { padding: 9px !important; border-radius: 8px !important; }
    body.post-type-archive-product main ul.products li.product a img, body.tax-product_cat main ul.products li.product a img { height: clamp(90px,32vw,160px) !important; margin-bottom: 8px !important; }
    body.post-type-archive-product main ul.products li.product .woocommerce-loop-product__title, body.tax-product_cat main ul.products li.product .woocommerce-loop-product__title { font-size: 13px !important; line-height: 1.35 !important; min-height: 0 !important; margin-bottom: 8px !important; overflow-wrap: anywhere; }
    body.post-type-archive-product main ul.products li.product .price, body.tax-product_cat main ul.products li.product .price { font-size: 15px !important; margin-bottom: 10px !important; }
    body.post-type-archive-product main ul.products li.product .button, body.tax-product_cat main ul.products li.product .button { display: flex !important; align-items: center; justify-content: center; text-align: center; align-self: stretch !important; min-height: 44px; padding: 8px 5px !important; font-size: 12px !important; white-space: normal; }
    .pcr-shop-categories { padding: 12px !important; margin-bottom: 18px !important; }
    .pcr-category-description { margin-bottom: 12px !important; }
    .pcr-category-btn { padding: 8px 10px !important; }
}

/* Compact mobile header, shared by both page template systems. */
@media (max-width: 900px) {
    body .pcr-topbar, body .topbar { display: none !important; }
    body .pcr-mobile-ready.pcr-navbar, body nav.nav.pcr-mobile-ready {
        min-height: 54px !important; background: #080808 !important;
    }
    body .pcr-mobile-ready > .pcr-header-wrap, body .pcr-mobile-ready > .wrap {
        min-height: 54px !important; padding: 3px 0 !important;
        width: calc(100% - 24px) !important; gap: 8px !important;
    }
    body .pcr-mobile-ready .pcr-brand, body .pcr-mobile-ready .brand {
        width: min(175px, 55vw) !important; flex: 0 1 auto !important;
    }
    body .pcr-mobile-ready .pcr-brand img, body .pcr-mobile-ready .brand img {
        max-height: 46px !important;
    }
    body .pcr-mobile-ready .pcr-mobile-toggle {
        border: 1px solid #444 !important; background: transparent !important;
        min-width: 44px; min-height: 44px; padding: 5px 10px !important;
        font: 600 14px Arial,sans-serif !important; white-space: nowrap !important;
    }
    body .pcr-mobile-ready.pcr-mobile-open > .pcr-mobile-menu {
        box-sizing: border-box; padding: 4px 16px 12px !important;
        gap: 0 !important; max-height: 65vh; max-height: 65dvh;
        border-top: 1px solid #333;
    }
    body .pcr-mobile-ready .pcr-mobile-menu > a {
        box-sizing: border-box !important; width: 100% !important;
        min-height: 44px !important; height: auto !important;
        margin: 0 !important; padding: 8px 10px !important;
        font: 600 14px/1.2 Arial,sans-serif !important;
        white-space: nowrap !important; text-align: left !important;
        justify-content: flex-start !important; letter-spacing: normal !important;
        border-radius: 0 !important;
    }
    body .pcr-mobile-ready .pcr-mobile-menu > a.pcr-mobile-contact { color: #54d97d !important; }
    body .pcr-mobile-ready .pcr-mobile-menu > a.pcr-mobile-shop {
        width: auto !important; align-self: flex-start !important;
        padding: 8px 16px !important; margin: 8px 0 0 10px !important;
        border: 0 !important; border-radius: 5px !important;
        background: #198754 !important; color: #fff !important;
        justify-content: center !important;
    }
    body.admin-bar .pcr-mobile-ready { top: 32px !important; }
}
@media (max-width: 782px) { body.admin-bar .pcr-mobile-ready { top: 46px !important; } }
@media (max-width: 600px) { body.admin-bar .pcr-mobile-ready { top: 0 !important; } }

/* Right-aligned mobile navigation panel. Keep labels on one line. */
@media (max-width: 900px) {
    body .pcr-mobile-ready.pcr-mobile-open > .pcr-mobile-menu {
        left: auto !important;
        right: 0 !important;
        width: clamp(192px, 60vw, 300px) !important;
        max-width: 100% !important;
        padding: 2px 10px 10px !important;
        border-radius: 0 0 0 12px !important;
        box-shadow: -6px 10px 24px rgba(0,0,0,.28) !important;
    }
    body .pcr-mobile-ready .pcr-mobile-menu > a {
        padding: 6px 4px !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    body .pcr-mobile-ready .pcr-mobile-menu > a.pcr-mobile-shop {
        margin: 6px 0 0 4px !important;
        padding: 6px 12px !important;
    }
}
