/* =====================================================
   RESET & BASE
   ===================================================== */
.cpg-single-product button,
.cpg-single-product .cpg-sp-opt-btn,
.cpg-single-product .cpg-sp-qty-btn,
.cpg-single-product .cpg-sp-nav,
.cpg-single-product .cpg-sp-btn,
.cpg-single-product .cpg-sp-sec-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: 0;
    text-decoration: none;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    font-family: inherit
}

.cpg-single-product button:not(.cpg-sp-add-to-cart):not(.cpg-sp-buy-now):not(.cpg-sp-opt-active) {
    background-color: #fff;
    color: #1f2937
}

/* =====================================================
   WRAPPER
   ===================================================== */
.cpg-single-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
    align-items: start;
    overflow-x: hidden
}

.cpg-single-product *,
.cpg-single-product *::before,
.cpg-single-product *::after {
    box-sizing: border-box
}

/* =====================================================
   GALLERY
   ===================================================== */
.cpg-sp-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0
}

.cpg-sp-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase
}

.cpg-sp-main-image-wrapper {
    position: relative;
    background: #f5f5f5;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 500px;
    max-height: 600px
}

.cpg-sp-slides {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center
}

.cpg-sp-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center
}

.cpg-sp-slide-active { display: flex }

.cpg-sp-slide img {
    width: 100%;
    height: 100% !important;
    display: block;
    object-fit: cover;
    border-radius: 0
}

.cpg-sp-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    transition: all .2s ease;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    overflow: visible !important
}

.cpg-sp-nav:hover {
    background: #f9fafb !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important
}

.cpg-sp-nav svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    color: #333 !important;
    stroke: #333 !important;
    fill: none !important;
    flex-shrink: 0 !important;
    visibility: visible !important;
    opacity: 1 !important
}

.cpg-sp-nav-prev { left: 10px }
.cpg-sp-nav-next { right: 10px }

/* =====================================================
   THUMBNAILS
   ===================================================== */
.cpg-sp-thumbnails {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none
}

.cpg-sp-thumbnails::-webkit-scrollbar { display: none }

.cpg-sp-thumb {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s ease;
    background: #f5f5f5
}

.cpg-sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.cpg-sp-thumb-active,
.cpg-sp-thumb:hover { border-color: #f97316 !important }

/* =====================================================
   DETAILS PANEL
   ===================================================== */
.cpg-sp-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow-x: hidden
}

.cpg-sp-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1a1a2e;
    line-height: 1.3 !important;
    margin: 0 0 10px 0 !important;
    padding: 0;
    word-break: break-word
}

.cpg-sp-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap
}

.cpg-sp-stars { display: flex; align-items: center; gap: 2px }

.cpg-sp-rating-text {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400
}

/* =====================================================
   OPTION BOXES (RAM / Storage)
   ===================================================== */
.cpg-sp-option-box {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    width: 100%
}

.cpg-sp-option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2f353a;
    margin-bottom: 10px
}

.cpg-sp-option-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%
}

.cpg-sp-opt-btn {
    width: 100%;
    padding: 8px 6px;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background: #fff !important;
    cursor: pointer;
    text-align: center;
    transition: all .2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    outline: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    min-height: 44px;
    overflow: hidden;
    white-space: normal;
    word-break: break-word
}

.cpg-sp-opt-btn:hover { border-color: #f15a28 !important }

.cpg-sp-opt-btn.cpg-sp-opt-active {
    background: #f15a28 !important;
    border-color: #f15a28 !important;
    color: #fff !important
}

.cpg-sp-opt-main {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    max-width: 100%
}

.cpg-sp-opt-extra {
    font-size: 11px;
    font-weight: 500;
    opacity: .85;
    line-height: 1.2;
    white-space: normal
}

.cpg-sp-opt-btn:not(.cpg-sp-opt-active) .cpg-sp-opt-main { color: #1f2937 !important }
.cpg-sp-opt-btn:not(.cpg-sp-opt-active) .cpg-sp-opt-extra { color: #6b7280 !important }
.cpg-sp-opt-btn.cpg-sp-opt-active .cpg-sp-opt-main,
.cpg-sp-opt-btn.cpg-sp-opt-active .cpg-sp-opt-extra { color: #fff !important }

/* =====================================================
   QTY + PRICE ROW
   ===================================================== */
.cpg-sp-qty-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 16px;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    width: 100%;
    flex-wrap: nowrap
}

.cpg-sp-quantity-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0
}

.cpg-sp-qty-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap
}

.cpg-sp-qty-controls {
    display: inline-flex;
    align-items: center;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible;
    background: transparent !important;
    gap: 4px
}

.cpg-sp-qty-btn {
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f3f4f6 !important;
    border: none !important;
    cursor: pointer;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    transition: background .15s;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    min-width: 30px !important;
    min-height: 30px !important
}

.cpg-sp-qty-btn:hover { background: #e5e7eb !important }

.cpg-sp-qty-input {
    width: 36px !important;
    height: 30px !important;
    border: none !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a2e !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important
}

.cpg-sp-qty-input::-webkit-outer-spin-button,
.cpg-sp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.cpg-sp-total-price-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0
}

.cpg-sp-total-label { font-size: 12px; color: #6b7280; font-weight: 500 }

.cpg-sp-price-display {
    display: flex;
    align-items: baseline;
    gap: 5px;
    justify-content: flex-end;
    flex-wrap: nowrap
}

.cpg-sp-current-price {
    font-size: 22px;
    font-weight: 700;
    color: #f97316 !important;
    white-space: nowrap;
    line-height: 1
}

.cpg-sp-original-price {
    font-size: 12px;
    color: #9ca3af !important;
    text-decoration: line-through;
    font-weight: 500;
    white-space: nowrap
}

.cpg-sp-savings {
    font-size: 11px;
    color: #22c55e !important;
    font-weight: 600;
    text-align: right
}

/* =====================================================
   INFO ROW
   ===================================================== */
.cpg-sp-info-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    gap: 16px;
    flex-wrap: wrap
}

.cpg-sp-urgency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #f97316
}

.cpg-sp-urgency-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    display: inline-block;
    animation: cpg-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0
}

@keyframes cpg-pulse {
    0%, 100% { opacity: 1 }
    50% { opacity: .4 }
}

.cpg-sp-delivery-est {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6
}

/* =====================================================
   ACTION BUTTONS
   ===================================================== */
.cpg-sp-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%
}

.cpg-sp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
    letter-spacing: .2px;
    width: 100%
}

.cpg-sp-add-to-cart { background: #f97316 !important; color: #fff !important }
.cpg-sp-add-to-cart:hover {
    background: #ea580c !important;
    transform: translateY(-1px);

}

.cpg-sp-buy-now { background: #2d2d3a !important; color: #fff !important }
.cpg-sp-buy-now:hover {
    background: #1a1a2e !important;
    transform: translateY(-1px);
 
}

/* =====================================================
   SECONDARY ACTIONS
   ===================================================== */
.cpg-sp-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%
}

.cpg-sp-sec-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: #fff !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 14px;
    font-weight: 600;
    color: #374151 !important;
    cursor: pointer;
    transition: all .2s ease;
    width: 100%
}

.cpg-sp-sec-btn:hover {
    border-color: #f97316 !important;
    color: #f97316 !important;
    background: #fff7ed !important
}

.cpg-sp-sec-btn svg { flex-shrink: 0 }

/* =====================================================
   DELIVERY BADGES
   ===================================================== */
.cpg-sp-badges-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    width: 100%
}

.cpg-sp-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 6px;
    background: #f9fafb !important;
    border-radius: 12px !important;
    border: 1px solid #f3f4f6 !important;
    gap: 6px
}

.cpg-sp-badge-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center }
.cpg-sp-badge-text { display: flex; flex-direction: column; gap: 1px }
.cpg-sp-badge-text strong { font-size: 12px; font-weight: 700; color: #1a1a2e }
.cpg-sp-badge-text span { font-size: 11px; color: #9ca3af; font-weight: 400 }

.cpg-error {
    text-align: center;
    padding: 30px;
    color: #ef4444;
    font-size: 15px;
    background: #fef2f2;
    border-radius: 12px;
    border: 1px solid #fecaca
}

/* =====================================================
   TABLET — 1024px
   ===================================================== */
@media (max-width: 1024px) {
    .cpg-single-product { gap: 28px; padding: 24px 16px }
    .cpg-sp-title { font-size: 24px !important }
    .cpg-sp-main-image-wrapper { min-height: 440px; max-height: 520px }
    .cpg-sp-qty-price-row { padding: 14px 16px; gap: 14px }
}

/* =====================================================
   MOBILE — 768px
   ===================================================== */
@media (max-width: 768px) {
    .cpg-single-product { grid-template-columns: 1fr; gap: 20px; padding: 16px 14px }
    .cpg-sp-main-image-wrapper { min-height: 320px; max-height: 420px }
    .cpg-sp-title { font-size: 20px !important; line-height: 1.3 !important }
    .cpg-sp-option-buttons { grid-template-columns: repeat(3, 1fr); gap: 7px }
    .cpg-sp-opt-btn { padding: 8px 4px; min-height: 48px }
    .cpg-sp-opt-main { font-size: 13px }
    .cpg-sp-opt-extra { font-size: 10px }
    .cpg-sp-qty-price-row { padding: 12px 14px; gap: 12px }
    .cpg-sp-current-price { font-size: 20px }
    .cpg-sp-action-buttons { grid-template-columns: 1fr 1fr; gap: 8px }
    .cpg-sp-btn { padding: 12px 10px; font-size: 14px }
    .cpg-sp-secondary-actions { grid-template-columns: 1fr 1fr; gap: 8px }
    .cpg-sp-badges-row { gap: 6px }
    .cpg-sp-badge { padding: 10px 4px }
    .cpg-sp-badge-text strong { font-size: 11px }
    .cpg-sp-badge-text span { font-size: 10px }
    .cpg-sp-thumb { width: 70px; height: 70px }
}

/* =====================================================
   MOBILE — 480px
   ===================================================== */
@media (max-width: 480px) {
    .cpg-single-product { padding: 14px 12px }
    .cpg-sp-title { font-size: 18px !important }
    .cpg-sp-main-image-wrapper { min-height: 260px; max-height: 340px }
    .cpg-sp-option-buttons { grid-template-columns: repeat(3, 1fr); gap: 6px }
    .cpg-sp-opt-btn { padding: 7px 4px; min-height: 46px }
    .cpg-sp-opt-main { font-size: 12px }
    .cpg-sp-opt-extra { font-size: 10px }
    .cpg-sp-qty-price-row { padding: 11px 12px; gap: 10px }
    .cpg-sp-current-price { font-size: 19px }
    .cpg-sp-btn { padding: 12px 8px; font-size: 13px; gap: 6px }
    .cpg-sp-btn svg { width: 16px !important; height: 16px !important }
    .cpg-sp-sec-btn { padding: 10px 8px; font-size: 13px }
    .cpg-sp-badge-icon { width: 28px; height: 28px }
    .cpg-sp-badge-icon svg { width: 22px !important; height: 22px !important }
}

/* =====================================================
   MOBILE — 375px  (iPhone SE / small screens)
   ===================================================== */
@media (max-width: 375px) {
    .cpg-single-product { padding: 12px 10px; gap: 16px }
    .cpg-sp-title { font-size: 16px !important; line-height: 1.3 !important; word-break: break-word }
    .cpg-sp-main-image-wrapper { min-height: 220px; max-height: 280px; border-radius: 12px }
    .cpg-sp-option-box { padding: 12px 10px; border-radius: 12px !important }
    .cpg-sp-option-buttons { grid-template-columns: repeat(3, 1fr); gap: 5px }
    .cpg-sp-opt-btn { padding: 6px 3px; min-height: 44px; border-radius: 10px !important }
    .cpg-sp-opt-main { font-size: 11px }
    .cpg-sp-opt-extra { font-size: 9px }
    .cpg-sp-qty-price-row { padding: 10px 12px; gap: 8px; border-radius: 12px !important }
    .cpg-sp-qty-btn { width: 28px !important; height: 28px !important; min-width: 28px !important; min-height: 28px !important; font-size: 16px !important }
    .cpg-sp-qty-input { width: 32px !important; font-size: 15px !important }
    .cpg-sp-current-price { font-size: 18px }
    .cpg-sp-total-label { font-size: 11px }
    .cpg-sp-action-buttons { grid-template-columns: 1fr 1fr; gap: 7px }
    .cpg-sp-btn { padding: 11px 6px; font-size: 12px; gap: 5px; border-radius: 10px }
    .cpg-sp-btn svg { width: 15px !important; height: 15px !important }
    .cpg-sp-secondary-actions { grid-template-columns: 1fr 1fr; gap: 7px }
    .cpg-sp-sec-btn { padding: 9px 6px; font-size: 12px; border-radius: 10px !important }
    .cpg-sp-badges-row { grid-template-columns: repeat(3, 1fr); gap: 5px; padding-top: 12px }
    .cpg-sp-badge { padding: 8px 4px; border-radius: 10px !important }
    .cpg-sp-badge-icon { width: 26px; height: 26px }
    .cpg-sp-badge-icon svg { width: 20px !important; height: 20px !important }
    .cpg-sp-badge-text strong { font-size: 10px }
    .cpg-sp-badge-text span { font-size: 9px }
    .cpg-sp-thumb { width: 80px; height: 80px; border-radius: 6px }
    .cpg-sp-thumbnails { gap: 6px }
    .cpg-sp-info-row { justify-content: flex-start; padding-bottom: 10px }
    .cpg-sp-delivery-est { font-size: 12px }
    .cpg-sp-urgency { font-size: 12px }
}

/* =====================================================
   WOOCOMMERCE TABS — RESPONSIVE
   ===================================================== */
.woocommerce-tabs .wc-tabs,
.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    border-bottom: 2px solid #e5e7eb !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    gap: 0 !important;
    background: #fff !important
}

.woocommerce-tabs .wc-tabs::-webkit-scrollbar,
.woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none !important }

.woocommerce-tabs .wc-tabs li,
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    flex-shrink: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important
}

.woocommerce-tabs .wc-tabs li a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -2px !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
    background: transparent !important
}

.woocommerce-tabs .wc-tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #F97316 !important;
    border-bottom-color: #F97316 !important;
    font-weight: 600 !important;
    background: transparent !important
}

.woocommerce-tabs .wc-tabs li a:hover,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover { color: #F97316 !important }

.woocommerce-tabs .woocommerce-Tabs-panel,
.woocommerce div.product .woocommerce-tabs .panel {
    padding: 20px 0 !important;
    border: none !important;
    background: transparent !important
}

@media (max-width: 480px) {
    .woocommerce-tabs .wc-tabs li a,
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        padding: 10px 14px !important;
        font-size: 13px !important
    }
    .woocommerce-tabs .woocommerce-Tabs-panel,
    .woocommerce div.product .woocommerce-tabs .panel {
        padding: 14px 0 !important;
        font-size: 14px !important;
        line-height: 1.7 !important
    }
    .woocommerce-tabs .woocommerce-Tabs-panel p,
    .woocommerce div.product .woocommerce-tabs .panel p {
        font-size: 14px !important;
        line-height: 1.7 !important;
        margin-bottom: 10px !important
    }
    .woocommerce-tabs table,
    .woocommerce div.product .woocommerce-tabs table { width: 100% !important; font-size: 13px !important }
    .woocommerce-tabs table td,
    .woocommerce-tabs table th,
    .woocommerce div.product .woocommerce-tabs table td,
    .woocommerce div.product .woocommerce-tabs table th {
        padding: 8px 8px !important;
        word-break: break-word !important
    }
}

@media (max-width: 375px) {
    .woocommerce-tabs .wc-tabs li a,
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        padding: 9px 12px !important;
        font-size: 12px !important
    }
}