:root {
    --primary-color: #FF6A00;
    --primary-light: #FFF0E5;
    --text-main: #333333;
    --text-sub: #666666;
    --text-light: #999999;
    --bg-color: #F6F7F9;
    --white: #FFFFFF;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 80px;
    max-width: 600px;
    margin: 0 auto;
    font-size: 14px;
}

/* Share Tip */
.share-tip {
    position: fixed;
    top: -50px;
    left: 0;
    width: 100%;
    background: #19be6b;
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 2000;
    transition: top 0.3s ease-in-out;
    box-sizing: border-box;
    font-size: 14px;
}
.share-tip.show {
    top: 0;
}
.u-flex { display: flex; flex-direction: row; align-items: center; }
.u-flex-col { display: flex; flex-direction: column; }
.u-flex-wrap { flex-wrap: wrap; }
.u-row-between { justify-content: space-between; }
.u-row-center { justify-content: center; }
.u-row-right { justify-content: flex-end; }
.u-col-center { align-items: center; }
.u-text-center { text-align: center; }
.u-text-right { text-align: right; }
.u-relative { position: relative; }
.u-absolute { position: absolute; }
.u-m-r-10 { margin-right: 5px; }
.u-m-l-10 { margin-left: 5px; }
.u-m-b-10 { margin-bottom: 5px; }
.u-p-10 { padding: 5px; }

/* Components */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Subtle shadow as seen in uniapp */
}

.card2 {
    border-radius: var(--border-radius);
    margin: 10px;;
}

/* Specific Page Styles - Pet Group Buy */

.top-status {
    background: #FFF0E5;
    color: #666;
    padding: 8px 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.hero-section {
    position: relative;
    /* width: 100%; */
    margin: 0 10px;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
}
.hero-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.hero-section .swiper-container{
    height: 100%;
}

/* Swiper Pagination Customization */
.hero-section .swiper-pagination {
    text-align: right;
    padding-right: 15px;
    bottom: 10px;
}

.hero-section .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    width: 6px;
    height: 6px;
    transition: all 0.3s;
}

.hero-section .swiper-pagination-bullet-active {
    background: #ffffff;
    width: 16px;
    border-radius: 4px;
}

.main-card {
    position: relative;
    /* margin-top: -20px; */
    z-index: 10;
    border-radius: 12px 12px 12px 12px;
    margin-left: 10px;
    margin-right: 10px;
}

.avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 5px;
}

.progress-container {
    height: 14px;
    background: #EEEEEE;
    border-radius: 7px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF8E6A, #FF6A00);
    border-radius: 7px;
    width: 0;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.progress-text {
    color: white;
    font-size: 10px;
    padding-right: 5px;
    line-height: 1;
}

.initiator-row {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
}
.initiator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}
.tag-auth {
    border: 1px solid #FFCCC7;
    color: #FF4D4F;
    background: #FFF0F0;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
    margin-left: 5px;
    display: inline-block;
    transform: scale(0.9);
}

.guarantee-tag {
    background: #FFF0F0;
    color: #FF4D4F;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    margin-bottom: 5px;
}
.guarantee-tag .fa {
    margin-right: 5px;
    font-size: 14px;
}

.detail-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}
.detail-content p {
    margin-bottom: 10px;
    text-align: justify;
}
.detail-content img {
    width: 100%;
    border-radius: 8px;
    display: block;
    margin: 10px 0;
}

.ad-card {
    margin: 10px;
}
.ad-label {
    background: white;
    color: #FF6A00;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    position: absolute;
    top: 10px;
    left: 10px;
}
.ad-content {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ad-img {
    max-width: 100%;
    
    border-radius: var(--border-radius);
}

.record-list .item {
    padding: 10px 0;
    border-bottom: 1px solid #f8f8f8;
}
.record-list .item:last-child { border-bottom: none; }
.record-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 8px 15px;
    /* display: flex;
    align-items: center; */
    box-shadow: 0 -1px 5px rgba(0,0,0,0.05);
    z-index: 100;
    max-width: 600px;
    margin: 0 auto;
}
.btn-share {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 10px;
    margin-right: 15px;
    background: none;
    border: none;
}
.btn-share .fa {
    font-size: 18px;
    margin-bottom: 2px;
}
.btn-primary {
    flex: 1;
    background: linear-gradient(90deg, #FF7A1A, #FF6A00);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}


/* Pay Page Specifics */
.address-card {
    position: relative;
}
.address-switch {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
}

.spec-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px;
}
.spec-item {
    width: 33.33%;
    padding: 5px;
}
.spec-btn {
    width: 100%;
    background: #F8F8F8;
    border: 1px solid #F8F8F8;
    color: #333;
    padding: 10px 0;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}
.spec-btn.active {
    background: #FFF5F0;
    border-color: #FF6A00;
    color: #FF6A00;
}
.spec-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 16px 16px;
    border-color: transparent transparent #FF6A00 transparent;
}
.spec-btn.active::before {
    content: '✔';
    position: absolute;
    bottom: -2px;
    right: 0px;
    color: white;
    font-size: 8px;
    z-index: 1;
    transform: scale(0.8);
}

.custom-input-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0 10px;
    height: 40px;
    margin-top: 10px;
}
.custom-input-box input {
    flex: 1;
    border: none;
    outline: none;
    text-align: left;
    font-size: 14px;
}

.product-row {
    display: flex;
}
.product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    margin-right: 10px;
}

.agreement {
    padding: 10px 15px;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
}
.checkbox-circle {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}
.checkbox-circle.checked {
    background: #FF6A00;
    border-color: #FF6A00;
}

#custom-weight {
    appearance: textfield;
    -moz-appearance: textfield;
}
#custom-weight::-webkit-inner-spin-button,
#custom-weight::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


  /* Popup Styles */
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
            display: none;
        }

        .popup-box {
            position: fixed;
            bottom: 0;
            left: 50%;
            width: 100%;
            max-width: 600px;
            background: #fff;
            z-index: 1000;
            border-radius: 12px 12px 0 0;
            transform: translateX(-50%) translateY(100%);
            transition: transform 0.3s ease-in-out;
        }

        .popup-box.show {
            transform: translateX(-50%) translateY(0);
        }

        .popup-header {
            padding: 15px;
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            border-bottom: 1px solid #f5f5f5;
            position: relative;
        }

        .popup-header .close-popup {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
            cursor: pointer;
            font-size: 20px;
        }

        .popup-content {
            padding: 15px;
            overflow-y: auto;
            /* Default max-height, overridden for specific popups if needed */
            max-height: 60vh; 
        }

        .popup-footer {
            padding: 15px;
            border-top: 1px solid #f5f5f5;
        }

        /* Pay Item Styles */
        .pay-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
            border-bottom: 1px solid #f9f9f9;
            cursor: pointer;
        }
        .pay-item:last-child {
            border-bottom: none;
        }
        .check-icon {
            color: #ddd;
            font-size: 20px;
        }
        
        /* Agreement Styles */
        .agreement-text p {
            margin-bottom: 10px;
            font-size: 14px;
            color: #333;
            line-height: 1.6;
            text-align: justify;
        }
        
        #agreement-popup .popup-content {
            height: 70vh; /* Taller for agreement */
        }