/**
 * Gift strip: compact row under parent line (not cart table columns).
 */

.magetime-gift-strip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 12px 8px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #0d9488;
    border-radius: 0 6px 6px 0;
}

.magetime-gift-strip--attached {
    margin-top: 0 !important;
    border: none !important;
    border-left: 3px solid #0d9488 !important;
    background: #f1f5f9 !important;
    border-radius: 0 0 6px 6px;
}

.magetime-gift-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transform: translate(-3px, -50%);
    display: inline-block;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.magetime-gift-strip__photo {
    display: block;
    flex-shrink: 0;
    line-height: 0;
    margin-left: 2px;
}

.magetime-gift-strip__photo img,
.magetime-gift-strip__photo .product-image-photo,
.magetime-gift-strip__photo .product-image-container,
.magetime-gift-strip__photo .product-image-wrapper,
.minicart-items .magetime-gift-strip__photo .product-image-photo,
.minicart-items .magetime-gift-strip__photo .product-image-container,
.minicart-items .magetime-gift-strip__photo .product-image-wrapper {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    object-fit: contain;
    border-radius: 4px;
    background: transparent !important;
    background-color: transparent !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
}

.magetime-gift-strip__photo .product-image-container,
.magetime-gift-strip__photo .product-image-wrapper {
    padding-bottom: 0 !important;
    height: 32px !important;
    border: 0 !important;
    box-shadow: none !important;
}

.magetime-gift-strip__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.magetime-gift-strip__name a {
    color: inherit;
    text-decoration: none;
}

.magetime-gift-strip__name a:hover {
    text-decoration: underline;
}

.magetime-gift-strip__qty {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

/* —— Cart page: gifts embedded in parent tbody (magetime-cart-line-group) —— */
.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group {
    border-bottom: 1px solid #e7e7e7 !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.item-info td {
    border-bottom: none !important;
}

/* Porto: edit/delete are position:absolute in .actions-toolbar — keep bottom space */
.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.item-actions td {
    border-bottom: none !important;
    position: relative;
    z-index: 2;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.item-actions .actions-toolbar {
    min-height: 20px !important;
    padding-bottom: 30px !important;
    position: relative;
    z-index: 2;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.item-actions + tr.magetime-gift-compact-row {
    position: relative;
    z-index: 1;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.item-actions + tr.magetime-gift-compact-row td.magetime-gift-compact-cell {
    padding-top: 6px !important;
}

.cart.table-wrapper #shopping-cart-table tr.magetime-gift-compact-row td.magetime-gift-compact-cell {
    display: table-cell !important;
    width: auto !important;
    padding: 0 10px 12px !important;
    border: 0 !important;
    vertical-align: middle !important;
    text-align: left !important;
    min-height: 0 !important;
    float: none !important;
    white-space: normal !important;
}

.cart.table-wrapper #shopping-cart-table tr.magetime-gift-compact-row td.magetime-gift-compact-cell::before,
.cart.table-wrapper #shopping-cart-table tr.magetime-gift-compact-row td.magetime-gift-compact-cell::after {
    display: none !important;
    content: none !important;
    padding: 0 !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group .magetime-gift-strip--cart {
    margin: 0 !important;
    max-width: none !important;
    width: 100%;
    min-height: 40px !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group tr.magetime-gift-compact-row + tr.magetime-gift-compact-row .magetime-gift-strip--attached {
    margin-top: 6px !important;
    border-radius: 0;
}

.cart.table-wrapper #shopping-cart-table .magetime-gift-strip__photo .product-item-photo {
    display: block !important;
    margin: 0 !important;
    min-height: 0 !important;
}

/* Orphan gift: standalone tbody (no parent line in cart) */
.cart.table-wrapper #shopping-cart-table tbody.magetime-gift-item {
    border-bottom: 1px solid #e7e7e7 !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-gift-item .magetime-gift-compact-cell {
    padding: 0 10px 12px !important;
    border: 0 !important;
    vertical-align: middle !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-gift-item tr.magetime-gift-compact-row td.magetime-gift-compact-cell::before {
    display: none !important;
    content: none !important;
}

.cart.table-wrapper #shopping-cart-table tbody.magetime-gift-item .magetime-gift-strip {
    margin: 0 !important;
    max-width: none !important;
}

/* —— Minicart —— */
.minicart-items .magetime-gift-strip-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.minicart-items .magetime-gift-strip-item .magetime-gift-strip--attached {
    margin: 0 0 8px;
    min-height: 38px;
    padding: 8px 10px 8px 12px;
    max-width: 100%;
}

.minicart-items .product-item.magetime-gift-strip-item {
    padding: 0 8px 8px 0;
    margin-top: 0;
    border: none;
    border-top: none;
    box-shadow: none;
}

.minicart-items .product-item.magetime-gift-strip-item + .product-item.magetime-gift-strip-item {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.minicart-items .product-item:not(.magetime-gift-strip-item):has(+ .product-item.magetime-gift-strip-item) {
    border-bottom: none !important;
    padding-bottom: 10px !important;
}

.minicart-items .product-item:not(.magetime-gift-strip-item):has(+ .product-item.magetime-gift-strip-item) > .product {
    border-bottom: none !important;
}

.minicart-items .product-item.magetime-gift-strip-item + .product-item:not(.magetime-gift-strip-item) {
    border-top: 1px solid #e7e7e7 !important;
}

.minicart-items .magetime-gift-strip-item .product {
    display: none !important;
}

.block-minicart .minicart-items .product-item:not(.magetime-gift-item) {
    padding-left: 0;
}

/* —— Checkout summary —— */
.magetime-gift-strip--summary {
    margin: 4px 0 10px 8px;
    min-height: 36px;
    padding: 6px 10px 6px 12px;
    max-width: calc(100% - 8px);
}

.checkout-index-index .opc-block-summary .product-item .magetime-gift-strip--summary {
    margin-left: 8px;
}

.email-items tr.magetime-gift-item-child td.item-info {
    padding-left: 16px;
}

.admin__table-primary tr.magetime-gift-item-child td.col-name {
    padding-left: 20px;
}

@media (max-width: 767px) {
    .magetime-gift-strip__photo img {
        width: 28px !important;
        height: 28px !important;
    }

    .cart.table-wrapper #shopping-cart-table tbody.magetime-cart-line-group .magetime-gift-strip--cart,
    .cart.table-wrapper #shopping-cart-table tbody.magetime-gift-item .magetime-gift-strip {
        min-height: 38px !important;
        padding: 8px 10px 8px 12px;
    }

    .cart.table-wrapper #shopping-cart-table tr.magetime-gift-compact-row td.magetime-gift-compact-cell {
        padding: 0 6px 10px !important;
    }
}
