/* Cart Page Specific Styles */

/* Mobile Styles */
@media (max-width: 480px) {
    .nav-search {
        display: none;
    }
    
    .nav-cart {
        margin-left: 140px;
    }
}

.navbar .nav-search {
    margin-left: auto !important;
}

.navbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.1rem 2rem !important;
    position: relative !important;
    min-height: 1.5rem !important;
}

.navbar .nav-links {
    margin-right: 2rem !important;
}

/* Let styles.css handle all navigation - removed conflicting rules */
.cart-main {
    padding-top: 120px;
    padding-bottom: 4rem;
    min-height: calc(100vh - 4rem);
    background-color: #f8f9fa;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* Desktop spacing to match apparel page */
@media (min-width: 769px) {
    .page-title {
        margin-top: 6rem;
    }
}

/* Flyer double-sided preview styles */
.flyer-sides-preview {
    display: flex;
    gap: 8px;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.flyer-side-container {
    position: relative;
    width: 100%;
    max-width: 80px;
}

.flyer-side-preview {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    object-fit: cover;
}

.side-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
}

.double-sided-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #007bff;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.back-only-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #6c757d;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 0 2rem;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

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

/* Business Card Cart Styles */
.business-card-item {
    grid-template-columns: 150px 1fr auto auto;
}

.business-card-preview {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.card-side-previews {
    display: flex;
    height: 100%;
    gap: 2px;
}

.card-side {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
}

.card-design-preview {
    width: 100%;
    height: 70%;
    object-fit: contain;
    border-radius: 4px;
}

.side-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
    text-align: center;
    padding: 2px 0;
    background: rgba(0,0,0,0.05);
    width: 100%;
}

.business-card-qty .qty-input {
    min-width: 60px;
}

.item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.design-preview-section {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.design-preview-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.design-preview-container {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
}

.design-preview {
    max-width: 76px;
    max-height: 76px;
    vertical-align: middle;
}


.no-design {
    text-align: center;
    color: #666;
}

.placeholder-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

.placeholder-text {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Flyer Item Specific Styles */
.flyer-item .item-image {
    width: auto;
    max-width: 120px;
    height: 150px; /* Taller for portrait flyers */
    min-width: 90px;
    position: relative;
}

.flyer-item .product-preview {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Envelope Item Specific Styles */
.envelope-item .item-image {
    width: 140px;
    height: 85px; /* Landscape aspect ratio for envelopes */
    min-width: 140px;
    position: relative;
}

.envelope-item .product-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.envelope-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    color: #666;
}

.envelope-placeholder .placeholder-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.envelope-placeholder .placeholder-text {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Flyer Side Indicator Styles */
.double-sided-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-color);
    color: white;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.back-only-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #666;
    color: white;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}


.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.item-specs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.spec-item {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #666;
}


.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
}

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.item-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #fee;
    color: #c0392b;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart-content svg {
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-cart-content h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-cart-content p {
    color: #999;
    margin-bottom: 2rem;
}

.continue-shopping-btn {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.continue-shopping-btn:hover {
    background: #0f3a4d;
    transform: translateY(-2px);
}

/* Cart Summary */
.cart-summary-section {
    height: fit-content;
    padding-bottom: 5rem;
}

.cart-summary {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 140px;
}

.cart-summary h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.shipping-line {
    align-items: center;
}

.shipping-selector {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
    max-width: 280px;
}

.shipping-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 77, 99, 0.1);
}

.tax-line {
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.total-line {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    padding-top: 1rem;
    margin-bottom: 2rem;
}

.checkout-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.checkout-btn:hover:not(:disabled) {
    background: #0f3a4d;
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.continue-shopping-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: block;
    text-align: center;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.continue-shopping-link:hover {
    color: #0f3a4d;
}

/* Tablet Responsiveness */
@media (max-width: 768px) and (min-width: 481px) {
    .cart-main {
        padding-top: 140px;
    }

    .cart-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 4rem;
        padding: 0 1rem;
    }

    .cart-item {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }

    /* Flyer mobile adjustments */
    .flyer-item {
        grid-template-columns: 80px 1fr;
    }

    .flyer-item .item-image {
        width: 80px;
        height: 100px;
        min-width: 80px;
        position: relative;
    }

    /* Envelope mobile adjustments */
    .envelope-item {
        grid-template-columns: 100px 1fr;
    }

    .envelope-item .item-image {
        width: 100px;
        height: 60px;
        min-width: 100px;
        position: relative;
    }

    .item-image {
        width: 100px;
        height: 100px;
    }

    .item-name {
        font-size: 1rem;
    }

    .item-specs {
        gap: 0.5rem;
    }

    .spec-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
    }

    .item-price {
        font-size: 1.1rem;
    }

    .quantity-controls {
        padding: 0.4rem;
    }

    .qty-btn {
        width: 28px;
        height: 28px;
    }

    .qty-input {
        width: 40px;
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.8rem;
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }

    .cart-items-section,
    .cart-summary {
        padding: 1.5rem;
    }

    .cart-summary {
        position: static;
    }

    .summary-line {
        font-size: 0.9rem;
    }

    .shipping-selector {
        font-size: 0.85rem;
        padding: 0.4rem;
        max-width: 100%;
    }

    .checkout-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Mobile Responsiveness - Phones */
@media (max-width: 480px) {
    .cart-main {
        padding-top: 140px;
        padding-bottom: 2rem;
    }

    .cart-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.6rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .cart-items-section,
    .cart-summary {
        padding: 1rem;
        border-radius: 10px;
    }

    .cart-summary h3 {
        font-size: 1.1rem;
        text-align: left;
        margin-bottom: 1rem;
    }

    .cart-item {
        grid-template-columns: 90px 1fr;
        text-align: left;
        gap: 1rem;
        padding: 1rem 0;
    }

    .item-image {
        width: 90px;
        height: 90px;
    }

    .flyer-item .item-image {
        width: 70px;
        height: 95px;
    }

    .envelope-item .item-image {
        width: 90px;
        height: 55px;
    }

    .item-details {
        text-align: left;
    }

    .item-name {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .item-specs {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .spec-item {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        gap: 1rem;
    }

    .item-price {
        font-size: 1rem;
        font-weight: 700;
    }

    .quantity-controls {
        padding: 0.3rem;
    }

    .qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }

    .qty-input {
        width: 35px;
        font-size: 0.85rem;
    }

    .remove-btn {
        font-size: 0.85rem;
        padding: 0.3rem;
    }

    .summary-line {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .shipping-selector {
        font-size: 0.8rem;
        padding: 0.5rem;
        width: 100%;
    }

    .total-line {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .checkout-btn {
        font-size: 1rem;
        padding: 1rem;
    }

    .continue-shopping-link {
        font-size: 0.9rem;
    }
}