/*
 * Apple-Style Upgrade Cards
 * Specific transformation for CPU and RAM sections
 */

/* Hide upgrade dropdowns */
select[name="attribute_pa_cpu_upgrade"],
select[name="attribute_pa_ram_upgrade"],
select[name="attribute_pa_ram"],
select[name="attribute_pa_memory"],
select[name="attribute_pa_memory_upgrade"],
select[name^="attribute_pa_storage"],
select[name^="attribute_pa_ssd"],
select[name^="attribute_pa_psu"],
select[name^="attribute_pa_gpu"],
select[name^="attribute_pa_board"],
select[name^="attribute_pa_cooler"],
select[name^="attribute_pa_casing"] {
    display: none !important;
}

/* Hide WooCommerce Clear variations link */
.variations .reset_variations,
.variations a.reset_variations {
    display: none !important;
}

/* Style upgrade sections */
.variations tr:has(select[name="attribute_pa_cpu_upgrade"]),
.variations tr:has(select[name="attribute_pa_ram_upgrade"]),
.variations tr:has(select[name="attribute_pa_ram"]),
.variations tr:has(select[name="attribute_pa_memory"]),
.variations tr:has(select[name="attribute_pa_memory_upgrade"]),
.variations tr:has(select[name^="attribute_pa_storage"]),
.variations tr:has(select[name^="attribute_pa_ssd"]),
.variations tr:has(select[name^="attribute_pa_psu"]),
.variations tr:has(select[name^="attribute_pa_gpu"]),
.variations tr:has(select[name^="attribute_pa_board"]),
.variations tr:has(select[name^="attribute_pa_cooler"]),
.variations tr:has(select[name^="attribute_pa_casing"]) {
    border: none !important;
    background: none !important;
}

/* Add spacing for all upgrade sections */
.variations tr:has(select[name="attribute_pa_cpu_upgrade"]),
.variations tr:has(select[name="attribute_pa_ram_upgrade"]),
.variations tr:has(select[name="attribute_pa_ram"]),
.variations tr:has(select[name="attribute_pa_memory"]),
.variations tr:has(select[name="attribute_pa_memory_upgrade"]),
.variations tr:has(select[name^="attribute_pa_storage"]),
.variations tr:has(select[name^="attribute_pa_ssd"]),
.variations tr:has(select[name^="attribute_pa_psu"]),
.variations tr:has(select[name^="attribute_pa_gpu"]),
.variations tr:has(select[name^="attribute_pa_board"]),
.variations tr:has(select[name^="attribute_pa_cooler"]),
.variations tr:has(select[name^="attribute_pa_casing"]) {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
}

.variations tr:has(select[name="attribute_pa_cpu_upgrade"]) .label,
.variations tr:has(select[name="attribute_pa_ram_upgrade"]) .label,
.variations tr:has(select[name="attribute_pa_ram"]) .label,
.variations tr:has(select[name="attribute_pa_memory"]) .label,
.variations tr:has(select[name="attribute_pa_memory_upgrade"]) .label,
.variations tr:has(select[name^="attribute_pa_storage"]) .label,
.variations tr:has(select[name^="attribute_pa_ssd"]) .label,
.variations tr:has(select[name^="attribute_pa_psu"]) .label,
.variations tr:has(select[name^="attribute_pa_gpu"]) .label,
.variations tr:has(select[name^="attribute_pa_board"]) .label,
.variations tr:has(select[name^="attribute_pa_cooler"]) .label,
.variations tr:has(select[name^="attribute_pa_casing"]) .label {
    margin-bottom: 0rem !important;
}


/* Upgrade Cards Container */
.cpu-upgrade-cards,
.ram-upgrade-cards,
.storage-upgrade-cards,
.psu-upgrade-cards,
.gpu-upgrade-cards,
.board-upgrade-cards,
.cooler-upgrade-cards,
.casing-upgrade-cards {
    display: grid;
    gap: 0.5rem;
    margin-top: 0;
}

/* Individual Upgrade Cards */
.cpu-card,
.ram-card,
.storage-card,
.psu-card,
.gpu-card,
.board-card,
.cooler-card,
.casing-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cpu-card:hover,
.ram-card:hover,
.storage-card:hover,
.psu-card:hover,
.gpu-card:hover,
.board-card:hover,
.cooler-card:hover,
.casing-card:hover {
    border-color: #DE354D;
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(222, 53, 77, 0.15);
}

.cpu-card.base-option,
.ram-card.base-option,
.storage-card.base-option,
.psu-card.base-option,
.gpu-card.base-option,
.board-card.base-option,
.cooler-card.base-option,
.casing-card.base-option {
    border-color: #e5e7eb !important;
    background: white !important;
}

.cpu-card.selected,
.ram-card.selected,
.storage-card.selected,
.psu-card.selected,
.gpu-card.selected,
.board-card.selected,
.cooler-card.selected,
.casing-card.selected {
    border-color: #DE354D !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(222, 53, 77, 0.1);
}

.cpu-card.base-option.selected,
.ram-card.base-option.selected,
.storage-card.base-option.selected,
.psu-card.base-option.selected,
.gpu-card.base-option.selected,
.board-card.base-option.selected,
.cooler-card.base-option.selected,
.casing-card.base-option.selected {
    border-color: #DE354D !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(222, 53, 77, 0.1);
}

/* Card Content */
.cpu-card-content,
.ram-card-content,
.storage-card-content,
.psu-card-content,
.gpu-card-content,
.board-card-content,
.cooler-card-content,
.casing-card-content {
    flex: 1;
}

.cpu-card-name,
.ram-card-name,
.storage-card-name,
.psu-card-name,
.gpu-card-name,
.board-card-name,
.cooler-card-name,
.casing-card-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    margin-bottom: 0.125rem;
    text-transform: uppercase;
    line-height: 1.2;
}

.cpu-card-subtitle,
.ram-card-subtitle,
.storage-card-subtitle,
.psu-card-subtitle,
.gpu-card-subtitle,
.board-card-subtitle,
.cooler-card-subtitle,
.casing-card-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.2;
}

.cpu-card-subtitle.base,
.ram-card-subtitle.base,
.storage-card-subtitle.base,
.psu-card-subtitle.base,
.gpu-card-subtitle.base,
.board-card-subtitle.base,
.cooler-card-subtitle.base,
.casing-card-subtitle.base {
    color: #DE354D;
    font-weight: 600;
}

/* Price Display */
.cpu-card-price,
.ram-card-price,
.storage-card-price,
.psu-card-price,
.gpu-card-price,
.board-card-price,
.cooler-card-price,
.casing-card-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: #DE354D;
    margin-left: 0.75rem;
}

.cpu-card-price.positive,
.ram-card-price.positive,
.storage-card-price.positive,
.psu-card-price.positive,
.gpu-card-price.positive,
.board-card-price.positive,
.cooler-card-price.positive,
.casing-card-price.positive {
    color: #DE354D;
}

.cpu-card-price.negative,
.ram-card-price.negative,
.storage-card-price.negative,
.psu-card-price.negative,
.gpu-card-price.negative,
.board-card-price.negative,
.cooler-card-price.negative,
.casing-card-price.negative {
    color: #4b5563;
}

.cpu-card-price.included,
.ram-card-price.included,
.storage-card-price.included,
.psu-card-price.included,
.gpu-card-price.included,
.board-card-price.included,
.cooler-card-price.included,
.casing-card-price.included {
    color: #059669;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpu-card,
    .ram-card,
    .psu-card,
    .gpu-card,
    .board-card,
    .cooler-card,
    .casing-card {
        padding: 0.875rem;
        min-height: 50px;
    }

    .cpu-card-name,
    .ram-card-name,
    .psu-card-name,
    .gpu-card-name,
    .board-card-name,
    .cooler-card-name,
    .casing-card-name {
        font-size: 0.8rem;
    }

    .cpu-card-price,
    .ram-card-price,
    .psu-card-price,
    .gpu-card-price,
    .board-card-price,
    .cooler-card-price,
    .casing-card-price {
        font-size: 0.8rem;
        margin-left: 0.5rem;
    }

    .cpu-card-subtitle,
    .ram-card-subtitle,
    .psu-card-subtitle,
    .gpu-card-subtitle,
    .board-card-subtitle,
    .cooler-card-subtitle,
    .casing-card-subtitle {
        font-size: 0.7rem;
    }
}

/* Section Header Styling */
.variations tr:has(select[name="attribute_pa_cpu_upgrade"]) .label label,
.variations tr:has(select[name="attribute_pa_ram_upgrade"]) .label label,
.variations tr:has(select[name="attribute_pa_ram"]) .label label,
.variations tr:has(select[name="attribute_pa_memory"]) .label label,
.variations tr:has(select[name="attribute_pa_memory_upgrade"]) .label label,
.variations tr:has(select[name^="attribute_pa_storage"]) .label label,
.variations tr:has(select[name^="attribute_pa_ssd"]) .label label,
.variations tr:has(select[name^="attribute_pa_psu"]) .label label,
.variations tr:has(select[name^="attribute_pa_gpu"]) .label label,
.variations tr:has(select[name^="attribute_pa_board"]) .label label,
.variations tr:has(select[name^="attribute_pa_cooler"]) .label label,
.variations tr:has(select[name^="attribute_pa_casing"]) .label label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem !important;
}

.variations tr:has(select[name="attribute_pa_cpu_upgrade"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20v2'%3E%3C/path%3E%3Cpath d='M12 2v2'%3E%3C/path%3E%3Cpath d='M17 20v2'%3E%3C/path%3E%3Cpath d='M17 2v2'%3E%3C/path%3E%3Cpath d='M2 12h2'%3E%3C/path%3E%3Cpath d='M2 17h2'%3E%3C/path%3E%3Cpath d='M2 7h2'%3E%3C/path%3E%3Cpath d='M20 12h2'%3E%3C/path%3E%3Cpath d='M20 17h2'%3E%3C/path%3E%3Cpath d='M20 7h2'%3E%3C/path%3E%3Cpath d='M7 20v2'%3E%3C/path%3E%3Cpath d='M7 2v2'%3E%3C/path%3E%3Crect x='4' y='4' width='16' height='16' rx='2'%3E%3C/rect%3E%3Crect x='8' y='8' width='8' height='8' rx='1'%3E%3C/rect%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name="attribute_pa_ram_upgrade"]) .label label::before,
.variations tr:has(select[name="attribute_pa_ram"]) .label label::before,
.variations tr:has(select[name="attribute_pa_memory"]) .label label::before,
.variations tr:has(select[name="attribute_pa_memory_upgrade"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 19v-3'%3E%3C/path%3E%3Cpath d='M10 19v-3'%3E%3C/path%3E%3Cpath d='M14 19v-3'%3E%3C/path%3E%3Cpath d='M18 19v-3'%3E%3C/path%3E%3Cpath d='M8 11V9'%3E%3C/path%3E%3Cpath d='M16 11V9'%3E%3C/path%3E%3Cpath d='M12 11V9'%3E%3C/path%3E%3Cpath d='M2 15h20'%3E%3C/path%3E%3Cpath d='M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_storage"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' x2='2' y1='12' y2='12'%3E%3C/line%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'%3E%3C/path%3E%3Cline x1='6' x2='6.01' y1='16' y2='16'%3E%3C/line%3E%3Cline x1='10' x2='10.01' y1='16' y2='16'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_ssd"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' x2='2' y1='12' y2='12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3Cline x1='6' x2='6.01' y1='16' y2='16'/%3E%3Cline x1='10' x2='10.01' y1='16' y2='16'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_psu"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z'/%3E%3Cpath d='m2 22 3-3'/%3E%3Cpath d='M7.5 13.5 10 11'/%3E%3Cpath d='M10.5 16.5 13 14'/%3E%3Cpath d='m18 3-4 4h6l-4 4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_gpu"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 21V3'/%3E%3Cpath d='M2 5h18a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2.26'/%3E%3Cpath d='M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3'/%3E%3Ccircle cx='16' cy='11' r='2'/%3E%3Ccircle cx='8' cy='11' r='2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_board"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M11.5 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m2 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-10 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 2a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zM5 3a1 1 0 0 0-1 1h-.5a.5.5 0 0 0 0 1H4v1h-.5a.5.5 0 0 0 0 1H4a1 1 0 0 0 1 1v.5a.5.5 0 0 0 1 0V8h1v.5a.5.5 0 0 0 1 0V8a1 1 0 0 0 1-1h.5a.5.5 0 0 0 0-1H9V5h.5a.5.5 0 0 0 0-1H9a1 1 0 0 0-1-1v-.5a.5.5 0 0 0-1 0V3H6v-.5a.5.5 0 0 0-1 0zm0 1h3v3H5zm6.5 7a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z'/%3E%3Cpath d='M1 2a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-2H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 9H1V8H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 6H1V5H.5a.5.5 0 0 1-.5-.5v-2A.5.5 0 0 1 .5 2zm1 11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_cooler"]) .label label::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z'/%3E%3Cpath d='M12 12v.01'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 0;
}

.variations tr:has(select[name^="attribute_pa_casing"]) .label label::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M10 6h4'/%3E%3Cpath d='M10 10h4'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
}

/* Mobile Sticky Header */
.swd-mobile-sticky-header {
    position: fixed !important;
    /* Chrome mobile: Account for dynamic viewport (address bar slide) */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 9999 !important; /* Above Chrome's UI */
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0 !important;
    opacity: 0;
    visibility: hidden; /* Extra visibility control for Chrome */
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s; /* Delay visibility hide */
    /* GPU acceleration */
    transform: translate3d(0, 0, 0) !important;
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0) !important;
    /* Chrome mobile viewport fix */
    min-height: 60px; /* Ensure minimum height even if viewport shrinks */
}

.swd-mobile-sticky-header.visible {
    opacity: 1 !important;
    visibility: visible !important; /* Immediate visibility show */
    pointer-events: auto !important;
    transition: opacity 0.2s ease; /* Only transition opacity when showing */
}

.swd-mobile-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    gap: 12px;
    padding: 12px 16px;
}

.swd-mobile-sticky-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.swd-mobile-sticky-title {
    display: none !important;
}

.swd-mobile-sticky-price {
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    color: #DE354D;
    margin: 0;
    line-height: 1.1;
}

.swd-mobile-sticky-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.swd-specs-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swd-specs-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Show Spec button below price */
.swd-show-specs-btn {
    font-family: inherit !important;
    background: transparent !important;
    border: none !important;
    color: #636B7D !important;
    padding: 2px 0 !important;
    cursor: pointer;
    transition: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px;
    font-size: 14px !important;
    font-weight: 300 !important;
    margin: 0 !important;
    text-align: left !important;
    width: auto !important;
}

.swd-show-specs-btn:hover {
    color: #636B7D !important; /* Keep same color on hover */
    font-weight: 300 !important;
}

.swd-show-specs-btn:active {
    color: #636B7D !important; /* Keep same color on click */
    font-weight: 300 !important;
}

.swd-show-specs-btn:focus {
    color: #636B7D !important; /* Keep same color on focus */
    font-weight: 300 !important;
    outline: none !important;
}

.swd-show-specs-btn .chevron-icon {
    transition: transform 0.3s ease;
    width: 16px;
    height: 16px;
}

/* Copy specs button in sticky actions */
.swd-copy-specs-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swd-copy-specs-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #007aff;
}

.swd-copy-specs-btn svg {
    width: 16px;
    height: 16px;
}

/* Sticky Add to Cart Button - Professional Style */
.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart {
    min-height: 40px;
    padding: 10px 16px;
    background: #DE354D;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    min-width: 110px;
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart:hover {
    background: #c12d42;
    transform: translateY(-1px);
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart:active {
    transform: translateY(0);
    background: #a8293a;
}

/* Loading state */
.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart.loading {
    pointer-events: none;
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart.loading .single_add_to_cart_button-text {
    opacity: 0.7;
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart .rey-lineLoader {
    display: none;
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart.loading .rey-lineLoader {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.swd-mobile-sticky-header .single_add_to_cart_button.swd-mobile-sticky-cart.loading .rey-lineLoader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    animation: slideLoader 1.5s infinite;
}

@keyframes slideLoader {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile Specs Panel */
.swd-mobile-specs-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 60vh;
    overflow-y: auto;
}

.swd-mobile-specs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(248, 250, 252, 0.8);
    font-weight: 600;
    font-size: 14px;
}

.swd-mobile-copy-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swd-mobile-copy-btn:hover {
    background: linear-gradient(135deg, #5b56f0 0%, #7c3aed 100%);
}

.swd-mobile-specs-content {
    padding: 16px 20px;
}

.swd-mobile-specs-header-info {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.swd-mobile-package-name {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 6px;
}

.swd-mobile-specs-list {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.swd-mobile-specs-section {
    margin-bottom: 16px;
}

.swd-mobile-spec-title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.swd-mobile-spec-item {
    margin-bottom: 4px;
    color: #374151;
    padding-left: 6px;
    border-left: 2px solid #e5e7eb;
}

.swd-mobile-spec-upgrade {
    margin-bottom: 4px;
    color: #059669;
    font-weight: 600;
    padding-left: 6px;
    border-left: 2px solid #10b981;
}

.swd-mobile-specs-total {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* Show only on mobile */
@media (max-width: 768px) {
    .swd-mobile-sticky-header {
        display: block !important; /* Force display for Chrome */
    }

    /* Prevent iOS overscroll/rubber band from affecting sticky */
    html, body {
        overscroll-behavior-y: none;
        -webkit-overflow-scrolling: touch;
    }

    /* Lock body position when sticky visible to prevent iOS shifts */
    body.swd-sticky-active {
        position: relative;
        overflow-x: hidden;
    }

    /* Chrome-specific: Ensure visibility when class added */
    .swd-mobile-sticky-header.visible {
        display: block !important;
        visibility: visible !important;
    }

    /* Lower sticky z-index when drawer/modal is open (PWP promotion, etc) */
    body.rey-drawer--visible .swd-mobile-sticky-header,
    body.modal-open .swd-mobile-sticky-header,
    body.drawer-open .swd-mobile-sticky-header,
    body.quickview-open .swd-mobile-sticky-header,
    body.rey-modal--visible .swd-mobile-sticky-header {
        z-index: 99 !important; /* Below drawer/modal (usually 1000+) */
    }

    /* Ensure sticky drops behind PWP drawer/backdrop */
    body.swd-pwp-drawer-open .swd-mobile-sticky-header {
        z-index: 1 !important;
        pointer-events: none !important;
    }
}

/* ============================================
   DESKTOP STICKY CART (RIGHT SIDE) - GRADIENT
   ============================================ */

.swd-desktop-sticky-cart {
    position: fixed;
    top: 10%;
    right: 14px;
    z-index: 999;
    opacity: 0;
    transform: translate(0, -50%) translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.swd-desktop-sticky-cart.visible {
    opacity: 1;
    transform: translate(0, -50%) translateY(0);
}

.swd-desktop-cart-button {
    background: linear-gradient(135deg, #DE354D 0%, #E85D6F 100%) !important;
    border: none !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 16px rgba(222, 53, 77, 0.25) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 !important;
    outline: none;
    overflow: hidden;
}

.swd-desktop-cart-button:hover {
    box-shadow: 0 8px 24px rgba(222, 53, 77, 0.35);
    transform: scale(1.02);
}

.swd-desktop-cart-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}

.swd-desktop-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.swd-desktop-cart-icon svg {
    width: 18px;
    height: 18px;
    color: white;
    stroke-width: 1.5;
}

.swd-desktop-cart-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
    flex: 1;
}

.swd-desktop-cart-price {
    font-size: 17px;
    font-weight: 600;
    color: white;
    line-height: 1;
    letter-spacing: -0.4px;
    white-space: nowrap;
}

.swd-desktop-cart-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 1px;
}

.swd-desktop-cart-upgrades,
.swd-desktop-cart-promotions {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.swd-desktop-cart-separator {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

/* Show only on desktop */
@media (min-width: 769px) {
    .swd-desktop-sticky-cart {
        display: block;
    }
}

/* ============================================
   APPLE-STYLE PC CONFIGURATION SECTION
   ============================================ */

/* Apple-style expandable section - now inside sticky header */
.apple-pc-config-section {
    display: block;
    width: 100%;
    background: transparent;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 0 !important;
}

/* Apple-style toggle button (exact Apple styling) */
.as-buttonlink.rf-moreless {
    background: transparent;
    border: none;
    color: #06c;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4705882353;
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    margin: 16px 0 !important;
    transition: opacity 0.2s ease !important;
    width: 100% !important; /* Full width */
    position: relative !important;
    z-index: 99999 !important; /* Above everything */
}

.as-buttonlink.rf-moreless:hover {
    opacity: 0.7;
}

/* Chevron icon styling */
.as-buttonlink.rf-moreless::after {
    content: "›";
    font-size: 20px;
    font-weight: 300;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.as-buttonlink.rf-moreless[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

.typography-body-reduced {
    font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    font-size: 17px;
    line-height: 1.4705882353;
    font-weight: 400;
    letter-spacing: -0.022em;
}

/* Apple chevron icons */
.icon.icon-after {
    position: relative;
}

.icon.icon-after::after {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
}

.icon-chevrondown::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3E%3Cpath fill='%23007aff' d='M8.5 11.5L3.5 6.5l1-1 4 4 4-4 1 1z'/%3E%3C/svg%3E");
}

.icon-chevronup::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3E%3Cpath fill='%23007aff' d='M8.5 5.5L13.5 10.5l-1 1-4-4-4 4-1-1z'/%3E%3C/svg%3E");
}

/* Apple-style content container */
.apple-config-content {
    overflow: hidden;
    transition: height 0.3s ease;
    background: #fff;
}

.apple-config-content[aria-hidden="true"] {
    height: 0px;
    border: none;
}

.apple-config-content[aria-hidden="false"] {
    height: auto;
    border-top: 1px solid #d2d2d7;
}

.apple-config-inner {
    padding: 12px 20px;
}

/* Compact specs styling */
.compact-specs {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Detailed specs styling */
.detailed-specs {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    font-family: inherit; /* Use Rey theme font */
}

.detailed-specs .spec-line {
    margin-bottom: 8px;
}

.detailed-specs .spec-price {
    margin: 16px 0 12px 0;
    padding-top: 12px;
    border-top: 1px solid #e5e5e7;
    color: #666;
}

.detailed-specs .spec-upgrades {
    margin: 12px 0 8px 0;
    color: #666;
}

.detailed-specs .spec-upgrade-item {
    margin-left: 16px;
    margin-bottom: 4px;
    color: #333;
}

.detailed-specs .spec-final-total {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e7;
    color: #DE354D;
    font-size: 14px;
}

/* Simple spec list */
.apple-spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.apple-spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e7;
    font-size: 15px;
}

.apple-spec-item:last-child {
    border-bottom: none;
}

.apple-spec-label {
    color: #86868b;
    font-weight: 400;
}

.apple-spec-value {
    color: #1d1d1f;
    font-weight: 400;
    text-align: right;
    flex: 1;
    margin-left: 20px;
}

/* Copy button */
.apple-copy-button {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    margin-top: 16px;
    width: 100%;
    transition: background-color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.apple-copy-button:hover {
    background: #0056b3;
}

.apple-copy-button:active {
    background: #004494;
    transform: scale(0.98);
}

.apple-copy-button.copied {
    background: #28a745;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .apple-pc-config-section {
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .apple-config-toggle {
        padding: 14px 16px;
    }

    .apple-config-label {
        font-size: 16px;
    }

    .apple-config-inner {
        padding: 16px;
    }

    .apple-spec-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }

    .apple-spec-value {
        margin-left: 0;
        margin-top: 4px;
        text-align: left;
    }
}

/* ============================================
   SHOP LOOP PRICE DISPLAY FOR PC PACKAGES
   ============================================ */

/* "From" price styling for product cards/archive pages */
.price .from-price {
    font-size: 0.85em;
    font-weight: 400;
    color: #666;
    text-transform: none;
    margin-right: 4px;
}

/* Make sure price is displayed properly on cards */
.woocommerce ul.products li.product .price {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-top: 8px;
}

/* Rey theme specific adjustments */
body.rey-theme .woocommerce ul.products li.product .price .from-price {
    font-weight: 300;
}
